← Back to System Design Fundamentals

Back-of-envelope: Storage

System Design FundamentalsMidsystem-design

The Question

How do you estimate storage needs in a back-of-envelope calculation?

What a Strong Answer Covers

  • Formula
  • power of 2 conversions.

Senior-Level Answer

Storage estimation follows a data-type decomposition:

**Step 1: Identify what gets stored** Break the system into data types: user records, messages, images, videos, metadata. Each has a different size profile.

**Step 2: Estimate size per object** Use standard benchmarks: - Text record (user profile, tweet): 1 KB - Image (compressed, thumbnail): 100–300 KB; full-size: 1–5 MB - Video (1 min, compressed): 50–100 MB; 1 hr HD: 1–2 GB - Audio (1 min MP3): 1 MB

**Step 3: Estimate volume per day** For a Twitter-like system with 150M DAU and 0.1 tweets/user/day: - 15M tweets/day × 1 KB = 15 GB/day text - 30% include an image (4.5M images/day × 200 KB = 900 GB/day)

**Step 4: Project over the design horizon** Interviewers typically want 5 years. 5 years ≈ 1,800 days. - Text: 15 GB/day × 1,800 = 27 TB - Images: 900 GB/day × 1,800 = 1.6 PB

**Step 5: Add replication overhead** Data is typically stored with 3× replication (HDFS default, S3 default). Multiply total by 3.

**Step 6: State which tier** - Hot storage (SSD): recent data, frequently accessed - Warm storage (HDD/object store): older data - Cold storage (Glacier, tape): archival

**Key powers of 2**: 10 KB × 10^6 objects = 10 GB; 1 MB × 10^9 = 1 PB. Memorizing these conversions prevents arithmetic errors under pressure.

Interviewers want to see: explicit per-object size assumptions, separation of data types, replication factor, and a growth rate.

What Separates a 2/3 from a 3/3

2/3 — Passing but Incomplete

Correctly breaks storage by type, uses reasonable size estimates, and projects over a 5-year horizon.

3/3 — Strong Answer

Accounts for replication factor, separates storage tiers, and connects storage volume to architectural choices (object store vs relational DB).

Common Mistakes

  • Forgetting replication — raw storage needs 3× for durability
  • Treating all data as equal size — not decomposing by type
  • Missing the growth dimension — point-in-time estimate without projection
  • Not distinguishing metadata storage (relational) from blob storage (object store)

Follow-Up Questions

  • How does your storage estimate affect which storage technology you choose? — < 1 TB: single Postgres instance fine; 1 TB–1 PB: object store for blobs, sharded DB for metadata; > 1 PB: distributed storage, cold tiering.
  • How do you estimate storage for user-generated video? — Estimate videos uploaded per day × average length × compressed bitrate × replication factor.
  • What is the cost implication of storing hot vs cold data? — S3 Standard ~$0.023/GB/month vs Glacier ~$0.004/GB/month — archiving old data reduces cost 6×.
  • How would compression affect your storage estimate? — Text compresses 5–10×; images (JPEG already compressed) 2–3×; video (H.265 vs H.264) 40% reduction. Apply a compression ratio to raw estimates.

Related Questions

  • Redis Caching Patterns
  • Vertical vs Horizontal Scaling
  • API Versioning
  • SLOs vs SLAs
  • Availability — Five 9s

Can You Explain This Cold?

Reading the answer is step one. Explaining it unprompted — under interview pressure — is what actually matters. Get AI-graded feedback on your answer with follow-up probes on your weak points.

Get Graded — Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout