Wednesday, August 14, 2019

Case study: design youtube or netflix

August 14, 2019

Introduction


It is not easy to work on system design called design youtube.com. How to prepare in 30 minutes on this topic? I like to study the lecture note and then write down my thought process.

My notes


Now it is 5:44 PM. I like to go out to play tennis in less than 30 minutes. So I will spend next 30 minutes to take notes.

First, I like to write down the terms I read in the lecture note I should look into later.

video compression and replication
bandwidth 10MB/min
upload:view ratio of 1:200
1TB/s outgoing bandwidth
300GB/min (5GB/sec) bandwidth estimates
Storage estimates: 1500 GB/min (25 GB/sec)
46K/ 200 => 230 videos/sec

High level design

1. processing queue - uploaded video will be pushed to a processing queue to be de-queued later for encoding, thumbnail generation, and storage.
2. encoder - to encode each uploaded video into multiple formats
3. thumbnail generator:
4. Video and thumbnail storage:  distributed file storage
5. user database:
6. video metadata storage:


How to manage read traffic?

segregate read traffic from write traffic

Multiple copies of each video, we can distribute our read traffic on different servers.

For metadata, we can have master-slave configurations where writes will go to master first and then gets applied at all the salves.

Stalesness in data -  it might be acceptable

No comments:

Post a Comment