// Foundations of Scale
Back-of-the-envelope numbers
System Design track · 20 min
- Turn daily users and actions into average and peak requests per second.
- Estimate how much storage and bandwidth a system needs over several years.
- Rank memory, SSD, disk and network by speed, to the nearest factor of ten.
In a team meeting, one engineer says: 'We need ten servers from day one.' Another says: 'One server is plenty.' Both are going on gut feeling, and the argument goes in circles.
The question 'can one database handle this?' is not a matter of feeling. It is arithmetic. With a few numbers in your head and one simple recipe, you can settle it on a scrap of paper in two minutes.
Most engineers guess. Some ask for a big cluster because the traffic 'sounds big'. Others panic over a load that one laptop could serve.
Both mistakes cost money: the first pays for machines nobody needs, the second gets caught out on launch day. An estimate swaps the feeling for a number, and a number can be checked.
Nobody needs the exact number. What matters is the order of magnitude: is it in the hundreds, the thousands, or the hundreds of thousands?
Whether you get 3,500 or 5,000 requests per second changes nothing in the design. Whether you get 3,500 or 350,000 changes everything. So round boldly and keep only what moves the decision.
- Data sizes: a KB is about a thousand bytes, an MB a million, a GB a billion, a TB a trillion. Close enough for any design conversation.
- One day has 86,400 seconds. Round it to 100,000 when you want a quick answer: dividing by 100,000 is just dropping five zeros.
- Peak traffic is about twice the average. Evenings, weekends and launch days squeeze the traffic together, so design for the peak, not the average.
- Reading the CPU's own cache: about 1 nanosecond. This is your unit; everything below is measured against it.
- Reading RAM: about 100 nanoseconds, so 100 times slower. Still almost free compared with everything below.
- A random read from an SSD: about 100 microseconds, roughly 1,000 times slower than RAM. That gap is why a cache hit and a database read are very different things.
- A network round trip inside one data centre: about 0.5 milliseconds. Cheap enough to make a few calls, but not thousands per request.
- A seek on an old spinning hard disk: about 10 milliseconds, around 100 times slower than an SSD. Random reads on these disks are the trap; reading in order is fine.
- A round trip between continents: about 150 milliseconds, some 300 times a hop inside the data centre. This is the speed of light, not bad engineering. Only moving the data closer, as a CDN does, shortens it.
- Requests per second (QPS) = daily active users × actions per user ÷ 86,400. QPS, queries per second, is how many requests your system serves each second on a normal day.
- Peak QPS ≈ 2 × average QPS.
- Storage per day = number of writes per day × size of one record. Multiply by the number of days you keep the data to get the total.
Say 10 million people use the app each day, and each sends 30 messages.
Messages per day = 10M × 30 = 300M. Quick version: 300M ÷ 100,000 = 3,000 per second. Exact version: 300M ÷ 86,400 ≈ 3,500 per second. Both say the same thing: thousands, not millions. Peak ≈ 7,000 per second.
Storage: say each message's metadata takes 50 bytes. 300M × 50 bytes = 15 GB per day. Keep five years: 15 GB × 365 × 5 ≈ 27 TB. Every number came from one multiplication or one division.
Now 10 million daily users, each uploading 2 photos a day at about 2 MB each.
Photos per day = 10M × 2 = 20M. New data per day = 20M × 2 MB = 40 TB. Per year: 40 TB × 365 ≈ 15 PB, before any backup copies.
Upload bandwidth = 40 TB ÷ 86,400 seconds ≈ 460 MB per second on average, and close to 1 GB per second at peak. People view photos about ten times more than they upload, so downloads run near 5 GB per second.
The lesson: here QPS is not the problem. Storage and bandwidth are, and bandwidth is what the cloud bill charges you for.
Your turn. Start with the presets (chat app, photo app, URL shortener), then change one input at a time. Notice which input moves the result by a factor of ten, and which barely moves it.
The most common slip is mixing units: bits with bytes, MB with GB, per day with per second. Write the unit next to every number, every time. The second slip is forgetting peak and backup copies: a design that fits the average with zero spare room falls over on the first busy evening.
Quick mental maths: 2 million people use a site each day, and each opens 10 pages. What is the average QPS, what is the peak, and do you need a big cluster?
Answer in your head first, then check.
Estimating is a recipe, not a talent: users × actions ÷ 86,400 for QPS, writes × size × days for storage, and peak is double the average. Round boldly. You are choosing an architecture, not filing a tax return.
Pick one system you work on. On a single page, estimate its average QPS, its peak QPS and how much its storage grows each month. You will probably find it is much smaller or much bigger than the team assumed. Both answers are useful.
- Turn daily users and actions into average and peak requests per second.
- Estimate how much storage and bandwidth a system needs over several years.
- Rank memory, SSD, disk and network by speed, to the nearest factor of ten.
Foundations of Scale