Capacity estimation in five minutes
The estimate is the part of a system design interview (some companies call it NALSD) that most candidates rush and most interviewers weight heavily, because the numbers decide the design. This lesson gives you a fixed order of operations and the reference numbers to carry in your head.
The order
- Rate: events per second from the stated scale. Write the formula before the number.
- Size: bytes per event on the wire and at rest. Say where each number comes from.
- Throughput: rate × size, in and out. This sizes the network and the queue.
- Storage: throughput at rest × retention × replication. This sizes the disks and the bill.
- Instances: rate ÷ per-instance capacity × headroom. Then per failure domain with N+1.
Doing them in this order means each number uses the previous one, so a mistake is easy to find and the interviewer can follow. Round aggressively: 86,400 seconds in a day is 10⁵, 2.5M is "a few million". Precision belongs in the design doc, not the whiteboard.
Numbers to know
seconds/day 86,400 ≈ 10⁵ requests/s per core (simple HTTP) 5k–20k rows/s per DB primary (OLTP writes) 5k–50k network per host 10–25 Gb/s ≈ 1–3 GB/s NVMe write 1–3 GB/s object storage, per GB-month ~$0.02 compressed metric sample 1–2 bytes JSON log line 200–500 bytes a regional failure plan for 1 of N regions gone
A worked example
2M hosts × 200 series ÷ 10 s = 40M samples/s. At 64 bytes on the wire that is 2.56 GB/s inbound, about the capacity of one fat NIC, so the collector tier needs several hosts per region before you even think about compute. Stored at 1.5 bytes per sample, a day is 40M × 1.5 × 86,400 ≈ 5.2 TB; 30 days with 3× replication is about 466 TB. If an ingester handles 500k samples/s, you need 80, or 104 with 1.3× headroom.
Headroom and failover
Headroom covers the gap between average and peak and the fact that nothing runs at 100%. 1.3× is a reasonable default for steady streams; 2× or more for bursty traffic like the top of the hour in a cron system. Failover is separate: if you have three regions and must survive losing one, each of the remaining two must absorb half of the lost region's load, so size each region at 1.5× its share. Say both multipliers and why they are different.
Saying it out loud
State the assumption, the formula, the number, then the implication, in that order: "Assume 64 bytes per sample. 40M per second times 64 is about 2.5 GB/s. That's more than one NIC, so ingest has to be a fleet behind a load balancer, not a single host." The implication is the part that scores; the arithmetic just earns the right to say it.