Media & streaming · Intermediate

Video streaming

Uploads to object storage, queued transcoding, playback straight from a CDN.

Every part, and why it is there

Viewers

Watching is the main load. A player fetches a new few-second segment every few seconds for the whole video.

Creators

A small group uploading large files. Uploads must survive flaky connections, so they go in resumable chunks.

Video CDN

Serves video segments from edge servers near viewers. Popular videos are almost always cached, so origin traffic stays small.

API gateway

Entry point for the API: auth, rate limits and routing. Video bytes never pass through it.

Upload service

Accepts chunks, writes them to object storage, and queues a transcode job once the file is complete.

Video metadata API

Titles, thumbnails, durations and the playlist URL. The player gets the playlist here, then streams straight from the CDN.

Raw uploads

Original files as uploaded. Kept so videos can be re-encoded later in new formats.

Transcode jobs

One job per uploaded video. Transcoding takes minutes, so uploads finish fast and the work happens in the background.

Transcoders

Re-encode each video into several resolutions, cut into short segments the player can switch between as bandwidth changes.

Video segments

The encoded segments and playlists. The CDN fetches from here on a cache miss.

Metadata DB

Video records, owners and processing status. Small and relational, so plain SQL fits.

Search index

Full-text search over titles and descriptions; a database LIKE query would not rank or scale.

Asked in interviews at

  • datadog
  • meta
  • amazon
  • snap
  • openai

Learn more

All system design examples