Video in progress

Estimate roughly how much disk an image storage service needs for 5 years.

DAU: 10,000,000
One in every 5 users uploads 1 image a day
Average image size after compression: 500 KB
2 small copies (thumbnails) are also stored for each image

2 million images a day × 500 KB is about 1 TB a day, ~365 TB a year, ~1.8 PB in 5 years. Add replication and the small-size copies and it's 2–3 times more — a volume like that only makes sense in object storage.

📖 Answer

Step by step:

Images per day:      10,000,000 / 5 = 2,000,000
Originals:           2,000,000 × 500 KB = 1,000,000,000 KB ≈ 1 TB / day
Thumbnails:          roughly +10–20% → ~1.2 TB / day
One year:            1.2 TB × 365 ≈ 440 TB
5 years:             ≈ 2.2 PB
With 3 copies:       ≈ 6.6 PB raw disk

Useful reference numbers:

  • 1 KB = 10³ bytes, 1 MB = 10⁶, 1 GB = 10⁹, 1 TB = 10¹², 1 PB = 10¹⁵;
  • a day has ~10⁵ seconds.

What follows from this: there is no question of writing a volume like that to PostgreSQL as bytea or keeping it on one server's disk. The images go to object storage like S3, and the database keeps only metadata (who uploaded it, when, the file key) — a few hundred bytes per image.

Ask one more question: do we delete old images, or move them to cheap "cold" storage? That cuts the cost noticeably.