Let's design a video sharing service like Youtube, where users will be able to upload/view/search videos.
YouTube is one of the most popular video sharing websites in the world. Users of the service can upload, view, share, rate, and report videos as well as add comments on videos.
- Users should be able to upload videos.
- Users should be able to share and view videos.
- Users should be able to perform searches based on video titles.
- Our services should be able to record stats of videos, e.g., likes/dislikes, total number of views, etc.
- Users should be able to add and view comments on videos.
- The system should be highly reliable, any video uploaded should not be lost.
- The system should be highly available.
- Users should have a real time experience while watching videos and should not feel any lag.
Video recommendations, most popular videos, channels, subscriptions, watch later, favorites, etc.
We should use Consistent Hashing for distribution among database servers. Consistent hashing will not only help in replacing a dead server, but also help in distributing load among servers.