Section 3: The Number That Isn't 150,000 - Scale Estimation & Workload Analysis
Executive Summary: The publish side comes to 150,000 messages a second at peak, about 2.4 Gbps, an ordinary load for a partitioned log. A fan-out of 4 turns that into 600,000 deliveries a second, half of them to queues we own and half to servers we don't. Storage is modest. The number that decides the architecture comes from Little's law: one big webhook timing out holds 90,000 requests in flight, five times the whole fleet's healthy load.
The interviewer caps the marker. "Before any boxes. How big is this?" You write down the agreed inputs: 100,000 accounts, 10 million topics, 200 million subscriptions, and an average of 50,000 publishes a second with a 3× daily peak. A message averages 2 KB (about 1.5 KB of body plus attributes and envelope), capped at 256 KB.
The Publish Side: An Ordinary Workload
Peak publishes: 50,000/s × 3 = 150,000/s
Daily volume: 50,000/s × 86,400 s = 4.32 billion messages/day
Ingest (avg): 50,000 × 2 KB = 100 MB/s
Ingest (peak): 150,000 × 2 KB = 300 MB/s ≈ 2.4 Gbps
300 MB/s of appends is routine for a replicated log spread across a few hundred partitions. ShopFast's order-events at 500 publishes a second is a rounding error in it.
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