Youtube
- chapter 14 of System Design Interview – An insider’s guide
Questions
What
- What features are important? (Upload a video, watch a video)
- What clients do we need to support? (Mobile apps, web browsers, smart TV)
- What is the maximum allowed video size? (1GB)
- What are the supported video resolutions? (Most video resolutions and formats)
- What is the average daily time spent on the product? (30 minutes)
Who
- Who are our users? (5 million daily active users, including a large percentage of international users)
How
- How is encryption handled? (Encryption is required)
- How can we leverage existing infrastructure? (Use cloud services from Amazon, Google, or Microsoft)
Overview
The entire system is broken down in two parts: video uploading flow and video streaming flow.
-
Original storage:
- A blob storage system is used to store original videos.
- “A Binary Large Object (BLOB) is a collection of binary data stored as a single entity in a database management system”
-
Transcoding servers:
- Video transcoding is also called video encoding. It is the process of converting a video format to other formats (MPEG, HLS, etc), which provide the best video streams possible for different devices and bandwidth capabilities.
-
Transcoded storage: It is a blob storage that stores transcoded video files.
-
CDN: Videos are cached in CDN. When you click the play button, a video is streamed from the CDN.
-
Completion queue: It is a message queue that stores information about video transcoding completion events.
-
Note: Downloading means the whole video is copied to your device, while streaming means your device continuously receives video streams from remote source videos.
- When you watch streaming videos, your client loads a little bit of data at a time so you can watch videos immediately and continuously.
- different streaming protocols support different video encodings and playback players. When we design a video streaming service, we have to choose the right streaming protocol to support our use cases
Last updated on