← Lessons

quiz vs the machine

Platinum1850

System Design

Design a Video Streaming Service

Upload, transcode, and stream video to millions with adaptive quality.

8 min read · advanced · beat Platinum to climb

Requirements

  • Let creators upload video and viewers stream it smoothly.
  • Adapt quality to the viewer network speed.
  • Serve global audiences with low buffering.

High level design

Uploads are stored, transcoded into multiple bitrates, segmented, and served from edge caches.

  • Ingest and store: an upload lands in object storage as the raw source.
  • Transcoding pipeline: workers encode the video into several resolutions and split each into small segments.
  • Delivery: a CDN caches segments near viewers, and players fetch a manifest then pull segments adaptively.

Bottlenecks

  • Transcoding cost: encoding many renditions is expensive, so parallelize across workers and process segments independently.
  • Startup latency: viewers want instant play, so prefetch the first segments and start at a low bitrate.
  • Adaptive switching: networks vary, so the player measures throughput and switches renditions per segment.

Manifests list the available bitrates and segment URLs so the player can climb to higher quality when bandwidth allows.

Key idea

A streaming service transcodes uploads into segmented multi bitrate renditions delivered from a CDN, letting players adapt quality segment by segment.

Check yourself

Answer to earn rating on the learn ladder.

1. Why split each rendition into small segments?

2. How does the player adapt to a slowing network?