Section 6: Two Systems Wearing One Logo - High-Level Architecture
Executive Summary: The platform is two systems behind one brand: a durable write tool for 500K daily writers and a cheap, wide read path for 25M daily readers, sharing Section 5's data model. We justify every box with a number, walk Maya's writes and Daniel's read, size the origin at ~6,000 req/s on ~24 instances, and preview each box's failure.
The interviewer slides the marker across: "Okay. Draw it." First, say the sentence the diagram must respect.
You: "This is two systems wearing one logo. The writer side takes ~1,560 autosaves a second at peak and promises an acknowledged save is never lost. The reader side takes 100 million views a day, under 100 ms, and stays up even when we don't. They share Section 5's draft, revisions and pointer, so I'll draw two paths that meet in the stores."
The Boxes
| Component | Job | The number that needs it |
|---|---|---|
| CDN + origin shield | Caches one HTML per post for everyone; serves every image | ≥ 95% HTML hit ratio; 17,500 image req/s peak at ≥ 99% hit; ~21 Gbps peak image egress |
| API gateway | Verifies sessions, rate-limits, routes | One trust check for ~6,000 origin req/s |
| Render service | Stateless: pointer row + revision body → HTML, with an in-memory body LRU | ≤ 175 misses/s peak, p95 ≤ 500 ms |
| Editor service | Drafts, autosave, checkpoints, publish | ~1,560 autosaves/s peak, ~3.5 publishes/s peak |
| Social service | /me, follows, claps, Following feed |
~2,100 /me/s and ~1,750 feed loads/s at peak |
| Postgres | System of record: users, publications, posts, revision metadata, outbox | ~500 GB in year one, < 500 writes/s peak |
| KV store | Current drafts, follow tables, feed inboxes, per-user claps | 100 GB of drafts, 300 GB of follows, 30 GB of inboxes |
| Object storage | Immutable revision bodies, checkpoints, images | ~234 TB/yr of images dwarfs everything else |
| Outbox relay + Kafka | Turns committed publishes (outbox) and claps/follows (KV change stream) into events | Five-plus consumers read the same event |
| Async workers | CDN purge, feed fan-out, indexing, image derivatives, notifications, stats | 230 inbox inserts/s average; 3,500 read events/s peak |
| OpenSearch | Keyword search | 50M posts, ~500 GB index; ~175 searches/s peak |
Three services, because the workloads differ: render is read-only, the editor owns the writers' one promise, and social carries the uncacheable personalized traffic. A bad editor deploy can't take articles down.
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson