System Design Lab
Google Docs changes shape when edit ordering becomes the constraint.
Start with one editable document. Increase collaborators, offline time, and reader fanout to see why the design needs WebSocket routing, a document room, OT/CRDT, an operation log, snapshots, and a separate presence path.
Normal evolution scenarios
Click left to right for the intended demo path. Each card changes the workload inputs.
Recommended shape
Bottlenecks
Why this changes
Decision tradeoffs
Source-backed rules
These are the durable system-design claims behind the model. The exact slider thresholds are deliberately labeled as teaching assumptions.
WebSocket fits low-latency bidirectional collaboration
The browser and server both need to send messages without opening a fresh HTTP request for every edit or cursor update.
MDN Web DocsOne authority per file keeps collaboration ordering understandable
Figma describes routing all clients for a file to a multiplayer server so the system has a clear coordination point for that file.
Figma EngineeringOT transforms operations generated against older versions
Operational Transformation adjusts incoming operations against changes that already happened, matching the stale-position risk in the lab.
TinyMCECRDTs trade central transforms for mergeable data structures
CRDT-based editors attach stable ordering metadata so replicas can merge edits and converge even when operations arrive in different orders.
System Design SandboxTeaching assumptions
- The thresholds are teaching thresholds, not Google production numbers.
- One document room is the ordering point for edits; large read or presence fanout can be split away from that room.
- Presence is modeled as best effort because cursor updates are ephemeral, unlike document operations.