Requirements for YouTube Design
Understand the requirements and estimation for YouTube's design.
Let’s start with the requirements for designing a system like YouTube.
Functional requirements
We will consider the following functional requirements:
- Stream videos
- Upload videos
- Search videos according to titles
- Like/dislike videos
- Add comments to videos
- View thumbnails
Non-functional requirements
It is important to have these requirements met:
- 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, the storage in terms of uploading content, the bandwidth in terms of simultaneous viewing, and the application/web server in terms of concurrent user requests should not become a bottleneck.
- Good Performance: A smooth experience in terms of streaming without buffering/lag is desired.
- Reliability: It is an essential factor because uploaded content to the system should not be lost or damaged.
We will not require strong consistency for the design of YouTube. Take the 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/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 will do an estimation of the resources and design of our system.
Estimation
Estimation requires the identification of important resources we will need in the system.
Hundreds of minutes of video content get uploaded to YouTube each minute. Also, a large number of users will be streaming content at the same time which means that the following resources will be required:
- Storage resources will be needed to store uploaded and processed content.
- A large number of requests can be handled by doing concurrent processing. This means web/application servers should be in place to serve these users.
- Both upload and download bandwidth will be required to serve millions of users.
To convert the above-required resources into actual numbers, we will assume the following:
- Total number of YouTube users: 1.5 billion
- Active daily users (that watch/upload videos): 500 million
- Average length of a video: 5 minutes
- Size of an average (5 minutes) video before processing/encoding (compression, format changes, etc.): 600 MB
- Size of an average video after encoding (using different algorithms for different resolutions like MPEG-4 and VP9): 30 MB
Storage
To find the storage needs of YouTube, we have to estimate the total number of videos and the length of each video uploaded to YouTube per minute. Let’s consider that 500 hours worth of content is uploaded to YouTube in one minute. Since each video of 30 MB is 5 minutes long, we require = 6 MB to store 1 minute of video.
Let’s put this in a formula by assuming:
...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy