Lesson 14 of 19
2. Back-of-Envelope Estimation

Memory card and where the analogy breaks

3 min read+10 XP

The memory card (tear this page out)

#QuestionMemory code
2.1Why estimate?Size decides shape
2.2Units?King Midas Gave Tea Parties: KB, MB, GB, TB, PB, each ×1,000
2.3Time shortcuts?A day is 100k seconds. A million a day is 12 a second.
2.4Latency numbers?Nano for memory, micro for the building, milli for the disk and the world
2.5Users to requests per second?Times, divide, times
2.6Read/write ratio?Read-heavy? Copy it. Write-heavy? Spread it.
2.7Peak vs average?Plan for 1 pm, not the daily average
2.8Storage?Writes × size × days × copies
2.9Bandwidth?Network speaks bits, storage speaks bytes. Times eight.
2.10Cache memory?Cache the hot 20%
2.11Servers?Peak ÷ per-server, leave headroom, add a spare
2.12Rounding and checks?Right zeros, not right decimals

The whole chapter in one line: Count the guests, plan for the lunch rush, round hard, and never forget the times eight.

Where the analogy breaks

  • Guests don't multiply overnight. Users can. A viral moment can bring 10 times the traffic in an hour, so systems need room to grow quickly (autoscaling, Chapter 6).
  • Food is eaten once. Data is kept, copied and backed up. Storage keeps growing every day, which is why you multiply by years and copies.
  • A caterer sees the guests arrive. A system has to predict them. That's why you state your assumptions and design for the peak.

Quick check

Five questions on this chapter. Pick an answer, then check it.

quiz