MEDIUMSocial & Mediasenior engineer

Design Netflix/YouTube

Design a video streaming platform like Netflix or YouTube supporting video upload, transcoding, and adaptive streaming.

Estimated Time: 45 minutes
#video-streaming#cdn#transcoding#recommendation
Solution Overview

Use distributed transcoding pipeline, CDN for delivery, and adaptive bitrate streaming for optimal user experience.

Hints to Get Started
1

Consider video encoding and different quality levels

2

How does adaptive bitrate streaming work?

3

Think about CDN placement strategies

Requirements

functional

  • Video upload
  • Video streaming
  • Search
  • Recommendations
  • User profiles
  • Watch history

non functional

  • High availability
  • Low latency playback
  • Adaptive quality
  • Global reach
Capacity Estimation

bandwidth

15% of global internet traffic

video uploads

500 hours/minute (YouTube)

daily active users

200M DAU

High-Level Architecture

storage

metadata

NoSQL (Cassandra/DynamoDB)

user data

Sharded PostgreSQL

raw videos

Object Storage (S3/GCS)

transcoded

Multiple resolutions in object storage

components

  • Upload Service
  • Transcoding Pipeline
  • CDN
  • Video Metadata Service
  • Recommendation Engine
  • Search Service
Streaming

cdn

Edge servers cache popular content

protocol

HLS or DASH for adaptive bitrate

optimization

Predictive pre-fetching, regional caches

Deep Dives

playback

Buffer ahead, adaptive quality based on bandwidth

cold start

Recommendations for new users based on demographics

content delivery

Open Connect (Netflix) - dedicated appliances at ISPs

Video Processing

formats

  • Multiple bitrates (360p to 4K)
  • Multiple codecs (H.264, VP9, AV1)
  • Adaptive segments (HLS/DASH)

pipeline

  • Upload to S3
  • Trigger transcoding
  • Generate multiple resolutions
  • Create thumbnails
  • Extract metadata