Google Docs' system design
☰
Google Docs stores a document as a numbered list of changes, not as a file: your browser applies your typing instantly, one place orders each document's changes, and operational transformation shifts each change so every copy ends up the same.
+ The whole system in one paragraph− Hide
Google Docs doesn't save a document as a file; it keeps every change, in order. Your browser shows your typing instantly and sends it to one server, which numbers each change and passes it on. When two people type in the same spot, each change is shifted to fit the other (operational transformation), so every screen shows the same text.
In this lesson
4 chapters · ~8 min · a quick check in eachEverything is on this page — just scroll down ↓
The whole system
What it must do — and how well
One letter, from your keyboard to everyone
All of Docs on one page. Your browser applies each keystroke at once; Google's side checks who you are and what you may open, then one server orders every change in the revision log.
You type a letter. Your browser turns it into an operation — insert this character at this position — and shows it on your screen at once, without waiting.
How does Google Docs keep a document on its side?
Pick one — or just keep scrolling, it's not graded.
Keep going — it's free
Create your free account to unlock the rest of Google Docs's system design, keep your progress and pick up right where you left off.
- 2Typing together
- 3Offline
- 4Growth & failures
Ask anything about this system, or share how you'd design it.
Log in to join the conversation