Design Netflix (video streaming)
Stream a fixed catalog to hundreds of millions of members with almost no buffering. Unlike YouTube there are no user uploads, so the effort goes into encoding, pre-positioning content close to viewers, a personalized home screen and surviving the loss of an entire cloud region.
Builds on these concepts
In one sentence
Encode each title into many bitrates, pre-position them on servers inside ISPs, run the control plane (accounts, home, playback) as cached microservices, and precompute personalization offline.
A reference design: it covers what an app like this needs and follows how these companies have described their systems publicly, simplified to be learnable.
Requirements
Functional
- Browse a personalized catalog
- Play on TVs, phones and browsers with DRM
- Continue watching across devices
- Different catalog per country
Non-functional
- Start fast, never buffer
- Very high availability: evenings are peak
- Control plane small, data plane (video) enormous
- Cost per streamed hour must be low
Back-of-the-envelope estimates
| Metric | Estimate |
|---|---|
| Members | ~300M, ~2 hours/day average |
| Peak streams | Tens of millions at once × ~5 Mbps → hundreds of Tbps |
| Catalog | Tens of thousands of titles × ~1,000 files each (bitrates, codecs, audio, subtitles) |
| API traffic | Millions of requests/s for home screens and playback starts: small next to the video bytes |
API and data model
GET /home → rows [ { title, artworkUrl } ] (personalized)
POST /playback/start { titleId } → { manifest, drmLicense, servers[] }
POST /playback/events { … } // heartbeat, bitrate switches, stop position
titles(id, type, availability_by_country, …)
viewing_history(member_id, title_id, position, updated_at) -- Cassandra
home_rows(member_id, rows) -- precomputedArchitecture
Netflix splits into a control plane (accounts, home, recommendations, playback authorization) running on AWS, and a data plane (video bytes) served by its own CDN, Open Connect.
Step by step · Press play
- 01Presses play on episode 3
- 02POST /playback/start
- 03Plan OK → DRM licence + manifest with nearby servers
- 04Account and title data from cache
- 05Player starts at a low bitrate, then climbs
- 06Segments from the CDN
- 07Play and quality events reported
At this scale · 1M users
Microservices behind a gateway
- ▸Playback service: DRM licence and the best servers for this viewer
- ▸Personalized rows and artwork precomputed per member
- ▸Viewing history in Cassandra, hot data in EVCache
Tap any box to see what it does.
Deep dive: bringing video close to viewers
- Per-title encoding: a cartoon needs fewer bits than an action film for the same quality, so each title gets its own bitrate ladder.
- Open Connect: Netflix gives ISPs storage appliances for free. Traffic stays inside the ISP's network, which is cheaper for both and faster for viewers.
- Pre-positioning: overnight, when networks are quiet, appliances download what that region is predicted to watch tomorrow. Press play and the file is already a few hops away.
- Steering: the playback service returns a ranked list of servers that have the file and are healthy and close.
How it changes with scale
Step by step · Open the home screen
- 01Opens Netflix
- 02Popular and new titles
- 03Home screen in a few hundred ms
At this scale · 100 users
A catalog site with video files
- ▸App + PostgreSQL for titles, users and subscriptions
- ▸Encoded files in object storage
- ▸Encoding done once per title, by hand or with a job
Tap any box to see what it does.
| Users | What you run | Why it changes |
|---|---|---|
| 100 | App + PostgreSQL + files in S3 | A handful of titles and viewers |
| 10K | Commercial CDN, encoding pipeline, cache | Egress and multiple bitrates |
| 1M | Gateway + playback, catalog, personalization services; Cassandra, EVCache | Per-member home screens and history at scale |
| 100M+ | Own CDN in ISPs, overnight pre-positioning, multi-region active-active | Bandwidth cost and reliability dominate everything |
Key takeaways
- 01Separate the small control plane from the huge data plane (video bytes).
- 02Encode per title into many bitrates; the player adapts in real time.
- 03Put content inside ISPs and pre-position it before demand arrives.
- 04Personalization is precomputed; resilience is practised, not hoped for.
Check your understanding
1 of 3
In Netflix's architecture, what's the difference between the control plane and the data plane?