Case study · Media & streaming · complexity 4/5
How a subscription video service encodes a whole catalogue, places it inside ISPs before anyone asks, and keeps playing when servers and whole cloud regions fail — with Netflix's published engineering as the documented example
This is an educational reference architecture. Where we cite Netflix's own engineering material, talks or open-source documentation, or press reports of them, it is marked as documented. We do not describe Netflix's internal systems beyond what Netflix has published.
On demand, each viewer chooses when to start. Requests spread over the day but land on the same popular files, so those are worth copying close to viewers.
Architecture evolution
Each new title is transcoded into one fixed set of quality levels, stored in cloud object storage and served through a commercial CDN. One web application handles sign-in, browsing, billing and playback decisions against one database.
Components
What breaks next
The single application and database. When either fails, nobody can browse or press play, and every release of one feature redeploys all of them. Every view also pays the CDN, and a fixed ladder wastes bits on simple titles.
Served
0/s
Errors
0%
p50 latency
0 ms
p95 latency
0 ms
Origin load
0/s
Cost / hour
$0.00
illustrative
Serve the world from two origin servers
At 100,000 req/s or more, keep errors under 1%, p95 under 120 ms and the origin under 30,000 req/s for 20 seconds.
Your origin is in one city. Viewers are everywhere — some 10 ms away, some 180 ms away. The origin can serve 40,000 requests per second; 100,000 are arriving.
Illustrative model: rates, queues and latency follow simple queueing rules, not a production benchmark.
Netflix is a subscription video-on-demand service; an AWS case study gives it over 280 million members in more than 190 countries. Its engineers have published how it moved from one data center to AWS, built its own CDN called Open Connect, and designed for failure with tools such as Zuul, Hystrix and Chaos Monkey.
Four documented turning points
A video-on-demand service must keep thousands of titles ready to start within seconds, at whatever quality each screen and network can take, in every country it serves. Most of the bytes are video, and they cross the links between networks at the hour when everyone else is online too.
Titles multiply into files; evenings multiply into traffic
Live video is one brand-new stream that everyone wants within seconds; on-demand video is a large, finished catalogue that people start whenever they like. That single difference changes how you encode, how you cache and what fails first. Our live cricket case study covers the live side.
Live is pulled at once; on demand can be pushed ahead
Before anyone can watch, each title is encoded into a : small low-resolution files for weak phone connections up to full-quality files for large TVs. Netflix documented in 2015 that one fixed ladder for every title wasted bits on simple titles and starved complex ones, and moved to a ladder chosen per title.
One fixed ladder fits nobody well
Netflix splits playback into two systems: a in AWS that decides what you may watch and where to fetch it, and a of that only store and serve video files. Netflix's Open Connect overview describes the steps of pressing play.
Decisions in the cloud, bytes from the cache
Each stage removes one bottleneck and exposes the next: first the single application and database, then the single cloud region and the cost of renting someone else's CDN, then predicting what every ISP site will watch. The stages are a teaching model; the dates in Background are Netflix's own.
The bottleneck moves at each stage
Netflix's Open Connect places its own cache appliances at internet exchange points and, free of charge, inside qualifying ISPs' networks, so most video travels only a short distance to the viewer. Netflix fills them proactively in off-peak windows with what it predicts each location will watch.
Two ways an appliance reaches your home
Fill at night, serve in the evening
In the cloud, Netflix replaced one large application with hundreds of microservices, and requests from devices enter through Zuul, its . Zuul authenticates, routes and sheds load at the edge so the services behind it do not each have to.
One front door, many services behind it
With hundreds of services, something is always slow or broken, so Netflix wrapped calls between services in timeouts, and fallbacks with its Hystrix library, and kills servers in production on purpose with Chaos Monkey. Hystrix is now in maintenance mode; for new work Netflix points to adaptive concurrency limits and resilience4j.
A slow service gets a fallback, not a frozen screen
Kill a server on a normal day
After a load-balancer failure in one AWS region hit Netflix on Christmas Eve 2012, Netflix rebuilt its cloud services to run : every region serves members all the time, and DNS can move one region's members to the others. By 2015 that covered three AWS regions; AWS now says four.
Every region serves; DNS decides who goes where
Netflix's documented path runs from its own data center in 2008, through a seven-year move to AWS and its own CDN from 2011, to active-active regions from 2013 and a near-global launch in January 2016.
From one data center to every country
A Stage 3 service in this design has a control plane in several cloud regions and a data plane of cache appliances in ISPs, joined only by the URLs the control plane hands out. It is a teaching design drawn from Netflix's published material, not a diagram of Netflix's system.
Two planes, joined by URLs
Each choice that made the service scale has a price: per-title encoding costs compute, owning a CDN means building hardware and ISP partnerships, microservices turn function calls into network calls, and active-active pays for spare capacity in every region.
Four dials, and which side Netflix chose
Four failures matter most in this design: an appliance dies, a big release is not on the nearby appliance, a service everyone calls slows down, and a whole cloud region fails. Each has a planned answer, and only some of those answers are documented for Netflix.
A bad evening, four ways
Three simulations show the three big ideas at small scale: caches near viewers, a circuit breaker with a fallback, and losing a whole region. Their numbers are illustrative models, not Netflix's.
Why fill aims for a hit ratio near 100%
Served
0/s
Errors
0%
p50 latency
0 ms
p95 latency
0 ms
Origin load
0/s
Cost / hour
$0.00
illustrative
Serve the world from two origin servers
At 100,000 req/s or more, keep errors under 1%, p95 under 120 ms and the origin under 30,000 req/s for 20 seconds.
Your origin is in one city. Viewers are everywhere — some 10 ms away, some 180 ms away. The origin can serve 40,000 requests per second; 100,000 are arriving.
Illustrative model: rates, queues and latency follow simple queueing rules, not a production benchmark.
Swipe the diagram sideways to see every tier →
Errors
0%
p95 latency
0 ms
Threads busy
0%
Breaker
Off
every call waits
Orders accepted for later
0/s
Served
0/s
Contain the slow provider
While the provider is slow, keep errors under 1%, p95 under 500 ms and threads under 50% busy for 20 seconds — without making the provider faster.
A shop serves 1,000 requests per second; 1 in 10 is a checkout that calls the payment provider. Each of the 2 app servers has 100 threads, and a request holds one until it finishes — including while it waits for the provider. At 15 seconds the provider slows from 300 ms to 3 s per call. All numbers are an illustrative model.
Illustrative model: rates, queues and latency follow simple queueing rules, not a production benchmark.
Users
shoppers
On-call and automation
runbook
DNS
shop's address
Region A
primary
Region B
recovery region
Swipe the diagram sideways to see every column →
Where the time goes
172 min total
A shop runs its app and a 400 GB primary database in Region A. Nightly 02:00 backups are copied to Region B. At 09:00 the whole of Region A goes dark. All durations are illustrative.
Illustrative timings. Real numbers vary with distance, network quality and server load.
The Open Connect model, the control and data plane split, per-title encoding, Zuul, Hystrix, Chaos Monkey, the active-active regions and the dates are documented in the sources. The three stages, the load model, the list of services, the fallback choices and most failure handling are our assumptions.
Where each part of this page comes from