withsoon
N
Encoding6/14

Netflix System Design

Encoding Pipeline

~6 min read

Content Lifecycle State Machine

Every title transitions through these states. A title is never published until all required assets pass QC.

UPLOADED→
VALIDATED→
ENCODING→
QC_PENDING→
PACKAGED→
ENCRYPTED→
DISTRIBUTING→
PUBLISHED→
ARCHIVED
Validation fail β†’ UPLOADED (retry)QC fail β†’ ENCODING (retry with new settings)PUBLISHED β†’ ARCHIVED (when licensing expires)

Pipeline Stages

Click any stage for implementation details and design considerations.

Parallel transcoding jobs for each output profile. Typically 15–20 output variants per title. Each variant is an independent job β€” failures are retried independently.

Design Considerations
β–ΈIdempotent jobs β€” safe to retry on failure
β–ΈJob queue (SQS/Kafka) for work distribution
β–ΈSpot compute for cost efficiency (long jobs)
β–ΈCodec ladder: H.264 for wide compatibility, H.265/AV1 for premium quality

Encoding Variants (Codec Ladder)

Each title is transcoded into 15–20 output profiles. Client ABR selects the right one based on bandwidth and device capability.

ResolutionQualityBitrate RangeCodecDevice Compatibility
3840Γ—21604K UHD15–25 MbpsH.265 / AV14K TVs, high-end mobile
1920Γ—10801080p Full HD5–10 MbpsH.264 / H.265Most smart TVs, laptops
1280Γ—720720p HD2.5–5 MbpsH.264Mid-range mobile, tablets
960Γ—540540p1–2.5 MbpsH.264Low-bandwidth fallback
640Γ—480480p SD0.5–1 MbpsH.264Very low bandwidth / mobile data
320Γ—240240p0.2–0.5 MbpsH.2642G/3G mobile fallback

Idempotency & Job Queue Design

Each encoding job has a deterministic job ID = hash(titleId + outputProfile + inputChecksum). Re-submitting the same job is a no-op if output already exists in storage.

Job queue (SQS/Kafka): jobs are visibility-timeout based. If a worker crashes mid-job, the message reappears after timeout for another worker to pick up.

Output written to a content-addressed path (hash of output). Final step: atomic rename/link to canonical path once complete. Readers always see either old complete output or new complete output β€” never partial.

πŸ“‹ Say This In Interview
Content encoding is an async pipeline with a well-defined state machine: UPLOADED β†’ VALIDATED β†’ ENCODING β†’ QC β†’ PACKAGED β†’ ENCRYPTED β†’ DISTRIBUTING β†’ PUBLISHED. Each stage is an independent idempotent job. Encoding generates 15–20 variants per title for adaptive bitrate. The DRM encryption step wraps each segment in AES-128 using a CEK stored in HSM. A title is never published until all required variants pass automated QC. The nightly fill algorithm then proactively pushes high-demand titles to OCA edges before peak viewing.
Last reviewed June 2026 Β· By Prasoon ParasharNumbers are interview assumptions, not real Netflix internal figures.
Was this tab useful for interview prep?