System Design Phase 1 โ€” Part 8: Back-of-the-Envelope Estimation

Author Photo
Back-of-the-Envelope Estimation for System Design

Before you commit to an architecture, you need a rough sense of the numbers it must handle: how many requests per second, how much storage per year, how much bandwidth, how many servers. Back-of-the-envelope estimation is the skill of producing those numbers quickly with simple math and a few memorised constants โ€” no spreadsheets, no benchmarks, just enough accuracy to tell whether a design is sensible. This post is a single, flowing walkthrough of the whole skill. You will learn the powers of two that define data units, the latency numbers every programmer should know, how availability is measured in "nines" and tied to SLAs, and a repeatable method for estimating daily active users, QPS, peak traffic, storage, and bandwidth โ€” finishing with a complete worked example. Everything is explained with real-world analogies, a diagram, and step-by-step math, starting from zero.

๐Ÿงฎ 1. Back-of-the-Envelope Estimation

This is the one Phase 1 topic that is a single flowing subject rather than a set of separate sub-topics. It builds in order: first the raw ingredients every estimate relies on โ€” powers of two, latency numbers, and availability numbers โ€” then the step-by-step method for turning a few assumptions into capacity numbers, and finally a full worked example estimating QPS and storage.

Back-of-the-envelope estimation โ€” powers of two, latency numbers, availability, and capacity math

1.1 ๐ŸŽฏ Introduction

Imagine you're planning the infrastructure for our online store ShopEasy before a big launch. Someone asks: "How many servers do we need? How much database storage for a year? Will one cache fit in memory?" You don't have real traffic yet, and you can't run a benchmark on a system that doesn't exist. What you can do is reason it out on the back of an envelope โ€” a few assumptions, some simple multiplication, and a handful of numbers you've memorised โ€” and arrive at an answer that's roughly right. That's back-of-the-envelope estimation.

As Google's Jeff Dean put it, back-of-the-envelope calculations are "estimates you create using a combination of thought experiments and common performance numbers to get a good feel for which designs will meet your requirements." The goal is never a precise figure โ€” it's an order-of-magnitude answer: is this 10 servers or 10,000? 1 GB or 1 PB? That's usually enough to compare two designs and rule out the ones that can't possibly work.

To do this well, three things need to be second nature: the powers of two that define data sizes, the latency numbers that tell you how slow each operation is, and the availability numbers that translate a percentage like "99.99%" into real downtime. With those in hand, a simple method turns a few assumptions into a full capacity estimate. This post walks through all of it and ends with a complete worked example.

๐Ÿ’ก Estimation is about the process, not the exact number. A good estimate shows clear assumptions, sensible rounding, and correct units. Two engineers estimating the same system should land in the same ballpark โ€” that ballpark is what guides the design.

1.2 ๐Ÿ’ก Why It Matters

Estimation is what turns a vague idea into an engineering decision. Before writing a line of code, a rough calculation tells you whether the data fits on one machine or needs sharding, whether reads can be served from a cache, and how much the whole thing will cost to run. The numbers involved are huge and non-obvious: Twitter-scale services handle thousands of writes per second and tens of thousands at peak; five years of media can add up to tens of petabytes. Guessing wrong by an order of magnitude means either a system that falls over on day one or a cluster that costs 10ร— more than needed.

  • Feasibility โ€” a quick estimate reveals whether a design is even possible. If one machine can do 10,000 QPS and you need 700,000, you immediately know you need ~70 machines, not one.
  • Provisioning โ€” capacity numbers decide how many servers, how much storage, and how big a cache to allocate โ€” and how much to budget.
  • Comparing designs โ€” estimates let you rule out approaches cheaply. A design that would need a petabyte of RAM is off the table before you build it.
  • Planning for peaks โ€” average load is not what breaks systems; the peak does. Estimation makes you size for the spike, not the average.
Why system design cares: almost every design starts by scoping the problem with numbers โ€” DAU, QPS, storage, bandwidth. Those estimates drive every later choice: SQL vs NoSQL, single database vs sharded, cache or no cache, one region or many. Get the scale right and the rest of the design follows.

1.3 ๐Ÿ  Real-world Analogy

Think about catering a wedding. You don't know exactly how many guests will show up or precisely how much each will eat โ€” but you still have to order food and book a venue in advance. So you estimate: "About 200 guests. Say each eats roughly 0.5 kg of food โ€” that's 100 kg. Drinks: 3 glasses each, 600 glasses. Round up for a safety margin." Nobody weighs every plate; a few reasonable assumptions and simple multiplication get you close enough to place the order confidently.

System estimation is exactly this. Guests become users, "how much each eats" becomes requests per user or bytes per item, and the safety margin becomes the peak factor you multiply by so you don't run out during the rush. You'd rather slightly over-cater than have guests go hungry โ€” just as you'd rather provision for the traffic peak than crash during it.

Wedding CateringSystem EstimationMeaning
๐Ÿ‘ฐ Expected number of guests๐Ÿ‘ฅ Daily active users (DAU)The size of the audience you serve
๐Ÿฝ๏ธ Food each guest eats๐Ÿ“จ Requests / bytes per userPer-unit demand you multiply out
๐Ÿงฎ Guests ร— food per guestโœ–๏ธ Users ร— requests per userThe core estimation multiplication
๐ŸŽ‰ Extra for the dinner rush๐Ÿ“ˆ Peak factor (ร—2โ€“ร—3)Size for the spike, not the average
๐Ÿ“ฆ Total food to order & store๐Ÿ’พ Storage & bandwidth to provisionWhat you must have ready in advance

The caterer's skill isn't exact prediction โ€” it's making sensible assumptions, doing quick arithmetic, and building in a margin. Every estimate in this post follows the same recipe: state assumptions, multiply, round, and pad for the peak.

1.4 ๐Ÿ“– Key Terms

TermSimple DefinitionQuick Example
MAUMonthly Active Users โ€” unique users in a month300 million
DAUDaily Active Users โ€” unique users in a day150 million
QPSQueries (requests) Per Second the system handles~3,500 writes/sec
Peak QPSQPS during the busiest period, not the average2 ร— average โ‰ˆ 7,000
ThroughputTotal work processed per unit timeRequests or MB per second
StorageTotal data kept on disk over time~55 PB over 5 years
BandwidthData transferred per second (in or out)~347 MB/s of uploads
Read/Write ratioHow many reads occur per write100:1 (read-heavy)
LatencyTime for a single operation to completeDisk seek โ‰ˆ 10 ms
Availability% of time the system is operational99.99% ("four nines")
SLAService Level Agreement โ€” promised uptimeCloud providers โ‰ฅ 99.9%
Byte8 bits; one ASCII character = 1 byte"A" = 1 byte

1.5 ๐Ÿ”ข How It Works

Estimation rests on three sets of numbers you should know cold โ€” powers of two, latency numbers, and availability numbers โ€” plus a repeatable method that turns assumptions into capacity. We'll cover each in turn.

A. Powers of Two & Data Units

Data volume is measured in bytes, and a byte is 8 bits (one ASCII character fits in a byte). Because computers are binary, storage units are powers of two, but for estimation you round them to the nearest power of ten โ€” that's what makes the mental math easy. Memorise this table:

Power of 2Approximate valueFull nameShort name
2101 Thousand1 Kilobyte1 KB
2201 Million1 Megabyte1 MB
2301 Billion1 Gigabyte1 GB
2401 Trillion1 Terabyte1 TB
2501 Quadrillion1 Petabyte1 PB

So a thousand bytes โ‰ˆ 1 KB, a million โ‰ˆ 1 MB, a billion โ‰ˆ 1 GB, a trillion โ‰ˆ 1 TB, and a quadrillion โ‰ˆ 1 PB. Each step up is ร—1,000. When an estimate produces "30 ร— 1012 bytes," you instantly read it as 30 TB.

B. Latency Numbers Every Programmer Should Know

These are the classic latency numbers published by Google's Dr. Jeff Dean. They let you reason about whether an operation is cheap (memory) or expensive (disk, cross-continent network) without measuring. The original 2010 numbers:

OperationTime
L1 cache reference0.5 ns
Branch mispredict5 ns
L2 cache reference7 ns
Mutex lock/unlock100 ns
Main memory reference100 ns
Compress 1 KB with Zippy10,000 ns = 10 ยตs
Send 2 KB over 1 Gbps network20,000 ns = 20 ยตs
Read 1 MB sequentially from memory250,000 ns = 250 ยตs
Round trip within the same datacenter500,000 ns = 500 ยตs
Disk seek10,000,000 ns = 10 ms
Read 1 MB sequentially from the network10,000,000 ns = 10 ms
Read 1 MB sequentially from disk30,000,000 ns = 30 ms
Send packet CA โ†’ Netherlands โ†’ CA150,000,000 ns = 150 ms
๐Ÿ“ Units: ns = nanosecond, ยตs = microsecond, ms = millisecond. 1 ns = 10-9 s; 1 ยตs = 10-6 s = 1,000 ns; 1 ms = 10-3 s = 1,000 ยตs = 1,000,000 ns.

Hardware has improved since 2010. A 2020 visualisation of the same operations shows memory and SSD getting much faster, while the cross-continent network round trip barely changes (it's bounded by the speed of light):

Operation (2020)Time
L1 cache reference1 ns
Branch mispredict3 ns
L2 cache reference4 ns
Mutex lock/unlock17 ns
Send 2,000 bytes over commodity network44 ns
Main memory reference100 ns
Compress 1 KB with Zippy2,000 ns โ‰ˆ 2 ยตs
Read 1 MB sequentially from memory3,000 ns โ‰ˆ 3 ยตs
SSD random read16,000 ns โ‰ˆ 16 ยตs
Read 1 MB sequentially from SSD49,000 ns โ‰ˆ 49 ยตs
Round trip in same datacenter500,000 ns โ‰ˆ 500 ยตs
Read 1 MB sequentially from disk825,000 ns โ‰ˆ 825 ยตs
Disk seek2,000,000 ns โ‰ˆ 2 ms
Packet round trip CA โ†’ Netherlands150,000,000 ns โ‰ˆ 150 ms

Whichever year's numbers you use, the same five lessons hold:

  • Memory is fast, but the disk is slow.
  • Avoid disk seeks if possible.
  • Simple compression algorithms are fast.
  • Compress data before sending it over the internet if possible.
  • Data centers are usually in different regions, and it takes time to send data between them.

C. Availability Numbers & the Nines

Availability is the percentage of time a system is operational. 100% means zero downtime; most services live between 99% and 100%. A Service Level Agreement (SLA) is the provider's formal promise of uptime โ€” the big cloud providers (AWS, Google, Azure) set SLAs at 99.9% or higher. Availability is spoken of in "nines," and each extra nine is a big jump: it cuts allowed downtime by ~10ร—.

Availability %Downtime/dayDowntime/weekDowntime/monthDowntime/year
99% (two nines)14.40 min1.68 hours7.31 hours3.65 days
99.9% (three nines)1.44 min10.08 min43.83 min8.77 hours
99.99% (four nines)8.64 s1.01 min4.38 min52.60 min
99.999% (five nines)864.00 ms6.05 s26.30 s5.26 min
99.9999% (six nines)86.40 ms604.80 ms2.63 s31.56 s

Read this the right way round: "four nines" (99.99%) sounds nearly perfect, yet it still allows almost an hour of downtime a year. Chasing more nines is expensive, so you match the target to the service โ€” a payment system aims high, an internal dashboard doesn't need to.

D. The Estimation Method

With those constants in hand, every capacity estimate follows the same funnel: start from users, multiply by per-user activity, divide by seconds, then pad for the peak. Here is the repeatable recipe:

StepWhat You ComputeHow
โ‘ State assumptionsUsers, actions per user per day, item sizes, retention period, peak factor โ€” write them all down
โ‘กDAUMAU ร— (percent active daily)
โ‘ขAverage QPSDAU ร— actions per user รท 86,400 (seconds in a day)
โ‘ฃPeak QPSAverage QPS ร— peak factor (typically ร—2 to ร—3)
โ‘คStorage per dayDAU ร— writes per user ร— size per item
โ‘ฅTotal storageStorage per day ร— 365 ร— retention years
โ‘ฆBandwidthData transferred per day รท 86,400 (bytes per second, in or out)
โ‘งNumber of serversPeak QPS รท QPS a single server can handle

Let's make the recipe concrete by carrying one simple example through every step. Suppose we're sizing a photo-sharing app. We'll keep the numbers round on purpose โ€” that's the whole spirit of estimation.

๐Ÿ“‹ Our assumptions: 20 million monthly users ยท 50% use it daily ยท each daily user uploads 1 photo and views 100 photos per day ยท each photo is 2 MB ยท data kept for 5 years ยท peak is 2ร— the average ยท one server handles ~1,000 requests/second.

Step โ‘  โ€” Write down your assumptions. Before any math, list what you're assuming: how many users, what each user does per day, how big each item is, how long you keep data, and how spiky traffic is. This is the most important step โ€” every later number depends on it, and writing it down lets anyone check your reasoning. (Ours are in the box above.)

Step โ‘ก โ€” Daily Active Users (DAU). Traffic comes from the people active today, not everyone who ever signed up. So convert monthly users to daily users with the "percent active daily" assumption. Our app: 20 million ร— 50% = 10 million DAU. Every other estimate starts from this one number.

Step โ‘ข โ€” Average QPS (requests per second). Take the total actions in a day and spread them evenly across the day's seconds. There are 86,400 seconds in a day, which we round to ~100,000 to make the division trivial. Do reads and writes separately, because they usually differ wildly. Our app (writes): 10 million uploads รท 100,000 โ‰ˆ 100 write QPS. Our app (reads): 10 million ร— 100 views = 1 billion views รท 100,000 โ‰ˆ 10,000 read QPS. Notice reads are 100ร— writes โ€” that's typical.

Step โ‘ฃ โ€” Peak QPS. The average hides the busy hours. Multiply by a peak factor (ร—2 for steady apps, ร—3+ for spiky ones like sales or viral moments) and design for that, because the peak is what crashes a system. Our app: writes โ‰ˆ 100 ร— 2 = ~200 peak QPS; reads โ‰ˆ 10,000 ร— 2 = ~20,000 peak QPS.

Step โ‘ค โ€” Storage per day. Only writes add to storage (reads don't create data). Multiply the number of new items per day by the size of each. Our app: 10 million uploads ร— 2 MB = 20 TB per day. (10 million ร— 2 MB = 20 million MB = 20 TB.)

Step โ‘ฅ โ€” Total storage. Multiply daily storage by the retention period. A quick shortcut: one year โ‰ˆ 365 days. Our app: 20 TB/day ร— 365 ร— 5 years โ‰ˆ 36,500 TB โ‰ˆ ~37 PB. That instantly tells us photos can't live in a normal database โ€” they belong in object storage.

Step โ‘ฆ โ€” Bandwidth. Bandwidth is data moved per second. Split it into ingress (data coming in โ€” uploads) and egress (data going out โ€” views). Take the data per day and divide by ~100,000. Our app (upload/ingress): 20 TB/day รท 86,400 s โ‰ˆ ~230 MB/s. Our app (view/egress): 10 million ร— 100 views ร— 2 MB = 2 PB/day รท 86,400 s โ‰ˆ ~23 GB/s. Egress dwarfs ingress โ€” which is exactly why a read-heavy media app leans on a CDN.

Step โ‘ง โ€” Number of servers. Divide the peak load by what one server can handle, then add headroom so a couple of failures don't sink you. Our app: peak reads 20,000 QPS รท 1,000 per server = 20 servers, plus ~30% headroom โ‰ˆ ~26 servers for the read path (writes need only ~1). In reality a cache would absorb most reads, cutting this sharply โ€” but the estimate sets the upper bound.

Put the whole walk-through together and you have a complete capacity picture from six lines of arithmetic:

MetricResult for our photo app
DAU10 million
Average QPS (write / read)~100 / ~10,000
Peak QPS (write / read)~200 / ~20,000
Storage per day20 TB
Total storage (5 years)~37 PB
Bandwidth (ingress / egress)~230 MB/s / ~23 GB/s
Servers (read path, with headroom)~26

Two shortcuts make the arithmetic painless. There are 86,400 seconds in a day, which for rough math you can round to ~100,000 (105). And most systems are read-heavy โ€” reads outnumber writes, often 10:1 or 100:1 โ€” so estimate the write path and the read path separately, and expect reads to be served largely by caches and replicas rather than the primary database.

๐Ÿ“Œ Always size for the peak. Average QPS keeps the lights on; peak QPS is what crashes you. Multiply by a peak factor (ร—2โ€“ร—3, higher for spiky workloads like flash sales or viral posts) and provision servers for that number, not the daily average.

1.6 ๐Ÿ”€ Types & Variations

A handful of estimate types come up in almost every design. They all use the same funnel from Section 1.5, just with different per-unit numbers.

๐Ÿ“Š

Traffic (QPS / RPS)

Requests per second the system must serve, and its peak.

  • DAU ร— actions รท 86,400
  • Always compute peak QPS too
๐Ÿ’พ

Storage

Total data kept over the retention period.

  • Writes/day ร— item size ร— 365 ร— years
  • Drives SQL vs NoSQL, sharding
๐ŸŒ

Bandwidth

Bytes per second flowing in or out.

  • Data per day รท 86,400
  • Media & video dominate here
โšก

Memory / Cache

How much hot data must fit in RAM.

  • Often the 20% of data serving 80% of reads
  • Decides cache node sizing
๐Ÿ–ฅ๏ธ

Number of Servers

How many machines to handle peak load.

  • Peak QPS รท QPS per server
  • Add headroom for failures
The read/write split matters. Because most systems are read-heavy, traffic and server estimates are usually done separately for reads and writes. Writes hit the primary database; reads are absorbed by caches and replicas โ€” so a system with 7,000 write QPS might serve hundreds of thousands of read QPS from cache.

1.7 ๐ŸŽจ Illustrated Diagram

The diagram shows the estimation funnel. A few assumptions flow into DAU, which branches into the traffic path (QPS โ†’ peak QPS โ†’ servers) and the data path (storage per day โ†’ total storage, and bandwidth).

%%{init: {"theme": "base", "themeVariables": {"lineColor": "#64748b", "edgeLabelBackground": "#fff"}}}%% flowchart TD A["๐Ÿ“ Assumptions\nusers ยท actions ยท sizes ยท retention"] D["๐Ÿ‘ฅ DAU\nMAU ร— % active"] Q["๐Ÿ“Š Average QPS\nDAU ร— actions รท 86,400"] P["๐Ÿ“ˆ Peak QPS\nร— peak factor"] SV["๐Ÿ–ฅ๏ธ Servers\npeak QPS รท per-server QPS"] ST["๐Ÿ’พ Storage/day\nwrites ร— size"] TT["๐Ÿ—„๏ธ Total Storage\nร— 365 ร— years"] BW["๐ŸŒ Bandwidth\ndata/day รท 86,400"] A --> D D --> Q --> P --> SV D --> ST --> TT ST --> BW style A fill:#f5f3ff,stroke:#7c3aed,color:#4c1d95 style D fill:#dbeafe,stroke:#2563eb,color:#1e3a8a style Q fill:#d1fae5,stroke:#059669,color:#064e3b style P fill:#d1fae5,stroke:#059669,color:#064e3b style SV fill:#e0f2fe,stroke:#0284c7,color:#075985 style ST fill:#fff3e0,stroke:#d97706,color:#92400e style TT fill:#fff3e0,stroke:#d97706,color:#92400e style BW fill:#fce4ec,stroke:#e53935,color:#b71c1c

Reading the diagram: everything starts from assumptions and DAU. The left branch answers "how much compute?" (QPS, peak, servers); the right branch answers "how much data?" (storage and bandwidth). Follow both branches and you have a complete capacity picture.

1.8 โœ… When to Use

Back-of-the-envelope estimation is for the early, decision-making phase โ€” when a rough number is enough to choose a direction. Once a system is live, you replace estimates with real measurements.

Estimate (rough is fine) whenโ€ฆMeasure precisely instead whenโ€ฆ
Scoping a new design before building anythingThe system is live and you can read real metrics
Comparing two architectures to pick oneYou're doing final capacity planning for a launch
Deciding single DB vs sharded, cache or notBilling/SLA numbers must be exact
You need an order-of-magnitude answer fastA 2ร— error would be costly or unsafe

The math itself should stay deliberately sloppy. Round aggressively and approximate โ€” precision is not the point:

Instead ofโ€ฆDo this
99,987 รท 9.1Round to 100,000 รท 10 = 10,000
Seconds in a day = 86,400Round to ~100,000 (105)
3,472.8 QPSCall it ~3,500
Exact bytes per recordRound to a clean KB / MB figure
Rule of thumb: estimate to choose, measure to tune. Use round numbers, always compute the peak (not just the average), and always label your units. If a quick estimate says a design needs a petabyte of RAM, you've saved yourself from building it โ€” that's the whole value.

1.9 ๐Ÿ—๏ธ Real-world Example โ€” Estimate Twitter's QPS and Storage

Let's run the full method on a classic example: estimate the QPS and storage for a Twitter-like service. (These numbers are illustrative, not real Twitter figures.) We start by writing down assumptions.

AssumptionValue
Monthly active users (MAU)300 million
Percent who use it daily50%
Tweets posted per user per day2 (average)
Tweets that contain media10%
Data retention5 years

QPS estimate โ€” how many tweets per second the write path must handle:

StepCalculationResult
โ‘ DAU = 300 million ร— 50%150 million
โ‘กTweets QPS = 150 million ร— 2 รท 24 hours รท 3600 seconds~3,500 QPS
โ‘ขPeak QPS = 2 ร— QPS~7,000 QPS

Storage estimate โ€” we'll estimate media storage, since it dwarfs text. First, the size of one tweet:

FieldSize
tweet_id64 bytes
text140 bytes
media1 MB
StepCalculationResult
โ‘ฃMedia/day = 150 million ร— 2 ร— 10% ร— 1 MB30 TB per day
โ‘ค5-year media = 30 TB ร— 365 ร— 5~55 PB
โ‘ฅUpload bandwidth = 30 TB/day รท 86,400 s~347 MB/s (ingest)
What the numbers tell us: ~7,000 writes/second at peak is comfortably within reach of a sharded database, but 55 PB of media over five years clearly can't live in one database โ€” it belongs in object storage behind a CDN (from the earlier posts). In a few lines of arithmetic, the estimate has already shaped the architecture. Reads aren't shown here, but since the service is read-heavy they'd be far higher than writes and served largely from cache.

1.10 โš–๏ธ Trade-offs

The whole point of estimation is trading precision for speed. Knowing what you gain and give up keeps you from over- or under-trusting the result.

โœ… AdvantagesโŒ Limitations
Fast โ€” a full estimate in minutes, no toolingApproximate โ€” order-of-magnitude, not exact
Cheap feasibility check โ€” rule out bad designs earlyOnly as good as the assumptions โ€” wrong inputs, wrong output
Guides big decisions โ€” sharding, caching, regionsIgnores real-world messiness โ€” hot keys, uneven load
Communicates scale โ€” everyone aligns on the ballparkNot for billing/SLA precision โ€” measure for those
No system needed โ€” works before anything is builtCan mislead if trusted too literally โ€” it's a guide, not truth
๐Ÿ“Œ The core tension: estimation trades accuracy for speed and clarity. That trade is exactly right when choosing a design and exactly wrong when you need the real number โ€” so estimate to decide, then measure the running system to confirm and tune.

1.11 ๐Ÿšซ Common Mistakes

#โŒ Common Mistakeโœ… The Reality
1 Doing precise arithmetic Solving "99,987 รท 9.1" wastes time. Round to "100,000 รท 10". Precision is not expected โ€” approximation is the skill.
2 Not writing down assumptions An estimate with hidden assumptions can't be checked or reused. Write every assumption down so the math is transparent.
3 Leaving units off numbers Does "5" mean 5 KB or 5 MB? Unlabelled numbers cause real errors. Always label units โ€” write "5 MB".
4 Estimating only the average Systems break at the peak, not the average. Always compute peak QPS (ร— peak factor) and size for it.
5 Ignoring the read/write ratio Reads usually vastly outnumber writes. Estimate them separately, or you'll badly under-size the read path (cache/replicas).
6 Confusing bits and bytes (or KB and KiB) A byte is 8 bits; network speeds are often in bits. Keep units consistent, and round 1,024 to 1,000 for estimates.

1.12 ๐Ÿ“ Summary

  • Estimation gives order-of-magnitude answers โ€” fast capacity numbers that guide the design before anything is built.
  • Know the constants โ€” powers of two (KBโ†’PB, ร—1,000 each step), latency numbers (memory fast, disk slow, cross-region ~150 ms), and availability nines.
  • Follow the funnel โ€” assumptions โ†’ DAU โ†’ QPS โ†’ peak QPS โ†’ servers, and DAU โ†’ storage โ†’ bandwidth.
  • Always size for the peak โ€” multiply average QPS by a peak factor; estimate read and write paths separately since systems are read-heavy.
  • Round, label units, write assumptions โ€” the process matters more than the exact figure; estimate to decide, then measure to tune.

1.13 ๐Ÿ‹๏ธ Design Challenge

๐Ÿ›’ Challenge: Estimate ShopEasy's capacity

Estimate the traffic and storage for our online store. Use these assumptions:
  • 40 million monthly active users; 25% shop on any given day.
  • Each daily user views 20 product pages and places 0.1 orders on average.
  • Each order record is about 1 KB; keep orders for 5 years.
Work out: (a) DAU, (b) page-view QPS and its peak, (c) orders per day, and (d) 5-year order storage.
๐Ÿ‘๏ธ Show Answer

(a) DAU: 40 million ร— 25% = 10 million daily active users.

(b) Page-view QPS: 10 million ร— 20 views รท 86,400 s โ‰ˆ 200 million รท 86,400 โ‰ˆ ~2,300 QPS. Peak = ร— ~3 (shopping is spiky โ€” evenings, sales) โ‰ˆ ~7,000 QPS. These are reads, so they're served largely from cache and replicas.

(c) Orders per day: 10 million ร— 0.1 = 1 million orders/day โ†’ order-write QPS โ‰ˆ 1,000,000 รท 86,400 โ‰ˆ ~12 QPS (tiny โ€” a single primary handles this easily, with peaks well within reach).

(d) 5-year order storage: 1 million/day ร— 1 KB = 1 GB/day โ†’ 1 GB ร— 365 ร— 5 โ‰ˆ ~1.8 TB. That fits comfortably in a single relational database โ€” no sharding needed for orders yet.

What it tells us: reads dominate (thousands of QPS) and drive the caching/replica strategy, while writes and order storage are modest. The estimate says: cache hard for product pages, keep orders in one SQL database. That's a real architectural decision from five minutes of arithmetic.

1.14 โ˜๏ธ Cloud Service Mapping

Estimation isn't a service, but three cloud offerings connect directly to it: the SLAs that back your availability numbers, the pricing calculators that turn capacity estimates into cost, and the monitoring that replaces estimates with real numbers once you're live.

NeedAWS (Primary)GCPAzure
Availability SLA โ€” the "nines" you rely onAWS Compute SLACompute Engine SLAAzure SLA summary
Cost from capacity โ€” price your estimateAWS Pricing CalculatorGoogle Cloud Pricing CalculatorAzure Pricing Calculator
Real metrics โ€” measure once liveAmazon CloudWatchCloud MonitoringAzure Monitor
Simplest picture: use your QPS and storage estimates in a cloud pricing calculator to get a monthly cost before you build, rely on the provider's SLA for the availability target, and once the system is running, watch CloudWatch (or the equivalent) to see how close your envelope math was โ€” then adjust capacity from real data.

๐Ÿ“š References

  • Jeff Dean โ€” Google Pro Tip: Use Back-of-the-Envelope Calculations to Choose the Best Design โ€” the origin of this technique and the classic latency numbers.
  • System Design Interview (Vol. 1) โ€” Alex Xu โ€” Chapter on back-of-the-envelope estimation; the Twitter QPS/storage example is adapted from here.
  • The System Design Primer โ€” Donne Martin โ€” Includes the powers-of-two table and latency numbers as a quick reference.
  • Latency Numbers Every Programmer Should Know (interactive) โ€” Colin Scott โ€” A tool that visualises the latency numbers and how they change over the years.
  • Cloud SLAs โ€” AWS Compute SLA, Google Compute Engine SLA, and Azure SLA summary โ€” the official availability commitments behind the "nines".