Card 04/ 08

ExampleDifficulty: Intermediate1 min

Estimation Example: Storage for a Photo App Over Five Years

Two million photos a day at 200 KB each is about 730 TB in five years.

A storage estimate uses the same method as a requests estimate, on a different quantity: count, times size, times the days the data is kept. Here it sizes the storage for a photo-sharing app that keeps every photo for five years.

The assumptions. Users upload two million photos a day. After compression each photo is about 200 KB, meaning 200 kilobytes. Photos are kept for five years.

text
Per day:   2,000,000 × 200 KB  = 400,000,000 KB = 400 GB
Per year:  400 GB × 365         = 146,000 GB     = 146 TB
Five years: 146 TB × 5          = 730 TB
The multiplication, one line per step

What to notice. The unit conversions are where estimates go wrong. Each step from KB to MB to GB to TB divides by a thousand, so 400,000,000 KB is 400 GB, not 400 TB. Writing the unit beside every number catches the mistake before it reaches the design.

What the number decides. 730 TB will not fit on one server's disks. It points to object storage, a service such as Amazon S3 that stores files of any size and grows without limit, rather than a database. It also says that thumbnails, a second copy for safety, or a longer retention would each multiply it again.

What it shares with requests a second. Both estimates multiply a count of things by how much each costs and by a span of time, and both write every assumption down. The news site divided by seconds to get a rate; the photo app multiplied by days to get a total. The method is the same, which is why it transfers to bandwidth, memory and cost as well.