Design a video streaming platform like YouTube

Design a video streaming platform like YouTube

Designing a video streaming platform like YouTube is a classic and ambitious system design challenge. It involves building a highly scalable system capable of handling video uploads, on-demand playback, live streaming, content discovery, and monetization — all while ensuring low latency and high availability. I’ve chosen this as my next system design exercise to explore distributed media storage, adaptive bitrate streaming, and scalable content delivery.

Functional Requirements

Let’s start by defining what our video streaming platform needs to support:

  1. Video Uploads: Users should be able to upload videos
  2. Video Playback: Users should be able to watch and stream videos on demand with minimal buffering
  3. Scalability: Support approximately 1 million video uploads per day, 100 million daily active users (DAU), and videos up to 256GB in size
  4. Core Entities: The main data models include Video, Video Metadata, and User

Non-Functional Requirements

Our system must scale efficiently and deliver reliable, high-performance video experiences:

  1. High Availability: Prioritize availability over consistency for video uploads
  2. High Concurrency: Support simultaneous uploads and streaming of large videos up to 256GB
  3. Low Latency: Deliver smooth streaming with latency under 500ms even in low bandwidth conditions
  4. Scalability: Handle up to 1 million uploads per day and support over 100 million videos

API Design

We’ll define RESTful endpoints for core video operations such as uploading and streaming:

Video CRUD Endpoints


// Upload a video
POST /videos
Request:
{
  "videoFile": "",
  "videoMetadata": {
    "title": "My Video",
    "description": "A sample video",
    "tags": ["sample", "fun"],
    "uploaderId": "user123"
  }
}
Response:
{
  "videoId": "abc123"
}

// Watch a video
GET /videos/:videoId
Response:
{
  "videoUrl": "https://cdn.example.com/stream/abc123",
  "videoMetadata": {
    "title": "My Video",
    "description": "A sample video",
    "views": 1024,
    "uploadDate": "2025-07-17"
  }
}

High-Level Design

Image 1 for blog post titled 'Design a video streaming platform like YouTube'

Deep Dives

Here’s a deeper look into the video processing pipeline after upload:

1. Upload and Chunking

S3 (video upload trigger via S3 notification) → Chunker (splits the video and stores chunks back to S3 as 2–10s clips) → Chunk metadata saved in videoMetadata DB

  • FullS3Url: URL to the original full-length video file
  • Chunks: Array of S3 URLs pointing to video segments

2. Transcoding

Chunker → Transcoder (generates versions at 240p, 720p, 1080p, and 4K) → Stores resolution-specific chunk info in videoMetadata DB


ChunksByResolution:
{
  "240p": ["chunk1_240p.mp4", "chunk2_240p.mp4"],
  "720p": ["chunk1_720p.mp4", "chunk2_720p.mp4"],
  "1080p": [...],
  "4k": [...]
}

3. Final Storage

Transcoder output → Stored back to S3 → Served via CDN


I hope this gives you a high-level overview of video streaming platform system design!