Loading
0x10Lesson 2 of 13

Estimate scale on the back of an envelope

Turn user counts into requests per second, storage, and bandwidth.

20 min 6-question quiz 2 code exercises
By the end of this lesson you can
  • Convert daily traffic into average and peak requests per second.
  • Estimate storage growth from write volume, record size, and retention.
  • Round aggressively and focus on orders of magnitude.

Estimation turns “lots of users” into numbers that drive decisions. Does the data fit on one machine? Do reads need a cache? Is one database enough for the write rate? You are not expected to be precise - you are expected to be within an order of magnitude, quickly, and to use the result.

The numbers to remember

  • A day has 86,400 seconds. For quick math, call it ~100,000 (10^5).
  • Average QPS = daily requests ÷ 86,400. Peak QPS is often assumed to be 2-3× the average.
  • Storage = writes per day × bytes per write × days retained.
  • Sizes: 1 KB ≈ 10^3 bytes, 1 MB ≈ 10^6, 1 GB ≈ 10^9, 1 TB ≈ 10^12, 1 PB ≈ 10^15.
  • Read:write ratio tells you which path to optimize. A social feed might be 100:1.
design.py
1daily_users = 100_000_000
2requests_per_user = 10
3average_qps = daily_users * requests_per_user / 86_400
4peak_qps = average_qps * 2
5print(f"Average: {average_qps:,.0f} QPS")
6print(f"Peak: {peak_qps:,.0f} QPS")
Output
Average: 11,574 QPS
Peak: 23,148 QPS

With the 10^5 shortcut: 100 million users × 10 requests = 10^9 requests per day, divided by 10^5 seconds ≈ 10,000 QPS. That is close enough to decide that a single application server will not do, but a handful behind a load balancer will. Storage works the same way: 1 million posts a day × 1 KB × 365 days × 5 years ≈ 1.8 TB, which a single database can hold - so you may not need sharding for size alone.

Key takeaways

  • QPS ≈ daily requests ÷ 10^5; plan for peaks of 2-3× the average.

  • Storage ≈ writes/day × size × retention.

  • Every estimate should end with a design consequence.

Lesson quiz

6 questions · pass with 5 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Practice: simulate system design building blocks

Use small Python programs to estimate capacity and simulate caches, load balancers, hash rings, and rate limiters. These exercises run locally in your browser.

Exercise 1

Estimate average and peak QPS

+25 XP

Read three lines: daily active users, requests per user per day, and a peak multiplier. Compute the average QPS as users * requests // 86400 (whole number), and the peak as average * multiplier. Print Average QPS: N and Peak QPS: N.

  • 50M users, 20 requests, 3× peak
  • 1M users, 10 requests, 2× peak
main.py
Loading editor…

Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.

Exercise 2

Estimate storage growth

+25 XP

Read three lines: writes per day, bytes per write, and years of retention. Using 365 days per year, print the total storage in whole gigabytes (10^9 bytes, rounded down) as N GB.

  • 1M writes of 1 KB for 5 years
  • 20M writes of 200 B for 3 years
main.py
Loading editor…

Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…

Did you like the lesson? 😆👍
Consider a donation to support our work: