Real-time Collaboration (OT / CRDT)
Difficulty: Hard | Topic #28
What to Learn
Operational Transformation (OT) for collaborative text editing, Conflict-Free Replicated Data Types (CRDTs) as the modern alternative, cursor/selection sync, version vectors, merging concurrent edits.
Resources
- Hello Interview: Google Docs Breakdown ↗
- System Design: Google Docs — OT, CRDT, Versioning ↗
- Ex-Google SWE: Collaborative Text Editing — OT vs CRDT ↗
Covered by Problems
| Problem | Difficulty | Link |
|---|---|---|
| Real-time Doc Collaboration (Google Docs) | Hard | → |
| Online Chess | Hard | → |
Key Concepts to Master
- OT — transform an operation to account for concurrent remote operations
- Convergence guarantee: all clients reach the same state regardless of operation order
- CRDT — data structures where concurrent updates automatically resolve (counters, sets, sequences)
- Vector clocks for tracking causality between operations
- Cursor/selection broadcast as a separate low-latency channel