YouTube Architecture

Uploading, transcoding and serving video to billions.

On the roadmap:Software Architect · step 5: Learn from the giants

Overview

YouTube ingests uploads, transcodes them into many formats and bitrates, and serves them through a global CDN. Vitess helped scale MySQL for metadata.

Architecture highlights

  • Asynchronous transcoding pipeline
  • Adaptive bitrate streaming
  • Vitess for sharding MySQL metadata
  • Global CDN and edge caching

Architecture diagram

Key components

  • Upload service

    Resumable ingestion of large files

  • Transcoding workers

    Convert to multiple codecs and resolutions

  • Metadata DB (Vitess)

    Titles, comments and counters

  • CDN / edge caches

    Serve popular videos near viewers

  • Recommendation system

    Ranks the home feed

Challenges and trade-offs

  • Hot content

    Viral videos produce traffic spikes that must be absorbed at the edge.

  • Storage growth

    Hundreds of hours are uploaded every minute, each in many renditions.

  • Counter accuracy

    View counts need eventual consistency with fraud filtering.

Study: YouTube

Learn how YouTube is built from the people who explain it. Watch first for the picture, then read for the detail.