Before I size a service, I do the math on a napkin. No spreadsheet, no capacity planning tool. Just users, requests, storage, and machines, one multiplication at a time. This lesson sizes one photo service end to end, from one million daily users to eight servers. The numbers are a worked example. The method is the part that transfers to every launch you will ever size.
Difficulty: Beginner · Know this first: Lesson 01, Lesson 02
Requests are not all the same kind, and the mix is where the money hides. The bar below breaks one day of traffic into reads, photo uploads, and small writes. The numbers are a worked example for this lesson's scenario, not a measurement from a live system. Notice the smallest slice. Photo uploads are one percent of the requests and nearly all of the storage. Step through the lesson or switch the scenario and watch the mix move.
The worked example above uses my numbers. Move the sliders and run your numbers through the same chain. Nothing here is a guess dressed up as a tool. It is the same four multiplications from the steps, and you can watch every answer move when one input moves.
Fixed assumptions: 90/10 read/write split, one write in ten is a photo, 2 MB photo, 1 KB small write, 200 KB read response, 500 req/sec per server, +2 spares.
Total requests/day
100M
Average QPS
about 1,000
Peak QPS
about 3,000
Storage/day
2 TB
about 60 TB/month, about 730 TB/year
Bandwidth out
18 TB/day
about 1.7 Gbps average, about 5 Gbps at peak
Servers needed
8
6 for peak load + 2 spare
Three questions. No score is saved anywhere, this is just you against the material.
I round 86,400 seconds to 100,000 on purpose. It buys me speed and it costs me about 15 percent. That trade is fine when I am comparing options or checking whether a plan is sane. It is not fine when the margin is thin. If my estimate says I need 6 servers and I can only afford 7, the rounding error matters, and I redo the step with 86,400. The rule I use: round while you are exploring, use the real number when you are about to spend money or sign a launch date.
Every bad estimate I have seen broke on one of these four, and the estimate itself was fine. The user count was wrong because launch beat the forecast, or the forecast was a hope. The requests per user were wrong because a new feature added background calls nobody counted. The average object size was wrong because users upload originals and the estimate assumed compressed thumbnails. The peak factor was wrong because a launch landed on a holiday evening or a sports final. I catch each one the same way: I measure it from the running system every week and I compare it with the number I wrote down. The assumption that moves the most is the one I watch.
At 10x the math still works. The shape of the answers changes. Storage stops being a disk order and becomes a retention policy with tiers: hot for this month, cold for the rest, delete dates written down before launch. Bandwidth stops being a pipe order and becomes a CDN decision. Servers stop being a fixed count and become autoscaling with a load test at real peak shape, not at average. At 100x, napkin math stops being the plan. It becomes the first page. What replaces it is measured per endpoint request rates from the logs, a load test that replays real traffic shape, a capacity model per tier (app, cache, database, storage), a storage growth forecast with retention in it, and a cost model the finance team has seen. The napkin still opens the conversation. It no longer closes it.
I keep a version of this chain in a file, because an estimate I can re-run is an estimate I can defend. Same numbers as the worked example. Change the three inputs at the top and the answers follow.
# napkin.py — the whole lesson in a few lines
dau = 1_000_000 # daily active users
req_per_user = 100 # requests per user per day
peak_factor = 3 # evening peak vs daily average
total = dau * req_per_user
avg_qps = total // 100_000 # 86,400 seconds, rounded to 100,000
peak_qps = avg_qps * peak_factor
reads = total * 9 // 10
uploads = total // 100 # one write in ten is a photo
storage_tb_day = uploads * 2 // 1_000_000 # 2 MB each
servers = -(-peak_qps // 500) + 2 # round up, then 2 spares
print(f"{total:,} requests/day, {avg_qps:,} avg QPS, {peak_qps:,} peak QPS")
print(f"{storage_tb_day} TB/day storage, {servers} servers")
I sized storage for a photo service on a 2 MB average photo. That number came from my own phone, from a compressed photo I had just taken. The real average after launch was about 6 MB. The app uploaded originals on wifi, and the thumbnail pipeline kept the original as well as the thumbnail. Storage grew at 6 TB a day instead of 2. Nobody noticed for five weeks because the dashboard showed request counts, and the upload count matched the estimate exactly.
Three rules, and I still use all three. First, average object size is a measured number from the bucket, checked every week, never a guess from my phone. Second, storage alarms fire at 70 percent, not 85, and they page a human. Third, the retention policy is written before launch, with the numbers in it, and the disk order follows the retention math, not the other way round.
Size the storage for a group chat app. 10 million daily users. Each user sends 20 messages a day. One message in 50 carries a photo, average 1 MB. Messages are kept for one year. How much storage do you need, and what do you ask before you trust the answer?
Is 20 messages per user the average or the heavy user? Do photos stay at full size or get compressed on upload? Is a group photo stored once per group or once per recipient? Is retention one year from send, or one year from last read? Are deleted messages really deleted, or just hidden?
Total messages are 10 million users times 20, which is 200 million a day. Photos are 200 million divided by 50, which is 4 million a day. Storage is 4 million times 1 MB, which is 4 TB a day. Text is tiny next to that, so I call it negligible. One year is 4 TB times 365, about 1.5 PB. Call it 1.5 PB before replication.
Replication doubles or triples that number, so say whether your answer is raw or replicated. Storing one copy per group instead of one per recipient changes it by a lot. Compression changes the photo average, and the photo average is the whole answer. Retention is a product decision, not an engineering one, and it moves the total more than any other input.