What happens when the user clicks the like/dislike button again?
We don’t want our users to like and dislike an already liked/disliked video. But, what should happen if a user likes or dislikes a video again:
- If a user likes an already liked video, then we have to undo the like and decrement the like count.
- If a user dislikes an already disliked video, then we have to undo the dislike and decrement the dislike count.
- If a user has disliked the video and then clicks on the like button, then we have to undo the dislike and decrement the dislike count and then increment the like count and like the video.
- If a user has liked the video and then clicks on the dislike button, then we have to undo the like and decrement the like count and then increment the dislike count and dislike the video.
We have to create a metadata which stores information about if a user has already like or disliked the video.
Design a system to count likes, dislikes and comments on YouTube videos
YouTube is the world’s largest video-sharing platform, with billions of users uploading and consuming content daily. The success of a YouTube video can be measured in various ways, including the number of likes, dislikes, and comments it receives. Tracking these engagement metrics is essential for content creators and the platform itself.
Important Topics for Designing System that Counts Likes, Dislikes and Comments on Youtube Videos
- Requirements
- Capacity Assumptions
- High-Level Design
- What happens when the user clicks the like/dislike button again?
- Database Design
- Communicating with the servers:
- Microservices Used
- Workflow
- Scalability Considerations
- Conclusion