System Design Playbook
06 · System designs100 users → 100M+ users13 min read

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.

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

MetricEstimate
Members~300M, ~2 hours/day average
Peak streamsTens of millions at once × ~5 Mbps → hundreds of Tbps
CatalogTens of thousands of titles × ~1,000 files each (bitrates, codecs, audio, subtitles)
API trafficMillions 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)                                     -- precomputed

Architecture

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.

Architecture
Scale
Follow a request
◱ViewerTV, phone, web◍CDNvideo segments⇄API gateway⚙Playback serviceDRM + steering⚙Catalog & home⚙Personalizationprecomputed rows↻Encodingpipelineper-titleϟEVCachememcached-based☰Playback eventsKafka▣Object storagemasters + encodes⛁Catalog &billing DBsreplicated⛁Cassandraviewing history

Step by step · Press play

  1. 01Presses play on episode 3
  2. 02POST /playback/start
  3. 03Plan OK → DRM licence + manifest with nearby servers
  4. 04Account and title data from cache
  5. 05Player starts at a low bitrate, then climbs
  6. 06Segments from the CDN
  7. 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

Architecture
Scale
Follow a request
◱ViewerTV, phone, web⚙App servercatalog + accounts▣Object storagemasters + encodes⛁PostgreSQLtitles, accounts

Step by step · Open the home screen

  1. 01Opens Netflix
  2. 02Popular and new titles
  3. 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.

UsersWhat you runWhy it changes
100App + PostgreSQL + files in S3A handful of titles and viewers
10KCommercial CDN, encoding pipeline, cacheEgress and multiple bitrates
1MGateway + playback, catalog, personalization services; Cassandra, EVCachePer-member home screens and history at scale
100M+Own CDN in ISPs, overnight pre-positioning, multi-region active-activeBandwidth 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?