Operations, not diffs
Each edit is an operation: {op: 'insert', pos: 5, char: 'x'}. Ops sent to server. Server orders + broadcasts.
Advertisement
Operations, not diffs
Each edit is an operation: {op: 'insert', pos: 5, char: 'x'}. Ops sent to server. Server orders + broadcasts.
Advertisement
Operational Transformation
Concurrent ops adjusted so all clients converge to same doc. If A inserts at pos 5 while B inserts at pos 5, both apply in a defined order.
CRDT alternative
Modern designs use CRDTs (Conflict-free Replicated Data Types). Ops carry unique IDs, merge without transformation. Google is moving pieces to CRDTs.
Ops log in Bigtable
Every op stored durably. Snapshots taken periodically. History = replay log. Undo = revert ops.
WebSocket + presence
Persistent connection per collaborator. Cursor positions, selections, presence broadcast. Sub-second visibility of others' work.