Back-of-the-envelope estimation
Quick, rough maths to estimate traffic, storage and bandwidth, so your design decisions are based on scale.
Why it matters
Without numbers you can't tell whether one server is enough or you need a hundred. Estimation turns a vague 'big app' into numbers that decide the design.
The idea
You turn the number of users into requests per second (QPS), storage per day and per year, and bandwidth. Rough is fine. A day has 86,400 seconds, about 100,000, so 1 million requests a day is about 12 per second. Peak traffic is often 2–5 times the average.
Working out how much food to buy for a party: number of guests × how much each person eats, plus extra for the hungry ones (the peak).
Party guests are a fixed number. Real traffic has spikes, like a viral post or a sale, that can be 10 times normal or more, so you design for the peak, not the average.
How it works
- Start from users: daily active users × actions per user per day = actions per day.
- Divide by about 100,000 (the seconds in a day, rounded) to get the average per second, then multiply by 2–5 for the peak.
- Split reads and writes. Example: 10 million users each read 20 pages and post 1 item a day → 200 million reads (about 2,000 a second) and 10 million writes (about 100 a second).
- Storage: writes per day × size of each item × days kept. 10 million posts × 1 KB = 10 GB a day, about 3.6 TB a year, or about 11 TB with 3 copies.
- Bandwidth: requests per second × response size. 2,000 reads a second × 100 KB = 200 MB a second going out.
- Then decide: is that one database or many? Does the hot data fit in a cache's memory? Do we need a CDN?
Example
A Twitter-like app: 300 million daily users, each posting 2 tweets a day, gives 600 million tweets a day, about 7,000 writes per second on average and maybe 15,000–20,000 at peak. At about 300 bytes each, that's 180 GB of text a day, or about 65 TB a year before media and replication.
Key points
- Use powers of ten for speed: KB ≈ 10³ bytes, MB ≈ 10⁶, GB ≈ 10⁹, TB ≈ 10¹², PB ≈ 10¹⁵.
- Seconds per day ≈ 10⁵. Requests per day ÷ 10⁵ ≈ requests per second.
- Read-to-write ratio matters: many apps read 10–100 times more than they write, which points to caching and read replicas.
- Latency ladder: memory read ≈ 100 ns; SSD read ≈ 100 µs; round trip inside a datacentre ≈ 0.5 ms; across a continent and back ≈ 100–150 ms.
- Storage = items per day × size × days kept × copies (often 3 for replication).
- Rough capacity: one app server handles thousands of simple requests per second; one SQL database handles thousands to tens of thousands of simple queries per second.
Common mistakes
- Spending 10 minutes on exact arithmetic. Round hard: 86,400 ≈ 100,000.
- Using the average and forgetting the peak.
- Mixing up bits and bytes: network speeds are in bits, so 1 Gbps ≈ 125 MB a second.
- Working out numbers and then never using them to make a decision.
Not true: 1 Gbps ≈ 1 GB of data a second.
In fact: Network speeds are given in bits, and a byte is 8 bits. 1 Gbps is about 125 MB a second.
Not true: Sizing: plan for the average load; the peak needs no extra planning.
In fact: Traffic comes in peaks, often several times the average. Size the system for the peak, or it fails just when it is needed most.
In the interview
I'll estimate the scale first, because it decides the design. For example, 100 million requests a day is only about 1,200 per second on average, maybe 5,000 at peak. A few load-balanced app servers and one database with read replicas can handle that. If it were 100 times more, I'd plan for sharding and heavy caching.
Part of Unit 0: How system design interviews work in the free System Design course.