withsoon
N
Playback4/14

Netflix System Design

Playback

~8 min read

The most common follow-up after drawing the architecture. Walk through every hop with latency budgets. Emphasize that API servers never touch video bytes.

Press Play β€” 16-Step Sequence

Instead of reading this as one long line, think in four interview-friendly phases: request enters, checks run in parallel, response comes back, then the streaming loop continues off the API critical path.

Request Enters

Steps 1–4

Client request reaches the playback backend and the orchestration fan-out begins.

1
Client

POST /playback/session { titleId, episodeId, deviceId, drmScheme }

β€”
2
Route53 / ELB

DNS resolve + load balance to nearest healthy API server

~5ms
3
Zuul2 (API Gateway)

Validate JWT signature, rate-limit check, route to Playback Service

~2ms
4
Playback Service

Receives request β€” begins parallel fan-out to 4 services simultaneously

β€”

Parallel Checks

Steps 5–9

Entitlement, stream slot, OCA ranking, and DRM license happen in parallel.

5
β†’ EVCacheparallel

Check entitlement cache: is account active? which plan?

~1ms
6
↳ EVCache β†’ MySQL fallbackparallel

Cache MISS only: entitlement falls through to billing data on a MySQL read replica. Cache hit rate stays above 99%.

~10ms
7
β†’ Concurrency Serviceparallel

Redis Lua script: atomically check slot count ≀ plan limit, INCR, SADD sessionId, TTL=36s

~1ms
8
β†’ Steering Serviceparallel

Get ranked OCA list for client IP: ASN match + title cached + OCA health + load

~5ms
9
β†’ DRM Serviceparallel

Issue license token signed by HSM (Content Encryption Key wrapped for device TEE)

~10ms

Response Out

Steps 10–13

Manifest URL is built, async writes are kicked off, and the client gets everything needed to start.

10
Playback Service

Build signed HMAC-SHA256 manifest URL (6h TTL) pointing to chosen OCA

~1ms
11
Playback Serviceasync

Write session to Cassandra β€” ASYNC, off critical path

async
12
Playback Serviceasync

Publish playback.started to Kafka β€” ASYNC, off critical path

async
13
Client

Receives signed manifest URL ← TOTAL API time ends here

TOTAL ~85ms / P99 <300ms

Streaming Loop

Steps 14–16

Video bytes come from OCA, and heartbeats keep the session alive without blocking playback.

14
Client β†’ OCA

Fetch DASH/HLS manifest, then download video segments β€” API tier COMPLETELY out of path

β€”
15
Client (every 30s)

POST /playback/heartbeat { sessionId, positionMs, bitrateKbps, bufferMs }

β€”
16
Playback Serviceasync

Refresh Redis slot TTL to 36s + async Cassandra position write

async

Critical path

Steps 1 β†’ 13

The API latency budget ends when the signed manifest URL comes back.

Parallel fan-out

Steps 5 β†’ 9

These checks happen together, so interviewers expect you to talk about the max latency, not the sum.

Streaming tier

Steps 14 β†’ 16

After playback starts, video bytes come from OCA and backend mostly handles heartbeats plus session TTL refreshes.

Latency Budget Breakdown

DNS + ELB~5ms
JWT validation (Zuul2)~2ms
Entitlement (cache HIT)~1ms
Entitlement (cache MISS)~10ms
Concurrency check (Redis)~1ms
OCA selection (Steering)~5ms
DRM license (HSM)~10ms
Manifest URL build~1ms
Cassandra writeasync (not on path)
Network overhead~50ms
Total (cache hit path)~75ms
P99 with jitter~200–300ms

Failure Behavior

Every downstream dependency has a defined failure mode. Interviewers test this.

Billing service downFAIL OPEN

Use cached entitlement (EVCache TTL = 1h) for active paying users. Fail closed only for new or suspicious sessions with no cached state.

Why: Netflix would rather give away one play than block 60M concurrent users during a billing outage.

DRM license service downFAIL CLOSED

Return HTTP 503 to client. No plaintext fallback is allowed β€” studio licensing contracts require this.

Why: Content protection is a legal contractual requirement, not a reliability choice.

Watch history write failsFAIL OPEN

Playback continues unaffected. Resume position may be slightly stale. Next heartbeat will update position.

Why: Watch history is eventually consistent by design. Slightly stale resume is acceptable.

CDN edge node downFAIL OPEN

Player falls back to next OCA in the ranked list. If all ISP OCAs unhealthy, Exchange OCA, then S3 origin.

Why: OCA selection returns 3–5 candidate nodes. Client retries down the list automatically.

Heartbeat delayed / droppedFAIL OPEN

Concurrency slot self-expires after 36s TTL if no heartbeat arrives. Player retries heartbeat independently.

Why: 36s TTL > 30s heartbeat interval provides 1 missed heartbeat grace period before slot eviction.

Concurrency race (two devices play simultaneously)FAIL CLOSED

Redis Lua script is atomic. Race condition impossible β€” only one device wins the slot INCR. Loser gets 429.

Why: Atomicity at the Redis layer eliminates the race without distributed locks.

Startup Optimizations

1
Entitlement pre-warm: EVCache entitlement entry is refreshed on every login, not just on cache miss. Hit rate: >99%.
2
Parallel fan-out: Steps 5–9 execute in parallel β€” not sequentially. Total latency = max(all steps), not sum.
3
Async writes off critical path: Cassandra session write and Kafka event publish happen after the response is sent. They do not add latency.
4
Manifest pre-build: Static manifests for popular titles are pre-generated and stored. Dynamic manifest URL wraps the pre-built file with a signed token.
5
OCA content pre-positioning: Nightly algorithm fills OCAs with predicted next-day popular titles before 8pm release windows.
6
ABR startup quality: Player starts at a lower bitrate (fast segment) and ramps up. Perceived startup is instant even on slow connections.
πŸ“‹ Say This In Interview
The Playback Service is intentionally thin β€” it validates auth, checks entitlement via EVCache, acquires a stream slot atomically via Redis Lua, gets a DRM license token, and returns a signed manifest URL. Steps 5–9 run in parallel so total latency is ~85ms, not the sum of each step. After step 13, Netflix's API servers are completely out of the video path. 95% of Netflix traffic is video bytes flowing directly client-to-OCA.
Last reviewed June 2026 Β· By Prasoon ParasharNumbers are interview assumptions, not real Netflix internal figures.
Was this tab useful for interview prep?