Design YouTube
Learn to design a system similar to YouTube.
Overview
YouTube is a popular video streaming service where users upload, stream, search, comment, share, and like or dislike videos. Large businesses as well as individuals maintain channels where they host their videos. YouTube allows free hosting of video content to be shared with users globally. YouTube is considered a primary source of entertainment, especially among young people, and as of 2022, it’s listed as the second most-viewed website after Google by
Let’s evaluate your understanding of the building blocks required in the design of YouTube. Assuming the basic functional and nonfunctional requirements for YouTube, identify three key building blocks needed to curate the YouTube design.
You should focus on the building blocks required for back-end storage and efficient data transmission to end users. Please also specify the reason(s) behind the selection of a building block.
Requirements
Let’s start with the requirements for designing a system like YouTube.
Functional requirements
We require that our system is able to perform the following functions:
- Stream videos
- Upload videos
- Search videos according to titles
- Like and dislike videos
- Add comments to videos
- View thumbnails
Non-functional requirements
It’s important that our system also meets the following requirements:
- High availability: The system should be highly available. High availability requires a good percentage of uptime. Generally, an uptime of 99% and above is considered good.
- Scalability: As the number of users grows, these issues should not become bottlenecks: storage for uploading content, the bandwidth required for simultaneous viewing, and the number of concurrent user requests should not overwhelm our application/web server.
- Good performance: A smooth streaming experience leads to better performance overall.
- Reliability: Content uploaded to the system should not be lost or damaged.
We don’t require strong consistency for YouTube’s design. Consider an example where a creator uploads a video. Not all users subscribed to the creator’s channel should immediately get the notification for uploaded content.
To summarize, the functional requirements are the features and functionalities that the user will get, whereas the non-functional requirements are the expectations in terms of performance from the system.
Based on the requirements, we’ll estimate the required resources and design of our system.
Building blocks and design
Based on the requirements, we will use the different elementary design problems in the advanced design problems as building blocks. Let’s identify the building blocks that will be an integral part of our design for the YouTube system. The key building blocks are given below:
- Databases: Databases are required to store the metadata of videos, thumbnails, comments, and user-related information.
- Blob storage: Blob storage is important for storing all videos on the platform.
- CDN: A CDN is