HLDArena
HLD-407·Messaging & Fan-out
Expert · 2,000 pts

Global Multiplayer Document Revision Log & OT/CRDT Sequencer

Design Google Docs / Notion’s collaborative editing backend sequencing concurrent character-level OT/CRDT operations, live comments, and lossless revision history.

Max p99
≤ 90 ms
Availability
≥ 99.5%
Budget
≤ $11,300

Functional Requirements

  • FR-1POST /docs/{doc_id}/ops — Sequences transformation against head revision and appends immutable op log.
  • FR-2GET /docs/{doc_id}/snapshot — Serves compacted document model + tail revisions to collaborators.
  • FR-3Retention & Lifecycle (doc_id) — Enforces TTL retention windows, deduplication, or archival compaction without blocking live reads or writes.
  • FR-4Strict serializable revision numbering per doc_id with zero lost keystrokes when primary storage crashes.

Workload Profile

Workday Editing68,000 Doc Read/Sync RPS / 13,000 Keystroke Op Batch RPS
Incident Postmortem Live-Edit Surge175,000 Read RPS / 36,000 Op Write RPS
Active Working Set44 GB active open document buffers & op rings
Consistency GateTotal order revision sequence + RPO = 0 durability

Consistency Model

Strict monotonic revision sequencing per doc_id + synchronous/quorum WAL so transformed ops never diverge.

Design Write-up
0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 180 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology