codequest / system design
Like YouTube or Netflix

🎬 Video streaming system design

A simplified, healthy design: 7 app servers behind a load balancer, a cache (90% hit rate), a CDN for static files, a primary database. At 10,000 requests per second it runs at p95 30 ms with 0.0% errors for about $465/month.

Healthy at 10,000 req/s
p95 latency (server)
30 ms
Error rate
0.0%
Est. cost / month
$465
excl. bandwidth
App servers
400 req/s each · $40/mo
7
Hit rate
DB read replicas
+1,250 reads/s each · also applies every write · $120/mo
0

Primary DB: 1,250 queries/s (1 query per request). How the numbers work

How it works

  • Almost all traffic is video chunks, which never change once uploaded: perfect for a CDN.
  • Your own servers only handle the small dynamic part: search, recommendations, watch history.
  • That is why streaming companies invest so heavily in edge caching.
  • Costs here exclude bandwidth. For video, data transfer (egress) is the biggest bill by far, which is another reason the CDN matters.
Try this

Turn the CDN off. Count how many app servers you would need instead.

Use the Build and Traffic tabs above. The overloaded part turns red and starts dropping requests.

More systems