Back-of-the-Envelope Estimation
Definition
Back-of-the-envelope estimate
- In plain English
- A back-of-the-envelope estimate is a quick, rough calculation that tells you whether a design is in the right ballpark.
- Think of it like
- It is like guessing how many pizzas a party needs before calling the shop.
QPS
- In plain English
- QPS, short for queries per second, is how many requests reach a system each second.
- Think of it like
- It is like counting how many cars pass a toll booth each second.
SSD
- In plain English
- An SSD is a storage device that keeps data on electronic chips rather than spinning disks.
- Think of it like
- It is like a filing cabinet with no moving drawers.
Why it exists
At 7:45 am, 5,000 parents open a bus tracker. You need to know whether one server will cope.
Five minutes of rough maths gives you a starting size. Write down assumptions so another person can check them.
How it works
Peak traffic
- In plain English
- Peak traffic is the busiest moment, often several times higher than the average.
- Think of it like
- Like a supermarket on Saturday morning compared with Tuesday afternoon.
Order of magnitude
- In plain English
- An order of magnitude is a factor of ten, so 1,000 and 10,000 differ by one order.
- Think of it like
- Like the difference between a village and a town.
| Quantity | Useful estimate |
|---|---|
| One day | 86,400 seconds; round to 100,000 |
| 1 million requests per day | About 11.6 per second; round to 12 |
| Decimal storage units | 1 KB = 1,000 bytes; each step to MB, GB and TB multiplies by 1,000 |
| Memory read | About 100 nanoseconds; one nanosecond is a billionth of a second |
| SSD storage read | About 100 microseconds; one microsecond is a millionth of a second |
| Round trip within a data centre | About 0.5 milliseconds; one millisecond is a thousandth of a second |
| Round trip across an ocean | About 100 milliseconds |
- Count users
Estimate daily active users.
- Count actions
Estimate requests per user per day.
- Multiply
Users × requests per user = requests per day.
- Find the average
Divide by 100,000 for rough QPS, or 86,400 for a closer result.
- Find the peak
Multiply average QPS by a peak factor based on expected busy periods.
- Estimate storage
Items per day × bytes per item × days retained = bytes stored.
Users and actions produce daily requests. Divide by seconds per day for average QPS, then apply a peak factor.
Examples
Separate reads from writes
200 buses send their location every ten seconds. During the 7:30–8:00 rush, 5,000 parents refresh every 15 seconds.
A write stores a bus location. A read retrieves locations for a parent.
Writes: 200 buses / 10 s = 20 writes/s
Reads: 5,000 parents / 15 s = 333.3 reads/s
Rounded reads: about 330/sThe insight
Reads and writes rarely arrive at the same rate.
Count stored and sent bytes
You host 10,000 episodes of 60 MB each. Listeners download one million episodes each month.
Stored data occupies disks. Outgoing data crosses the network; bandwidth describes how much data a connection carries per second.
Stored: 10,000 x 60 MB = 600,000 MB = 600 GB
Sent/month: 1,000,000 x 60 MB = 60,000,000 MB
Sent/month: 60 TBThe insight
Sending data repeatedly can cost more than storing it once.
Plan for opening time
30,000 visitors arrive, and 80% join a queue in the first five minutes. Assume all actions total 86,400 requests that day.
The opening burst is 24,000 ÷ 300 = 80 QPS. The assumed daily total gives an average of 1 QPS.
Daily requests include an opening spike of 80 QPS and quieter later traffic. Together they average one request per second.
The insight
Size for the busy period, with room for estimation errors.
Trade-offs
Pros
- Calculate a starting size quickly.
- Catch impossible designs early.
- Share explicit assumptions.
Cons
- Rough inputs produce rough answers.
- Missed peaks lead to too little capacity.
- Precise-looking numbers create false confidence.
Use when
- Start a design with rough calculations.
- Revisit estimates when usage changes.
Avoid when
- Do not replace realistic traffic tests with estimates.
- Avoid treating guessed inputs as measurements.
Quick check
Takeaways
- Rough maths beats guessing.
- One day is approximately 100,000 seconds.
- Estimate reads and writes separately, then size for peak traffic.