Skip to main content
Storage & Throughputlesson 3 of 3 · 3 min read

From Estimates to Architecture

An estimate that changes nothing was wasted

An estimate that does not change the design is decoration.

The workflow that earns its keep: work out demand, compare it to what one machine does, and let the ratio pick the architecture. Under a tenth of a ceiling, use one machine and move on. Within a few multiples of it, add the standard mitigation, so a cache, a copy, a content delivery network, or compression. Past a ceiling with those already applied, and only then, reach for partitioning.

Bandwidth deserves its own comparison, because it is the estimate people skip. A thousand requests a second returning 100 KB each is 100 MB a second, which is 800 megabits, and that saturates a one gigabit network card with nothing spare.

One number can flip the answer

Change one number and the conclusion flips. A thousand requests at 2 KB is 2 MB a second, 16 megabits, nothing at all. The heavy-response case forces a content delivery network or compression long before it forces more servers.

Storage totals pick your storage system. Under a few terabytes fits on one of your database nodes with room to grow. Tens of terabytes still works on one machine, though backup and migration windows get frightening, so you start splitting hot data from cold. Hundreds of terabytes and beyond means object storage, partitioned databases, or both, plus policies that push stale data down a tier.

Which resource binds first matters, because it is rarely the one people assume. A media product usually hits bandwidth before storage. An analytics pipeline hits write rate before either. A business product often never leaves the first band on any axis, and the correct architecture there is a boring single application on a managed database.

Narrate the comparison, not just the demand you calculated. Saying “115 requests a second against a web tier that does 10,000 per instance, so two instances for redundancy, not twenty for load” shows you know what the numbers are for.

Worked example

Priya gets 'design a podcast host' in an interview: 5 million listeners, one 30-minute episode each per day. Audio at about 1 MB per minute makes each listen 30 MB, times 5 million is 150 TB of egress a day. Over 86,400 seconds that's about 1.7 GB per second average, call it 14 Gbps, maybe 40 Gbps at peak. No origin fleet serves that sensibly, so the decision makes itself: audio goes behind a CDN, and the origin only sees misses on new episodes. The metadata side is the opposite story: 5 million plays a day is about 60 API requests per second, a rounding error for one Postgres node. Her final design is deliberately lopsided, a large CDN contract next to a tiny database, and the interviewer's feedback says 'let the numbers drive it.'

Storage & Throughput: wrapping up

In the real world

  • 01Netflix serves the overwhelming majority of its bytes from Open Connect CDN appliances placed inside ISP networks, because the bandwidth math of streaming video from central origins never closes.
  • 02AWS documents S3's per-prefix limits (3,500 PUT and 5,500 GET requests per second) and recommends spreading keys across prefixes, a published example of a single-partition throughput ceiling.
  • 03Dropbox built Magic Pocket and migrated exabytes off S3 onto custom storage in 2016, a decision justified by capacity arithmetic that only works at their scale.
  • 04Stack Overflow famously served one of the largest Q&A sites on a handful of on-prem web servers and two SQL Server boxes, proof of how far single-machine ceilings actually stretch.
  • 05Twitter's historical figure of roughly 500 million tweets per day works out to only about 6,000 tweets per second on average, a favorite example of how scary daily numbers become manageable per-second ones.

Questions people ask

Should I use decimal (GB) or binary (GiB) units in estimates?

Decimal, always, in interviews and back-of-envelope work. 1 GB as 10^9 bytes keeps every conversion a matter of moving the decimal point. The 7 percent gap between GB and GiB is far smaller than the error bars on your assumptions, so binary units add friction without adding accuracy.

How accurate does a storage or throughput estimate need to be?

Within a factor of 2 or 3 is fine, because the decisions are order-of-magnitude decisions. Whether the answer is 40 TB or 90 TB, the architecture is the same; whether it's 400 GB or 400 TB, it isn't. Spend your precision on the assumptions that swing the total, usually record size and the ratio of media to metadata.

When do I actually need to shard a database?

When sustained write throughput or total data size exceeds what one node plus the standard mitigations can hold. Read pressure is solved by caches and replicas without sharding. If writes stay under a few thousand per second and data under a few TB, sharding buys you operational pain and no capacity you needed.

Quick review

1 KB = 10³ B | 1 MB = 10⁶ B | 1 GB = 10⁹ B | 1 TB = 10¹² B | 1 PB = 10¹⁵ B
Tweet:
~280 chars = ~280 B | Average web page: ~2 MB | Photo (compressed): ~300 KB | HD video/minute: ~50 MB
PostgreSQL row:
100 B to 10 KB | Redis string entry overhead: ~100 B | Kafka message: ~1 KB avg
Typical modern web server:
10k to 50k HTTP req/sec per instance (stateless with keep-alive)
PostgreSQL:
~10k reads/sec or ~5k writes/sec on commodity hardware. DynamoDB: ~40k RCU/WCU default
Kafka:
~1M messages/sec per broker (sequential disk I/O) | Redis: ~100k ops/sec per instance, 1M+ with pipelining
S3 PUT throughput:
3,500 req/sec per prefix | S3 GET: 5,500 req/sec per prefix (add prefix sharding)
in the room

Interviewer expects you to size storage, bandwidth, and server count. Write formulas before plugging in numbers.