</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

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

The boxes: clients reach the CDN and render service for article HTML and the API gateway for editor and social calls; render, editor and social services use Postgres, object storage and KV; the outbox relay, KV change stream and view beacons feed Kafka, which drives async workers and OpenSearch

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

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.