Case study boundary
Use this as a learning model.
This page explains architectural patterns and constraints inspired by Netflix. It should not be read as the exact private production architecture or as a one-size-fits-all recommendation.
Evidence
Public info + inference
Learn first
Concepts behind this architecture
CDN
Cache and serve content close to users so origin systems stay fast and protected.
Distributed Tracing
Follow one request across services, queues, databases, and external calls.
Circuit Breaker
Stop calling an unhealthy dependency before failures cascade through the system.
Load Balancer
Distribute traffic across healthy servers without making clients know where work runs.
Overview
Netflix is the world’s leading streaming service with over 260 million paid subscribers in 190+ countries. Its architecture is a masterclass in cloud-native design, having pioneered many microservices and chaos engineering patterns. Netflix serves over 1 billion hours of video per week through its custom CDN (Open Connect), while its recommendation engine drives 80% of content watched.
Scale
260M+
Paid subscribers
1B+ hours
Video streamed weekly
~500K
API requests/second
Petabytes
Content encodings
Requirements
Functional
- Video streaming with adaptive bitrate
- Personalized recommendations and search
- User profiles and viewing history
- Offline downloads
- Multiple concurrent streams per account
- Content browsing across genres
Non-Functional
- Global low-latency video delivery
- 99.99% availability
- Adaptive quality based on network conditions
- Support for 100+ device types
- Horizontal scalability for peak traffic
- Fault tolerance — no single point of failure
High-Level Architecture
Key Components
API Gateway (Zuul)
Edge service handling request routing, authentication, rate limiting, and load shedding. Processes billions of requests per day with dynamic routing rules.
Open Connect CDN
Netflix’s custom CDN with thousands of appliances embedded in ISP networks worldwide. Serves 95%+ of video traffic, reducing internet backbone load.
Playback Service
Determines the optimal video stream for each client based on device capabilities, network conditions, and DRM requirements.
Recommendation Service
ML-powered personalization using collaborative filtering, content-based filtering, and deep learning. Powers 80% of what users watch.
Encoding Pipeline
Transcodes each title into 100+ encodings (resolution, bitrate, codec) using per-title and per-shot optimization for quality-efficient streaming.
EVCache
Distributed caching layer (built on Memcached), handling 30M+ requests/second with sub-millisecond latency for session, profile, and recommendation data.
Data Model
Open Connect CDN Architecture
Netflix’s Open Connect is one of the largest CDNs in the world, purpose-built for video delivery.
How it works:
- Netflix places custom server appliances (OCAs) inside ISP networks worldwide
- During off-peak hours, new content is proactively pushed to OCAs based on predicted demand
- When a user presses play, they’re directed to the closest OCA that has the content
OCA Specifications:
- Custom-built servers with 100+ TB SSD storage
- Optimized FreeBSD-based OS with custom TCP stack
- Single OCA can serve 100+ Gbps of video
- ~18,000 OCAs in 6,000+ locations worldwide
Content Placement Algorithm:
- Predicts what content will be popular in each region
- Fills OCAs during off-peak hours (typically 2am-8am local time)
- Popular content replicated across more OCAs for redundancy
95% of Netflix traffic never crosses the internet backbone, reducing costs and improving quality.
Adaptive Bitrate Streaming
Netflix uses adaptive bitrate (ABR) streaming to deliver the best quality for each user’s network conditions.
Per-Title Encoding: Instead of fixed encoding ladders, Netflix analyzes each title’s visual complexity and creates a custom encoding ladder:
- Simple animation might look perfect at 1.5 Mbps in 1080p
- An action movie might need 8 Mbps for the same resolution
- Saves 20% bandwidth on average while maintaining quality
Per-Shot Encoding:
- Static dialogue scenes get lower bitrates
- Fast-action sequences get higher bitrates
- Smooth transitions between quality levels
Client-Side ABR Algorithm:
- Maintains a ~30-second playback buffer
- Measures download speed of recent segments
- Selects the highest sustainable quality
- Upgrades/downgrades smoothly between segments
Netflix encodes each title into ~120 different streams (resolution, bitrate, codec, HDR combinations).
Chaos Engineering & Resilience
Netflix pioneered chaos engineering — intentionally introducing failures to build system resilience.
Key Tools:
- Chaos Monkey: Randomly terminates production instances
- Chaos Kong: Simulates entire AWS region failure
- Latency Monkey: Introduces artificial delays
Resilience Patterns:
- Circuit Breakers: Calls to failing services are short-circuited with fallbacks
- Bulkheads: Thread pool isolation prevents cascade failures
- Fallbacks: Every service has degraded-mode responses
- Retries with backoff: Exponential backoff with jitter
The philosophy: “The best way to avoid failure is to fail constantly.” By regularly testing failure scenarios in production, Netflix ensures graceful handling of real failures.
Architectural Tradeoffs
Custom CDN (Open Connect) vs. third-party CDN
Pros
- +Full control over hardware/software stack
- +Massive cost savings at scale
- +95%+ traffic served from ISP edge
Cons
- −Huge upfront infrastructure investment
- −Complex ISP relationships
- −Hardware logistics across 6000+ locations
Microservices architecture
Pros
- +Independent deployability
- +Technology heterogeneity
- +Fault isolation between services
Cons
- −Distributed system complexity
- −Network latency between services
- −Harder debugging across boundaries
Per-title encoding over fixed ladders
Pros
- +20% bandwidth savings
- +Better quality for simple content
- +Optimal experience per title
Cons
- −Much higher encoding compute cost
- −Longer content onboarding time
- −Complex encoding pipeline
Learn From Netflix
Copy a learning context prompt for an AI assistant. It keeps assumptions visible and asks for tradeoffs, cost drivers, failure modes, and what to measure before adding complexity.