Design Netflix
Understanding the Problem
🍿 What is Netflix? Netflix is a subscription video-on-demand (VOD) service. Members pick a film or an episode from a personalized home screen and stream it on a TV, phone or laptop. Unlike YouTube, the catalog is curated and relatively small: the company licenses or produces every title, so it knows what it will serve long before anyone watches it. That single fact shapes the whole design.
Functional Requirements
Netflix has profiles, billing, downloads, games and live events. Agree with your interviewer to focus on the core viewing loop.
Core Requirements
- Users should be able to browse a personalized home screen of rows ("Continue Watching", "Because you watched…", genres).
- Users should be able to play any title with quality that adapts to their device and network, and resume where they left off.
- Users should be able to see what's trending in their country (a "Top 10 in your country today" row).
Below the line (out of scope)
- Sign-up, billing and profile management.
- How the recommendation models are trained (we'll treat their output as an input).
- Offline downloads, live events and games.
- Content acquisition and the studio side.
Non-Functional Requirements
Ask for scale. We'll assume about 300 million member accounts worldwide, with peak evening viewing of around 40 million concurrent streams.
Core Requirements
- Playback should start within about two seconds and rebuffer rarely, including on TVs on home broadband during the evening peak.
- The system should deliver hundreds of terabits per second at peak, at a sustainable cost.
- Playback should be highly available (99.99%+). A member should be able to keep watching even when parts of our control plane are down.
- The Top 10 per country can be minutes to hours stale.
- Video quality per bit should be as high as possible, because bandwidth is the dominant cost and many members are on constrained networks.
Below the line (out of scope)
- Strong consistency for viewing history. "Continue watching" can be a few seconds behind.
- Per-title licensing windows by country (we'll assume an entitlement check exists).
The numbers:
- Peak egress: 40M concurrent streams at an average of about 5 Mbps (a mix of HD on TVs and lower bitrates on phones) is 200 Tbps. That is a meaningful share of evening internet traffic in many countries.
- Catalog: tens of thousands of titles. Counting episodes, maybe a few hundred thousand playable items. Each one is encoded into many files (resolutions, bitrates, codecs, audio languages, subtitles), so the full catalog is on the order of petabytes, but it's a fixed, known set of files.
- Control plane: 40M streams don't mean 40M API calls per second. Starting a stream is one or two calls, plus a heartbeat every 30-60 seconds. That's on the order of a million requests a second at peak, which is a normal, horizontally scaled cloud service.
The key insight is the shape of the problem. YouTube has billions of videos and can't predict which ones will be watched, so it caches on demand. Netflix has a small catalog and knows the evening's demand quite well in advance, so it can copy the right files close to members during the night, when networks are idle, and serve almost every byte from inside the member's own ISP. Spot this early and the rest of the design follows.