Video Streaming (YouTube) System Design

Hard
media
bandwidth
global

Serve video to a global audience while creators keep uploading.

About this problem

Design a video platform like YouTube. Viewers anywhere in the world stream any video with as little buffering as possible, and see its title, view count and recommendations. Creators keep uploading new videos all the time.

Playback must stay smooth even at the busiest times, and new uploads must never interrupt anyone who is watching.

Ninety percent of all traffic is video being streamed, 8% is video details and recommendations, and 2% is uploads. Traffic ramps to a very high peak of 50,000 requests per second.

Requirements

  • Creators upload videos.
  • Viewers stream any video with minimal buffering.
  • Viewers see video metadata: title, views, and recommendations.

Scale targets

  • 90% of traffic is streaming video bytes.
  • Traffic ramps to a very high peak; origin servers alone cannot keep up.

Traffic

Ramp, 0 to 50,000 TPS. The simulator sets this traffic up for you when you start the problem.

CAP trade-off

Favors availability

Playback must never stop. A view count or recommendation that's slightly out of date is acceptable.

Practice it

Build it on the canvas, run the traffic, and get scored.