Skip to content
System Design Explorer
Company architectureadvanced

Netflix System Design

Netflix-scale video streaming: a cloud control plane and an ISP-embedded CDN

By Ankur NayakReviewed

How Netflix streams to hundreds of millions of members: everything before you press play runs as microservices in AWS, while the video itself comes from Netflix's own Open Connect appliances placed inside ISPs and at internet exchanges.

Open in Studio· edit a copy
Users
280M+ members, 190+ countries
Open Connect appliances
14,000+
ISPs hosting OCAs
1,000+
IXP locations
80+ in 25+ countries
Spent on Open Connect
US$1B+
Netflix system design architecture diagramComponents: Netflix App (TV, mobile, web), Cloud Load Balancer (AWS ELB), Edge Gateway (Zuul), Playback API (Play API), Discovery, EVCache (Memcached-based), Member Data (Cassandra), Embedded OCAs (Open Connect), IXP OCAs (Open Connect). Connections: Netflix App to Cloud Load Balancer (browse, play); Cloud Load Balancer to Edge Gateway; Edge Gateway to Playback API (/play); Edge Gateway to Discovery (/home); Playback API to EVCache; Playback API to Member Data (bookmarks, history); Discovery to EVCache (precomputed rows); Netflix App to Embedded OCAs (video segments); Netflix App to IXP OCAs (video segments (fallback)); Embedded OCAs to Playback API (health, routes, files).AWS regionViewer's ISPNetflix AppTV, mobile, webCloud Load BalancerAWS ELBEdge GatewayZuulPlayback APIPlay APIDiscoveryServiceEVCacheMemcached-basedMember DataCassandraEmbedded OCAsOpen ConnectIXP OCAsOpen Connect

Requirements

Functional

  • Browse a personalised catalogue on TVs, phones and browsers
  • Start playback quickly and adapt quality to the network
  • Resume where you left off across devices
  • Ingest and encode new titles for every device and bandwidth

Non-functional

  • Playback starts in a few seconds; minimal rebuffering
  • The service survives the loss of an entire cloud region
  • Video bytes travel as short a distance as possible (inside the viewer's ISP when possible)
  • Hundreds of microservices deploy independently

In depth

Two systems, one product

The key to understanding Netflix's architecture is that it is really two systems. Everything that happens before you press play (signing in, browsing rows, recommendations, deciding what to stream and from where) runs as microservices in AWS. The video itself, which is almost all of the bytes, never comes from AWS. It comes from Open Connect, Netflix's own content delivery network.

What it has to do

Netflix serves more than 280 million members in over 190 countries, on TVs, phones and browsers. The requirements pull in two directions. The product must feel personal and fast: a catalogue tailored to each member, playback that starts within a few seconds, and the ability to resume on any device. And it must be robust at enormous scale: the service has to survive losing an entire cloud region, hundreds of services must deploy independently, and video bytes should travel as short a distance as possible, ideally never leaving the viewer's own ISP. Those two sets of needs map neatly onto the two systems below.

The control plane in AWS

Device traffic enters through Zuul, Netflix's open-source edge gateway, which authenticates, routes and can shift traffic between regions. Behind it sit hundreds of services. In his QCon talk Mastering Chaos, Josh Evans described the patterns that keep this reliable: EVCache (a replicated, Memcached-based cache) in front of most data, Cassandra for member data replicated across regions, timeouts and circuit breakers with fallbacks (Hystrix), and regular drills that evacuate an entire AWS region.

Open Connect: the CDN inside your ISP

Netflix's 2021 briefing paper describes more than 14,000 Open Connect Appliances in 142 countries. Over a thousand ISPs host appliances inside their own networks for free, and Netflix also places them at more than 80 internet exchange points. Each deployment stores nearly the whole catalogue, so a location can serve up to 100% of its Netflix traffic locally.

Because Netflix knows its catalogue in advance, it doesn't wait for cache misses. During off-peak fill windows, control-plane services push new and popular files to appliances, using spare capacity when networks are quiet. See the CDN building block for push vs. pull.

Pressing play

According to the Open Connect overview, when you press play the playback services in AWS check your authorization and licensing, choose the files your device needs given current network conditions, and ask a steering service for the best appliances. Steering works from reports every appliance sends: its health, the BGP routes it has learned and which files it holds. Your device gets URLs for those appliances and streams directly from them.

A nice consequence: if an AWS region fails, video that is already playing keeps flowing from inside your ISP.

When things fail

Netflix's architecture is designed around the assumption that parts of it will fail, and its public talks describe practising those failures on purpose.

  • An AWS region fails. The control plane runs in more than one region, and Netflix regularly rehearses evacuating a whole region's traffic to the others (Chaos Kong). Member data is replicated across regions in Cassandra, so the surviving regions have it. Video that is already playing keeps flowing, because it comes from Open Connect, not AWS; at worst a viewer sees a brief error while browsing or pressing play.
  • An Open Connect appliance fails. The appliance stops reporting itself healthy, so the steering service stops handing out its URLs, and clients fetch from another appliance, for example one at an internet exchange. The player's buffer usually hides the switch completely.
  • The cache is degraded. When EVCache is slow or unavailable, data services fall back to the databases and to static fallbacks where they can, and circuit breakers stop callers from piling up on slow dependencies. Pages get slower or less personalised, but the app keeps working.

The trade-offs

  • Build a CDN rather than rent one. Netflix used commercial CDNs before building Open Connect. Owning the CDN keeps video inside ISP networks, lets off-peak fill avoid peak-hour backbone load and gives full control over hardware and software. The cost is a very large investment and the logistics of shipping and supporting appliances at more than a thousand ISP partners.
  • Availability over consistency for member data. Replicating member data across regions in Cassandra keeps writes working during regional failures and makes failover simple, at the price of occasionally stale reads, such as a viewing bookmark a few seconds old. For this data, that staleness is harmless.
  • Microservices with defensive fallbacks. Hundreds of small services, each wrapping its dependencies in timeouts and circuit breakers, give teams independent deploys and turn failures into degraded features rather than a dead app. The price is operational complexity and the latency of fanning out to many services per request.

What to take away

  • Separate the control plane from the data plane
  • Put heavy, predictable bytes as close to users as possible, and fill caches proactively
  • Design for failure: fallbacks, circuit breakers and region evacuation
  • Choose availability over consistency where staleness is harmless

Components

Netflix App

TV, mobile, web

Client. Talks to the AWS control plane for everything except video bytes, which it fetches from Open Connect.

AWS region

control plane

Region. Netflix's backend runs on AWS, in more than one region.

Viewer's ISP

Region. Embedded Open Connect appliances sit inside the ISP's own network.

Cloud Load Balancer

AWS ELBinferred

Load balancer. Receives API traffic from devices and spreads it over the edge gateway fleet.

Building block: Load Balancer

Edge Gateway

Zuul

API gateway. Netflix's open-source gateway: routing, authentication, traffic shaping and insights for all device traffic.

Why: A programmable edge lets Netflix route, shed and shift traffic between regions without client changes.

Building block: API Gateway, Circuit Breaker

Playback API

Play API

Service. Checks the member's authorization and licensing, picks the files for this device and network, and asks steering which OCAs should serve them.

Authorization & Licensing

Auth. Confirms the member's plan and that the title is licensed in their country.

File Selection

Service. Chooses the encodes and bitrates required, based on device capabilities and current network conditions.

Steering Service

Service. Picks the OCAs that should serve the files and generates URLs for them.

Building block: CDN

OCA Reports

Monitoring. Every OCA periodically reports its health, the BGP routes it has learned and which files it stores.

Cache Control

Service. Stores and interprets OCA reports; also controls nightly fill and content placement.

Rank Candidates

inferred

Service. Keeps OCAs that are healthy, hold the files and are reachable from the client's network, then ranks them.

Generate URLs

Service. Returns URLs pointing at the chosen OCAs to the playback service.

Playback Response

inferred

Service. Returns the OCA URLs (plus license data) to the device so it can start streaming.

Discovery

Service. Builds the personalised home page rows and artwork for each member.

Building block: Circuit Breaker

Recommendation Models

inferred

ML model. Rank titles and rows for each member; trained offline on viewing data.

EVCache

Memcached-based

Cache. Netflix's distributed in-memory cache, replicated across zones, in front of most data services.

Why: Most API calls read precomputed data; a cache tier keeps latency low and protects the databases.

Building block: Cache, Replication

Member Data

Cassandra

NoSQL database. Viewing history, bookmarks and other member data in Cassandra clusters replicated across regions.

Why: Favours availability and multi-region writes over strict consistency, which suits data like 'where did I stop watching'.

Building block: Replication, CAP Theorem, Database Sharding

Event Pipeline

Kafka-based

Stream. Playback and UI events stream to analytics, monitoring and recommendation training.

Building block: Message Queue & Event Log

Service Discovery

Eureka

Coordination. Services register themselves and find each other by name instead of fixed addresses.

Embedded OCAs

Open Connect

CDN. Netflix-provided cache servers inside the ISP's network. Each deployment stores nearly the whole catalogue in every format.

Why: Serving from inside the ISP removes long-haul transit, cuts the ISP's costs and improves quality.

Building block: CDN

IXP OCAs

Open Connect

CDN. Netflix-owned appliances at internet exchange points, where Netflix peers with any ISP.

Building block: CDN

Content Origin

AWS S3inferred

Object storage. Encoded files that are distributed to OCAs during fill windows.

Building block: Object Storage

Encoding Pipeline

Batch processing. Encodes each title into many bitrates and codecs, optimised per title, for every device type.

Other AWS Regions

Service. The same control plane runs in other regions; traffic can be evacuated to them if one region fails.

Request flows

Member presses play

  1. The app sends a play request to the Netflix API in AWS.
  2. The Zuul edge gateway authenticates the device and routes the request.
  3. Playback services check the member's plan and the title's licence, and pick files for this device and network.
  4. They read the member's bookmark so playback resumes where it stopped.
  5. Steering already knows each OCA's health, learned routes and stored files from their periodic reports.
  6. The response carries URLs for the best OCAs for this client.
  7. The device receives the URLs and licence data.
  8. Video segments stream from an OCA inside the viewer's own ISP; AWS is not on the video path.

Member opens the home page

  1. The app requests the home page.
  2. Zuul routes it to the discovery services.
  3. Discovery assembles personalised rows and artwork for this member.
  4. Most of it is precomputed and read from EVCache in a few milliseconds.
  5. The page renders; artwork images come from the CDN.

New titles reach the edge

  1. A new title is encoded into many bitrates and codecs, optimised per title.
  2. During off-peak fill windows, the control plane fills embedded OCAs with new and popular files.
  3. IXP appliances are filled the same way, so content is in place before members ask for it.

Failure scenarios

What if: an AWS region fails?

Netflix runs the control plane in more than one region and practises evacuating a whole region's traffic to the others. Streams already playing keep flowing because video comes from Open Connect, not AWS; new requests are rerouted to healthy regions.

User impact: Possibly a brief error on browse or play; video already playing continues.

  • Active-active control plane in multiple regions
  • Regular region-evacuation exercises (Chaos Kong)
  • Data replicated across regions in Cassandra

What if: an embedded OCA fails?

The appliance stops reporting healthy, so steering stops handing out its URLs; clients fetch from another OCA, such as one at an internet exchange.

User impact: Usually none; the player switches source and its buffer hides the change.

  • Multiple OCAs per ISP and at IXPs
  • Steering uses live health reports

What if: eVCache is degraded?

Data services fall back to the databases and to static fallbacks where possible; circuit breakers stop callers from piling up on slow dependencies.

User impact: Slower or less personalised pages until the cache recovers.

  • Cache replicated across zones
  • Hystrix-style circuit breakers with fallbacks

Trade-offs

Build a CDN vs. rent one

Build Open Connect and give appliances to ISPs for free.

Pros
  • Video stays inside ISP networks
  • Off-peak fill avoids peak-hour backbone load
  • Full control over hardware and software
Cons
  • US$1B+ invested since 2011
  • Hardware logistics with 1,000+ ISP partners

Alternatives: Commercial CDNs (Netflix used them before Open Connect)

Availability over consistency for member data

Cassandra replicated across regions, tolerating eventual consistency.

Pros
  • Writes keep working during regional failures
  • Simple multi-region failover
Cons
  • Reads can briefly be stale, e.g. a bookmark a few seconds old

Microservices with defensive fallbacks

Hundreds of small services, each wrapping dependencies in timeouts and circuit breakers.

Pros
  • Independent deploys and team autonomy
  • Failures degrade features instead of the whole app
Cons
  • Operational complexity and fan-out latency

Frequently asked questions

Does Netflix stream video from AWS?

No. AWS runs the control plane: sign-in, browsing, recommendations and deciding where to stream from. The video files are served by Netflix's own Open Connect appliances, located inside ISPs and at internet exchange points.

What is Netflix Open Connect?

Netflix's own content delivery network. It is made of Open Connect Appliances: servers that Netflix gives to ISPs for free or places at internet exchanges. By 2021 there were more than 14,000 appliances in 142 countries, and each deployment holds nearly the whole catalogue.

How does Netflix decide which server streams to me?

Every appliance reports its health, the network routes it has learned and the files it holds to control-plane services in AWS. When you press play, a steering service uses that information to pick appliances near you that have the files, and sends your device their URLs.

How does Netflix survive an AWS outage?

The control plane runs in multiple AWS regions with data replicated between them, and Netflix practises moving all traffic out of a region. Because video comes from Open Connect, streams already playing are unaffected by a cloud-region failure.

Building blocks used

Sources