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 & Difficulty | Stateful & Collaboration · HARD |
|---|---|
| Traffic Profile | 30,000 RPS sustained, 39,000 RPS spike (50% reads / 50% writes) |
| Latency & Availability SLA | p99 < 35 ms · 99.99% availability |
| Monthly Infra Budget | $700/month |
| Commonly Asked At | Google, 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):
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
Shared state every server can see
Keep fast-changing state in one shared place instead of inside each server.
Real-time fan-out with pub/sub
Deliver one message to many connected users within a second.
Queues: accept now, work later
Move slow work off the request and keep a queue from falling behind.
Related Stateful & Collaboration problems
Design Real-Time Gaming Leaderboard
Design a real-time gaming leaderboard handling 40,000 score submissions and rank lookups/sec. Keep p99 response time under 25ms without overloading backend SQL.
Design Zoom
Design Zoom: Architect a scalable, highly-available distributed system capable of sustaining 25,000 peak RPS (80% reads). Maintain p99 latency under 80ms with 99.9% availability while optimizing monthly infrastructure cost within $600/mo.
Design Google Drive
Design Google Drive: Architect a scalable, highly-available distributed system capable of sustaining 25,000 peak RPS (80% reads). Maintain p99 latency under 80ms with 99.9% availability while optimizing monthly infrastructure cost within $600/mo.
Design Gmail
Design Gmail: Architect a scalable, highly-available distributed system capable of sustaining 25,000 peak RPS (80% reads). Maintain p99 latency under 80ms with 99.9% availability while optimizing monthly infrastructure cost within $600/mo.