SD System Design In Depth
0%
design system-designmediadesign

Design: a video platform

Module 6.3: High-Scale Media & Operations Designs Updated Sep 18, 2026
📄 Cheat Sheet
System Design Interview: Design YouTube w/ a Ex-Meta Staff Engineer
Hello Interview System Design Interview: Design YouTube w/ a Ex-Meta Staff Engineer Watch on YouTube ↗

Kept: a strong walkthrough of resumable multipart upload, a chunked transcoding DAG, HLS/DASH manifests and CDN delivery, closely matching the lesson.

0:00 / --:--

Designing a Video Streaming Platform

A video platform like YouTube or Netflix turns an uploaded file into media that viewers can play on different devices and varying network connections. Uploading is only the first step: the service must prepare suitable versions, make them discoverable, and keep delivering the next segment while playback continues.

The scale is staggering. YouTube processes hundreds of hours of video uploads every minute and serves billions of views daily. Netflix accounts for a massive percentage of the internet's downstream traffic.

The Upload Pipeline

When a creator uploads a video, we don't just store the raw file and serve it. The upload goes to an object storage service like Amazon S3.

Because video files are large, we use Multipart Uploads. The client breaks the file into smaller chunks and uploads them in parallel. If a chunk fails, only that chunk is retried, rather than restarting a 5GB upload from scratch. To do this securely directly to object storage, the backend generates Pre-signed URLs for each chunk.

Transcoding and Adaptive Bitrate Streaming

Raw video is huge and not universally playable. The platform must transcode the video into a ladder of codecs (H.264, VP9, AV1), resolutions (1080p, 720p, 480p) and bitrates, packaged in containers such as MP4/CMAF or WebM, to support everything from high-end 4K TVs to 10-year-old smartphones on 3G connections.

flowchart LR Raw["Raw Video in S3"] --> Queue["Message Queue"] Queue --> Worker1["Transcode 1080p"] Queue --> Worker2["Transcode 720p"] Queue --> Worker3["Transcode 480p"] Worker1 --> CDN[("CDN")] Worker2 --> CDN Worker3 --> CDN

Modern streaming uses protocols like HLS (HTTP Live Streaming) or DASH (Dynamic Adaptive Streaming over HTTP). These protocols break the transcoded video into short segments (typically 2 to 6 seconds; Apple's HLS authoring spec recommends 6 seconds). The video player on the client's device downloads a manifest file listing all segments and quality levels.

The magic is Adaptive Bitrate Streaming (ABR). If the user's network speed drops, the video player automatically requests the next 2-second segment in 480p instead of 1080p, preventing playback buffering.

Delivering Content (CDN)

Serving video directly from centralized application servers would melt the servers and result in terrible latency for users far away. Video platforms rely heavily on Content Delivery Networks (CDNs).

When a user in Tokyo clicks play, they stream the video chunks from an edge server in Tokyo, not from the primary data center in Virginia. CDNs cache the static video segments globally. Netflix takes this a step further with Open Connect, placing custom cache appliances directly inside the data centers of Internet Service Providers (ISPs).

Metadata and Search

While the heavy video files live on CDNs and object storage, the video metadata (title, description, tags, view count) lives in a database (like MySQL or Cassandra). A search cluster (like Elasticsearch) indexes this metadata to power the search bar.

View counting is notoriously difficult at scale. Updating a database row every time someone watches a video would cause massive write contention. Instead, platforms use distributed counters or stream processing (like Kafka + Flink) to aggregate views asynchronously and write them to the database periodically.

A typical bitrate ladder (H.264)

RenditionResolutionApproximate bitrateGB per hour of video
240p426x2400.4 Mbps0.18
480p854x4801.2 Mbps0.54
720p1280x7203 Mbps1.35
1080p1920x10805 to 6 Mbps2.25 to 2.7
4K (HEVC or AV1)3840x216012 to 16 Mbps5.4 to 7.2

Netflix's per-title and per-shot encoding tunes the ladder to each piece of content. A cartoon needs far fewer bits than a grainy action film at the same quality, and AV1 needs roughly 30 to 50% fewer bits than H.264 at similar quality, at a much higher encoding cost.

Worked example: storage and egress

  • YouTube has said that more than 500 hours of video are uploaded every minute, which is about 720,000 hours per day.
  • If every upload got the full ladder above (about 10 GB per hour across renditions), that would be about 7 PB per day. Real platforms encode only low renditions for rarely watched videos, and add high and 4K renditions once a video becomes popular.
  • Egress dominates cost. 10 million concurrent viewers at an average of 3 Mbps is 30 Tbps. That is why Netflix places Open Connect appliances inside ISPs, and why a CDN hit ratio of 95% or more is essential.

Processing pipeline

flowchart LR U["Resumable multipart upload to object store"] --> V["Validate and probe"] V --> S["Split into GOP-aligned chunks"] S --> E1["Encode chunk renditions in parallel"] E1 --> J["Join and package HLS and DASH segments"] J --> DRM["Encrypt segments and register DRM keys"] DRM --> M["Write manifests and mark ready"] M --> CDN["Pre-warm CDN for expected hits"]

Segment length trade-off

Segment lengthProCon
2 sFaster start and faster bitrate switching; lower live latencyMore requests and manifest entries; slightly worse compression
6 s (Apple's HLS recommendation)Efficient, fewer requestsSlower adaptation; higher live latency
Low-latency HLS/DASH partial segments2 to 5 s glass-to-glass latency for live streamsMore complex players and CDN configuration
Check yourself Question 1 of 3
Adaptive bitrate recall
From: Designing a Video Streaming Platform

A viewer watching a 1080p HLS stream moves into weak coverage and throughput drops sharply. What does adaptive bitrate streaming do?

Key Takeaways

Use multipart uploads and pre-signed URLs to reliably move large files directly to object storage.
Transcode video into multiple formats and resolutions to support all devices.
HLS and DASH protocols segment video and enable Adaptive Bitrate Streaming to prevent buffering.
Rely on CDNs to cache and deliver heavy video segments close to the user.
Handle view counting asynchronously using event streams and aggregation to avoid database lock contention.
Was this lesson helpful? Spot an issue or have a suggestion? Let us know on GitHub.
Report an issue