What are Back of the Envelope Calculations and Why Do They Matter?
Why Quick Estimates Matter
Detailed capacity planning takes weeks. Back-of-envelope takes minutes. In design discussions and interviews, you need to rapidly validate assumptions. Can a single database handle this load? Do we need a cache? How many servers? Quick math gives you directionally correct answers to frame the design.
The goal is not precision. The goal is detecting orders of magnitude problems. If your estimate says you need 10 servers and reality needs 12, you are fine. If your estimate says 10 and reality needs 1000, you have a fundamental design flaw.
The Estimation Process
Step 1: Clarify the scale. How many users? How many requests per second? How much data? Get concrete numbers or state assumptions explicitly.
Step 2: Break down into components. A "user request" might involve: load balancer, application server, cache lookup, database query, response formatting. Estimate each separately.
Step 3: Apply memorized benchmarks. A single database handles about 10,000 queries/sec for simple lookups. An application server handles about 1,000 requests/sec for complex operations. An in-memory cache (like Redis, which stores data in RAM for fast access) handles about 100,000 ops/sec.
Step 4: Check for sanity. If you calculate needing 1000 database servers for 1 million users, something is wrong. Real systems serve millions with far fewer machines.
Common Estimation Anchors
Memory: 1 million users × 1KB = 1GB. Fits in RAM. 1 billion users × 1KB = 1TB. Needs distributed storage.
Storage: 1M posts/day × 1KB × 365 = 365GB/year. Add images at 1MB each: 365TB/year.
Traffic: 1M requests/day ÷ 100k seconds ≈ 10 requests/sec. 1B requests/day ≈ 10,000 requests/sec.
86,400 seconds/day becomes 100,000 for easy math. Close enough to validate a design.