🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Design YouTube

System Design ProblemsVideo Streaming SystemsđŸŸĸ Free Lesson

Advertisement

System Design Problems

Design YouTube

YouTube serves 2B+ monthly active users with 500+ hours of video uploaded every minute. This design covers video upload pipelines, adaptive streaming, CDN delivery, and recommendation systems.

  • Scale — 2B MAU, 500+ hours uploaded/minute, 1B hours watched/day
  • Storage — Exabytes of video content
  • Streaming — Adaptive bitrate with sub-second startup

YouTube's core challenge is the asymmetric nature: massive storage for uploads, massive bandwidth for streaming.

Requirements Clarification

Functional Requirements

  1. Upload videos with metadata
  2. Stream videos with adaptive quality
  3. Search videos by title/tags
  4. Like, comment, subscribe
  5. View personalized recommendations
  6. Live streaming
  7. Short-form content (Shorts)

Non-Functional Requirements

  1. Availability: 99.99% uptime
  2. Latency: Video starts in < 2 seconds
  3. Durability: Videos must never be lost
  4. Consistency: Eventual consistency for counts
  5. Scale: 1B hours of video watched daily

Back-of-the-Envelope Estimation

High-Level Architecture

ClientsCDN EdgeAPI Gateway / Load BalancerUpload ServiceChunked UploadTranscodingPipelineVideo StreamHLS/DASHRecommendationML PipelineSearchIndex/QueryMessage Queue (Kafka)Object Storage(GCS/S3)Video Metadata(MySQL Sharded)User Data(MySQL Primary)Search Index(Elasticsearch)ML Features(Redis/BigTable)

Video Upload Pipeline

ClientUploadIngestServiceVirusScanTranscodeQueueObjectStorage(CDN Origin)Video Upload PipelineChunked upload → Resume support → Parallel processing → Multiple resolutions

Transcoding Pipeline

Adaptive Streaming

HLS vs DASH

FeatureHLSDASH
ProtocolApple's HTTP Live StreamingDynamic Adaptive Streaming
Segment FormatMPEG-TSfMP4/CMAF
Manifestm3u8MPD
DRMFairPlayWidevine/PlayReady
Latency6-30 seconds2-10 seconds

CDN Architecture

Recommendation System

Data Model

Practice Exercises

  1. Upload Design: Design a resumable upload system that handles 10GB files. How do you handle network failures mid-upload?

  2. Transcoding: How would you prioritize transcoding? Should a viral video be transcoded before an old personal video?

  3. Live Streaming: Design a live streaming system with < 5 second latency. How does this differ from VOD?

  4. Storage Optimization: Propose a storage tiering strategy for videos with decreasing popularity over time.


What to Learn Next

-> Design Netflix Content delivery and adaptive streaming.

-> Design Instagram Media delivery and feed generation.

-> Design Amazon E-commerce at scale.

-> Design Google Search Web-scale indexing and ranking.

-> Back Pressure Managing load in streaming systems.

-> Caching Strategies CDN and edge caching patterns.

Need Expert System Design Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement