Solved design · 03 of 12 · 10 credits, once

Netflix

Playback starts through a DRM license server and a metadata cache, browsing with a recommendation ranker, playback events into Kafka; video segments on Open Connect.

Template
Netflix
Level
Advanced
Reading time
20 min
Topics
CDNDRMRecommendationsCache (EVCache)KafkaStream processing

In the lab Playback starts through a DRM license server and a metadata cache, browsing with a recommendation ranker, playback events into Kafka; segments on Open Connect. It meets its goals as given (success ≥ 99%, p99 ≤ 500 ms, Apdex ≥ 0.90). Open it to see how it is put together, then push it: 3x traffic, an attack, a flush, a dead replica, and fix what breaks.

1Context and scope

Pressing play has to start a stream in a second or two: the player needs the title’s metadata, a decryption key from a license server, and then segments from a CDN close to the viewer. Browsing is a ranked, personalised catalog. Every play emits events that feed viewing history and recommendations. This design covers play starts, browsing and licenses at browser scale; the video bytes come from the CDN and are not simulated per byte. It is based on Netflix’s technology blog (Open Connect, EVCache, Zuul).

2Goals and non-goals

Goals

  • 6,000 requests a second: 50% play starts, 45% browse, 5% license requests.
  • Success at least 99%, p99 at most 500 ms, Apdex at least 0.90.
  • Playback events are processed asynchronously with nothing lost.

Non-goals

  • Video bytes: Open Connect serves segments; this is the API traffic around playback.
  • Encoding and the content pipeline.
  • Billing and sign-up.

3Capacity estimate

QuantityValueHow
Served at the CDN95% of readsOpen Connect: 1 TB of edge storage, 2M objects, 7-day TTL
Play starts≈ 3,000/seach reads metadata through the cache and emits an event
Metadata cache32 GB, 2M titlesZipf 1.2: a few titles get most plays, so nearly everything hits
Recommendations≈ 2,700/s1,024 slots, 96 vCPU, 5 ms CPU: 13.5 vCPU busy
License requests≈ 300/s600 slots at 15 ms: 4.5 busy
Playback events≈ 3,000/s64 partitions, 128 Flink workers at 2 ms

The rest of the doc

The design · Key concepts · Alternatives considered · Failure modes and fixes · Try it in the lab · Check yourself · Further reading

Solved design · 10 credits, once

Unlock the Netflix design doc

Every component and why it is there, the capacity numbers behind it, what breaks when you push it and how to fix it, and the same system open in the lab to break and fix yourself. Paid once, on your account.