500M DAU, watch 10 videos per day, 100M upload 1 video per day
Traffic
write: 100M / 24 / 3600 = 1.2k TPS
read: 500M * 10 / 24 / 3600 = 5800k TPS
Storage
Suppose a video is 500MB in size
500MB * 100M = 50PB/day
The actual videos will be stored in object storage.
We can use NoSQL to store the metadata of the videos
Upload
The requests are sent to the write app server, app server saves the metadata to database, and queued the request. A set of encoders pull from the queue, process the chunks into different resolutions, push them to another queue. The combine server read from the second queue, saves the video chunks to S3, all the chunks for the same video is saved to the same file directory, update the metadata in database, and upload the chunks to CDN.
Read
The client fetch the chunked videos from CDN.
Search
The combine server will save the data to search database as well for indexing and search.
Encoder
CDN
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?