DesignTheSystem/dev
HARD Stateful & Collaboration Asked at Google, Microsoft, Notion

Design Collaborative Document Editor

Design a real-time collaborative document editor like Google Docs with active keystroke sync for 30,000 concurrent edits/sec. Decouple fast session state from snapshot persistence.

Category & DifficultyStateful & Collaboration · HARD
Traffic Profile30,000 RPS sustained, 39,000 RPS spike (50% reads / 50% writes)
Latency & Availability SLAp99 < 35 ms · 99.99% availability
Monthly Infra Budget$700/month
Commonly Asked AtGoogle, Microsoft, Notion, Dropbox

Scale, traffic & SLA targets

To pass in the DesignTheSystem simulator, your architecture must hold all four targets simultaneously across a 60-second load run (spiking up to 39,000 RPS):

Peak traffic30,000 RPS50% reads / 50% writes
Latency (p99)< 35 ms99th percentile target
Availability99.99%Max error rate 0.01%
Monthly budget$700/moPriced per component

Functional & non-functional requirements

Functional scope

  • Serve Design Collaborative Document Editor at the traffic below.

Non-functional goals

  • p99 latency under 35 ms at the spike.
  • At least 99.99% of requests answered.
  • Costs no more than $700 a month.

Core challenge: Many people, one document

Edits from several people must merge into the same result for everyone. Keep the live document state in one shared place per document and send each edit to everyone viewing it.

What breaks first?

Run the starting design first and look at what breaks. Document DB reaches 694% of its capacity at the spike, and Doc OT Server 97%. About 54% of requests fail. Open Full metrics to see which requests pile up there, and ask why that part gets so much traffic.

Key architectural trade-offs

  • Shared state in memory needs a backup plan: replicate it, or be able to rebuild it from durable storage after a failure.

Starting architecture & how to practise

The simulator starts you with a baseline setup: Web & Mobile Clients → Doc OT Server → Document DB. Run the baseline under 30,000 RPS to watch exactly which component saturates first, then add caching, queues, replicas, sharding or CDN until latency, availability and cost all turn green.

Common interview questions for Design Collaborative Document Editor

What are the target SLA and scale numbers for Design Collaborative Document Editor?

Design for 30,000 RPS sustained (spiking to 39,000 RPS) with a 50% read / 50% write mix, keeping p99 latency under 35 ms, availability at or above 99.99%, and infrastructure spend within $700/month.

What is the main architectural bottleneck in Design Collaborative Document Editor?

Edits from several people must merge into the same result for everyone. Keep the live document state in one shared place per document and send each edit to everyone viewing it.

How can I verify my Design Collaborative Document Editor architecture works under load?

Open the live simulator to wire up load balancers, caches, queues, replicas, or shards and run a 60-second traffic simulation that grades latency, error rate, and monthly cost automatically.

Recommended lessons before you build

Related Stateful & Collaboration problems