Skip to content

Case study: Collaborative editor (Google Docs)

Design a real-time collaborative document editor: Operational Transformation vs sequence CRDTs, append-only operation logs with idempotent opIds, and snapshot compaction.

35 min9 steps

By the end you can
  • Estimate operation rates, op-log storage growth, snapshot compaction cadence, and cursor broadcast fan-out
  • Compare server-ordered Operational Transformation (OT) and sequence CRDTs (RGA) for concurrent text edits
  • Combine an append-only operation log with periodic object-store snapshots and client opId deduplication
  • Predict system behaviour under dropped WebSocket acks, compactor outages, and hot all-hands documents

Pin down what you are building

Features

  • Concurrent editing, cursors, offline merge, version restore

Targets

  • 0 ms local wait; remote propagation <150 ms

Safety

  • Eventual convergence; no lost/duplicate ops; about 100 writers, thousands of viewers

Why must a collaborative editor apply the user's keystroke locally before waiting for the server's acknowledgement?

Answer this step to continue.