Twitter Likes Count Design | Youtube Views Count Design | Near Realtime Counter System Design

KZread Views Count Design | Twitter Likes Count Design | Near Realtime Counter System Design - In this video, I am discussing how to design a near realtime counter for counting systems like:
- Twitter Likes Count
- KZread Views Count
- FB/Instagram Post Views Count
- FB/Instagram Post Likes Count
- Live Streaming View Count
Distributed System Design Interviews Bible | Best online resource for System Design Interview Preparation is now online. Please visit: www.thinksoftwarelearning.com?KZread-tweet-likes-count
Please follow me on / think.software.community if you like to get notified about new course chapters getting added or any other updates. I will also take your suggestions there about the course and the channel.
Check out our following articles:
- How to Ace Object-Oriented Design Interviews: / how-to-ace-object-orie...
- Elevator System Design - A tricky technical interview question: / elevator-system-design...
- System Design of URL Shortening Service like TinyURL: / tinyurl-design-from-th...
- File Sharing Service Like Dropbox Or Google Drive - How To Tackle System Design Interview: / how-to-tackle-system-d...
- Design Twitter - Microservices Architecture of Twitter Service: / design-twitter-microse...
- How to Effectively Use Mock Interviews to Prepare for FAANG Software Engineering Interviews: / how-to-effectively-use...
- Robinhood Backend System Design - How to receive realtime stock updates: / robinhood-backend-syst...
- Payment Gateway System Design - How does the Stripe work: / payment-gateway-system...
- Grokking the Product Design vs. System Design Interviews: / grokking-the-product-d...
- Selecting the best database for your service: / selecting-the-best-dat...
#SystemDesign #DistributedSystems #FAANG #Facebook #Google #Amazon #Apple #Microsoft #Uber #Netflix #Oracle #Lyft #Interview #ComputerProgramming

Пікірлер: 35

  • @ThinkSoftware
    @ThinkSoftware Жыл бұрын

    Let me know if you find this video useful. And please don't forget to like the video and subscribe to this channel. Thanks :)

  • @AnkitJain-ln7gx

    @AnkitJain-ln7gx

    Жыл бұрын

    This is nice explanation. I would like to see design of digital wallet which cover transfer, topup and withdrawal usecase and talks about concurrency and data consistency for users..

  • @Wheyong
    @Wheyong Жыл бұрын

    i would choose eventual consistency in this case, because the exact number is not that important to most users. eventual consistency will make scale of likes count easier

  • @bipulmishra1543
    @bipulmishra15436 ай бұрын

    I have seen a lot paid and free courses on youtube. But luckily I have came across your channel recently when searched parking lot problem. Keep up doing the good work. Hats off sir.🙌

  • @abhijit-sarkar
    @abhijit-sarkar10 ай бұрын

    You ask many what-if questions, but answer none. You also don't justify any of your choices (such as creating the 3rd table instead of updating tweets table). This is not a quiz game; the video is not self-contained.

  • @code-master
    @code-master7 күн бұрын

    Excellent and thought provoking, I like your teaching style where you answer and give thought provoking questions.

  • @computerscientist9980
    @computerscientist9980 Жыл бұрын

    excited!

  • @rahul10anand1
    @rahul10anand13 ай бұрын

    Thanks for covering the breadth of the different solutions. You started with brute force and worked up to suggest some kind of an optimal solution. However, rather than telling the "WHY" part of choosing a design pattern - you are leaving it up to the viewers to interpret and decide. Would have definitely subscribed and liked your content for wholesome information and depth.

  • @jiaweiwu9857
    @jiaweiwu9857 Жыл бұрын

    This is super helpful. Thanks

  • @yujiahe4190
    @yujiahe4190 Жыл бұрын

    A question about write-through cache to distributed cache at 14:09. will redis node die before responding to MQ, will a single record be counted multiple times in this case?

  • @andriidanylov9453
    @andriidanylov9453 Жыл бұрын

    Appreciate 👍for sharing. Approach with likes in separate service looks better for me.

  • @ThinkSoftware

    @ThinkSoftware

    Жыл бұрын

    Thanks for the comment 😊

  • @davidoh0905
    @davidoh090520 күн бұрын

    so I am not sure how things are concluded. is the cache going to hold counters for all of the history that ever exists? and there's two types of consumers? one that writes individual like records to DB and one that stream aggregate and update increments to the Distributed cache?

  • @beinspired9063
    @beinspired9063 Жыл бұрын

    Hey...I loved your videos, they are really helpful. Special thing is you ask a lot of questions during explanation and open my mind to think beyond one way of thinking. My question is - where do you discuss these questions which you ask in your videos? Many thanks... wishing you good health and wealth 😊

  • @ThinkSoftware

    @ThinkSoftware

    Жыл бұрын

    Thanks for comment 😊. I am looking at various options for that.

  • @heykalyan
    @heykalyan Жыл бұрын

    really liked your crisp explanation

  • @ThinkSoftware

    @ThinkSoftware

    Жыл бұрын

    Thanks 🙏

  • @vikasgupta1828
    @vikasgupta1828 Жыл бұрын

    Thanks

  • @Wheyong
    @Wheyong Жыл бұрын

    regarding adding a field to. tweet table vs like count table, i would choose like count table, the reason is that it will reduce a lot writes/update the tweet, otherwise it could be a performance issue. I would like to hear what you think?

  • @ThinkSoftware

    @ThinkSoftware

    Жыл бұрын

    thanks for the comment 🙂

  • @gmmkeshav
    @gmmkeshav Жыл бұрын

    one corner case that you have not taken up sir what if a person again clicks on the like button to dislike the tweet how will you remove the like?

  • @yjeeeek
    @yjeeeek4 ай бұрын

    13:47 if you use kafka and your consumer manually commit offsets, then after consumer died zookeeper will re-arrange topics and assign the topic to another consumer. new consumer will continue from last comimted offset. considering that, we may want to put all the updates regarding the batch into single transaction, rather than do atomic updates for every tweet.

  • @jlecampana
    @jlecampana8 ай бұрын

    Great video! precisely what's needed for interviews, thank you sir. But I was left with the doubt of what to do If a consumer dies in the middle of processing a like. I guess the answer is that Messages in a queue can be re-tried?

  • @User-nq9ee

    @User-nq9ee

    6 ай бұрын

    yah , data can be retrieved from message queues.

  • @ss_lemonade
    @ss_lemonade Жыл бұрын

    A question about the example sql queries done at 11:20: is the "SELECT ... FOR UPDATE" statement still needed here when the UPDATE query would trigger an exclusive lock on the Tweet_Likes_Count row for tweetId "abcdefghij" anyway?

  • @ThinkSoftware

    @ThinkSoftware

    Жыл бұрын

    Yes because select and update are two different statements so it is possible that multiple threads run select in parallel and get the same value for the count and then all try to update count = count + 1. In this case, they all will change the count to the same value although it may need to be updated to count + X where X is number of concurrent calls coming at that time.

  • @ss_lemonade

    @ss_lemonade

    Жыл бұрын

    @@ThinkSoftware In mysql at least, I believe an update statement that does a query like "count = count + 1" would be atomic. A "select ... for update" would probably help if you needed to do additional work with the selected value afterwards, or if you wanted to update the column manually using the current selected value

  • @ThinkSoftware

    @ThinkSoftware

    Жыл бұрын

    It all depends on DB transaction isolation level. With serializable isolation level, it may work but not with other isolation levels.

  • @gurmeetchawla8362
    @gurmeetchawla8362 Жыл бұрын

    I want to thank you for your video , but i am a bit disappointed at the way you ended the video abruptly. You did not complete the video and close the question in discussion. It seems like you have a paid service somewhere you answer all these questions or are preparing that for future. Kindly share your thoughts.

  • @ThinkSoftware

    @ThinkSoftware

    Жыл бұрын

    I do have a paid service but some of the questions could be topics for more videos.

  • @davidoh0905

    @davidoh0905

    20 күн бұрын

    @@ThinkSoftware yeah overall good start and everything but the last bit was a big disappointment, to be honest :(

  • @davidoh0905

    @davidoh0905

    20 күн бұрын

    kzread.info/dash/bejne/kZZqqNCidc3Pgpc.html This video is a great supplement to the current video!!

  • @szyulian
    @szyulian2 ай бұрын

    Watched. --

  • @shubhamsoni6013
    @shubhamsoni6013 Жыл бұрын

    06:50 A service should be responsible for single task, so we must create a separate service for tweet likes. Assumption is that tweet create service have a less load but tweet like service has huge load so we can scale those services separately

  • @i-am-darshil
    @i-am-darshil2 ай бұрын

    Every tweet will have the tweet_like_count field. Shouldn't we add the tweet_like_count field to the existing Tweets table? What are the pros of creating a new table?