Video Streaming (YouTube) System Design
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
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.
Related problems
- Photo Sharing (Instagram) System Design
Upload photos and browse a feed of images from people you follow.
- Flash-Sale Ticketing System Design
Sell a limited batch of concert tickets when everyone shows up at once.
- URL Shortener System Design
Turn long URLs into short codes and redirect visitors fast.