Design Google Docs
HardSystem design · Realtime Collaboration · Google
Design Google Docs. Multiple people edit the same document at once and see each other's changes and cursors in near real time. Documents are persisted with revision history, can be edited offline, and carry sharing permissions and comments.
In scope: the concurrent edit model (operational transform or CRDT), session routing and ownership, operation log and snapshots, presence, offline reconciliation, permissions and anchored comments. Out of scope: rich-text rendering and the file storage hierarchy of a drive.
Requirements
- Concurrent edits from many users converge to the same document on every client
- A single authoritative order per document with exclusive, fenced ownership
- Operation log plus snapshots for persistence, history and fast open
- Offline edits reconcile on reconnect; permissions are re-checked on revocation and comments stay anchored