Skip to content
Visual explainer 3h to learn 4 steps

Back-of-envelope estimation

Estimate QPS, storage and bandwidth from user numbers in under five minutes.

By Invicly Tech, , in System Design Deep Dive. About 11 minutes to read.

Topic 2 of 33

In short

Back-of-envelope estimation turns user numbers into QPS, storage and bandwidth so you can size the system. Rough, rounded numbers are fine; the goal is the right order of magnitude.

Think of it like this: Like estimating groceries for a party: guests times portions, rounded up.

Explained simply

Estimation is quick, rough maths that tells you how big a system needs to be. You start with a number you know or assume, such as 10 million daily users, and turn it into requests per second, gigabytes of storage and network traffic.

Think of planning a road trip. You do not need fuel to the last millilitre, but you need to know whether it is one tank or five. Being off by two times is fine. Being off by a thousand times leads to the wrong car.

The numbers decide the design. Fifty requests per second fit on one small server and one database. Five hundred thousand requests per second need caches, many servers and a split-up database. Without an estimate, you are guessing which world you are in.

The trick is to round hard and keep your units. Treat a day as 100,000 seconds, write every step on the board and say your assumptions out loud. The interviewer can then correct an assumption instead of your arithmetic.

Press Play on a diagram to walk through it one step at a time.

FlowFrom users to capacity
  1. 1
    Daily active users

    Start from a stated or assumed DAU

  2. 2
    Actions per user

    Reads and writes per user per day

  3. 3
    Average QPS

    Daily requests divided by about 100,000 seconds

  4. 4
    Peak QPS

    Multiply average by 2 to 3

  5. 5
    Storage and bandwidth

    Requests times object size, over retention period

MapNumbers worth memorising
Estimation cheat sheet
  • Powers of two
    • 2^10 ≈ 1 thousand (KB)
    • 2^20 ≈ 1 million (MB)
    • 2^30 ≈ 1 billion (GB)
    • 2^40 ≈ 1 trillion (TB)
  • Latency
    • Memory read: ~100 ns
    • SSD random read: ~100 µs
    • Same-datacenter round trip: ~0.5 ms
    • Cross-continent round trip: ~150 ms
  • Time
    • 1 day ≈ 86,400 s ≈ 10^5 s
    • 1 month ≈ 2.5 million s
    • 1 year ≈ 3 x 10^7 s
FlowFrom peak traffic to a server count
  1. 1
    Peak QPS

    300,000 requests per second

  2. 2
    Per-server capacity

    Assume 2,000 requests per second each

  3. 3
    Raw servers

    300,000 ÷ 2,000 = 150

  4. 4
    Add headroom

    Run at 60% busy: 150 ÷ 0.6 = 250

  5. 5
    Spread out

    About 85 servers in each of 3 zones

LayersTypical sizes to plug into estimates
  1. 1
    Short text (tweet, chat message)

    100–300 bytes

  2. 2
    Row of metadata or JSON response

    About 1 KB

  3. 3
    Compressed photo for a feed

    200–500 KB

  4. 4
    Original phone photo

    2–5 MB

  5. 5
    One minute of HD video

    About 40 MB at 5 Mbps

In depth

From requests per second to number of servers

Once you know peak QPS, divide it by what one server can handle. A typical web server doing simple database-backed work handles somewhere between a few hundred and a few thousand requests per second. Pick a number, say it out loud, and move on.

Then add headroom. Servers should run at about 50 to 70 percent of their limit so they can absorb spikes and lose a machine without falling over. So 300,000 peak QPS divided by 2,000 per server is 150 servers, and at 60 percent busy you need about 250.

  • Servers = peak QPS ÷ per-server QPS ÷ target utilisation
  • Spread them over at least 2–3 availability zones

How much cache memory?

Traffic is rarely spread evenly. A common rule of thumb is 80/20: about 20 percent of items get 80 percent of the reads. So you do not need to cache everything, only the hot fifth.

Multiply the number of items read per day by their size, then take 20 percent. If users read 50 million distinct posts a day at 1 KB each, that is 50 GB, and caching 20 percent needs about 10 GB. That fits comfortably on one Redis server, though you would run two or three for redundancy.

FlowSizing a cache with the 80/20 rule
  1. Step 1
    Items read per day

    50 million distinct posts

  2. Step 2
    Times size

    x 1 KB = 50 GB

  3. Step 3
    Hot 20%

    About 10 GB

  4. Step 4
    Fits one Redis node

    Run 2 or 3 for safety

Bandwidth: bytes versus bits

Bandwidth is QPS times the size of each request or response. Ingress is data coming in (uploads) and egress is data going out (downloads). Egress is usually much bigger and costs money with most cloud providers.

Watch the units. Storage is measured in bytes, but network links are sold in bits per second. Multiply bytes by 8. If you serve 2,000 images per second at 500 KB each, that is 1 GB per second, or 8 gigabits per second. That is more than many single servers can push, which is exactly why images go through a CDN.

FlowFrom image traffic to link speed
  1. Step 1
    Requests

    2,000 images per second

  2. Step 2
    Times size

    x 500 KB = 1 GB per second

  3. Step 3
    Bytes to bits

    x 8 = 8 gigabits per second

  4. Step 4
    Compare

    More than many single servers can push

Hidden multipliers people forget

Raw numbers are only the start. Real systems store extra copies and extra data, and traffic is not flat. Mention these multipliers briefly to show you know real-world sizes are larger than the naive maths.

  • Replication: usually 3 copies, so storage × 3
  • Indexes and metadata: often 20–50% on top
  • Peak hours: 2–3 × average traffic, more for events
  • Growth: plan for 1–2 years ahead
  • Backups and logs: extra storage that is easy to forget

Sanity-checking with known capacities

After you get a number, compare it with what real machines can do. These are rough, but they tell you whether one box is enough. A single Redis node handles around 100,000 simple operations per second. A well-tuned PostgreSQL server can serve roughly 10,000 or more simple reads per second and a few thousand writes. A large server has hundreds of GB of RAM and tens of TB of SSD. A Kafka broker can move hundreds of MB per second.

If your estimate is 5,000 writes per second, one strong database might cope. At 500,000, you clearly need to partition.

Learn it in 4 short steps

About 45m each. Track them with a timer in your plan.

  1. 1
    Memorise powers of two and latency numbers~45m
  2. 2
    Estimate QPS from daily users~45m
  3. 3
    Estimate storage and bandwidth~45m
  4. 4
    Practise five quick estimates~45m

Key points

  • Round aggressively; a day is about 100,000 seconds.
  • Peak traffic is often two to three times the average.
  • Separate read and write QPS because they scale differently.
  • Storage equals writes per day times object size times retention.
  • State assumptions out loud so the interviewer can correct them.

Key terms

Tap a card to flip it. 0/5 known

Examples

text
100M DAU, each user posts 2 tweets/day, reads 100

Write QPS = 100M * 2 / 10^5      = 2,000/s
Read QPS  = 100M * 100 / 10^5    = 100,000/s
Peak read = 100,000 * 3          = 300,000/s

Tweet size ~ 300 bytes text
Daily     = 200M * 300 B         = 60 GB/day
5 years   = 60 GB * 365 * 5      ≈ 110 TB

A Twitter-style estimate in under five minutes.

Storage and bandwidth for a photo app

Assume 50 million daily users. Step 1: 10 percent upload one photo a day, so 5 million photos daily. Step 2: each stored photo with its thumbnails is about 2 MB, so 10 TB a day, or about 3.6 PB a year before replication. Step 3: each user views 50 photos a day at 200 KB, so 50M × 50 × 200 KB = 500 TB of egress a day. Step 4: divide by 100,000 seconds to get about 5 GB per second, which is 40 gigabits per second on average and more at peak. Conclusion: photos belong in object storage and must be served through a CDN.

A tiny estimation calculator

Writing the steps as code makes each assumption visible. Here 20 million daily users each make 30 reads. Average QPS is 6,000 and peak is 18,000. If one server handles 1,000 requests per second and we keep servers 60 percent busy, we need about 30 servers. Change any one input and you instantly see its effect.

python
dau = 20_000_000
reads_per_user = 30
day = 100_000                    # seconds, rounded up from 86,400

avg_qps = dau * reads_per_user / day
peak_qps = avg_qps * 3
servers = peak_qps / 1_000 / 0.6   # 1,000 req/s each, run at 60%

print(avg_qps, peak_qps, round(servers))  # 6000.0 18000.0 30

Quick reference

  • 1 day ≈ 10^5 seconds, so 1 million requests a day ≈ 12 per second
  • Peak ≈ 2–3 × average; size servers for peak at 50–70% utilisation
  • Cache size ≈ 20% of the data read per day (80/20 rule)
  • Bandwidth = QPS × size; multiply bytes by 8 to get bits
  • 1 million × 1 KB = 1 GB; 1 billion × 1 KB = 1 TB
  • Storage × 3 for replicas, plus 20–50% for indexes and metadata
  • Rough single-node limits: Redis ~100k ops/s, Postgres ~10k simple reads/s

Common mistakes

  • Doing precise arithmetic and wasting minutes on exact numbers.
  • Forgetting media files, which usually dominate storage.
  • Ignoring replication, which multiplies raw storage by about three.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1A service gets 1 billion requests a day. What is the rough average QPS?

Question 2

2Users read 100 million distinct items a day at 1 KB each. Using the 80/20 rule, how much cache do you need?

Question 3

3You send 500 MB per second. What is that in gigabits per second?

Question 4

4Why should servers run at around 60 percent busy instead of 100 percent?

Question 5

5Raw data is 100 TB. Which is a more realistic total disk need?

0/5 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    An app has 5 million daily users who each make 20 requests a day. Estimate average and peak QPS.

  2. Exercise 2medium

    A chat app has 100 million daily users who send 40 messages a day, each about 100 bytes. Estimate storage for 5 years, including replication.

  3. Exercise 3hard

    A video site receives 500 hours of video every minute. It stores 5 quality levels totalling 3 GB per hour of video. Estimate daily and yearly storage and say what it means for the design.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Should I use 86,400 or 100,000 seconds in a day?
Use 100,000 in interviews. It is within 15 percent of the real value and makes the maths instant, which is what matters.
What if the interviewer gives me no numbers?
Propose reasonable ones yourself, such as "let's assume 10 million daily users", and ask if that sounds right. Interviewers usually just want you to pick a scale.
How precise do my estimates need to be?
Only the order of magnitude matters. If the true answer is 3,000 QPS, saying 2,000 or 5,000 is fine, but saying 300 or 300,000 would lead to a different design.

Go deeper

ShareXLinkedInWhatsApp