Why and how Trello moved away from RabbitMQ to Kafka for their WebSocket-based real-time updates

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ม.ค. 2025

ความคิดเห็น • 38

  • @shiv-yt-317
    @shiv-yt-317 วันที่ผ่านมา +13

    Great video! Had a question:
    - Doesn't socket master now become a choking point with scale up? The sheer amount of work-to-be-done will increase with every new user subscription.
    - In case we add more instances of socket masters how do multiple socket masters decide which subscriptions to work upon and how is the list rebalanced in case of a scale-up/down?
    I had worked upon a system with a similar problem where we solved it via Leader Election among all nodes and consequent subscription assignment by the Leader node. Curious as to how Atlassian solved this.
    NOTE: Haven't read the actual blog yet where this would already be answered but still posting for the curious minds.

    • @StingSting844
      @StingSting844 วันที่ผ่านมา +2

      The socket master can be turned into a cluster and they all need to have the same copy of mappings. Adding a load balancer in front would solve this since there doesn't need to be a leader in socket master as they just do routing according to mapping

  • @KaruppiahAL-c2j
    @KaruppiahAL-c2j 18 ชั่วโมงที่ผ่านมา +8

    Why can't we do the same with RabbitMQ ? Push message -> read from socket master -> route to client.

    • @AsliEngineering
      @AsliEngineering  7 ชั่วโมงที่ผ่านมา +4

      They were unhappy with Rabbit. Unstable for them, split brain issues, lack of high availability. They wanted to move out.

    • @KaruppiahAL-c2j
      @KaruppiahAL-c2j 2 ชั่วโมงที่ผ่านมา

      @@AsliEngineering Thank you

  • @shubhammittal615
    @shubhammittal615 วันที่ผ่านมา +4

    At around 02:50 you mention websockets pull events from RabbitMQ but isn't RabbitMQ works on push model?

    • @channaveerhakari7319
      @channaveerhakari7319 18 ชั่วโมงที่ผ่านมา

      The Websocket Server resides inside the RabbitMQ Broker(Exchange + Queue + Websocker Server). Since RabbitMQ Broker's Queue and Consumer are connected via websockets, so when Queue recieve messages they are pulled by Websocker Server and pushed to the consumers which are listening to it. Hope it cleared your doubt.

    • @AsliEngineering
      @AsliEngineering  15 ชั่วโมงที่ผ่านมา

      Both are possible. As per the blog, they pulled the data, but you can go push all throughout.

    • @rahulsangvikar7973
      @rahulsangvikar7973 11 ชั่วโมงที่ผ่านมา

      @@AsliEngineering Can you share an official source where it says RMQ also supports pull mechanism? Afaik this is the major distinction between Kafka and RMQ that RMQ is push based and Kafka is pull based.

  • @AnantKumarS
    @AnantKumarS 16 ชั่วโมงที่ผ่านมา +3

    Lot of details are skipped for new Kafka architecture

    • @AsliEngineering
      @AsliEngineering  7 ชั่วโมงที่ผ่านมา +1

      It is simple Pull stuff with no fancy logic. Events pushed, server pulled, filtered, and related to WS server which then uses the mapping of user to WS Connection related further to end user.

  • @sriramkk9004
    @sriramkk9004 วันที่ผ่านมา +2

    Hi Arpit, nice content as always.
    It was also possible that the socket clients could directly become Kafka consumers right? What could be the reason for a socket master in between Kafka and clients?

    • @StingSting844
      @StingSting844 วันที่ผ่านมา +1

      To reduce direct coupling between the event transport system (Kafka) and the client connection system (web socket). This way you'll be able to swap Kafka with any other message broker and the rest of the system don't need to be touched. Plus you can add more capabilities to the socket master for observability and auditing.

  • @soumakpoddar4372
    @soumakpoddar4372 วันที่ผ่านมา +3

    Can the socket master be a single point of failure ?

    • @saurabhjagtap
      @saurabhjagtap วันที่ผ่านมา +1

      Maybe, but I guess it can also be tackled with how you would handle the load balancer's single point of failure, maybe by having multiple socket master nodes available, and keeping one as a master by election method.

  • @arjundontamsetti
    @arjundontamsetti 18 ชั่วโมงที่ผ่านมา

    I didn't get it, now the socket master became a single point of failure, what if the messages were read and error occurred while pushing to the ws server? How do they handle duplicate reads (if the socket master also cluster)?

    • @AsliEngineering
      @AsliEngineering  7 ชั่วโมงที่ผ่านมา

      ofc, if it needs to be scaled beyond a single machine, consider sharding it and each shard handles its own subset of tenants.

  • @ShubhamYadav-df1kc
    @ShubhamYadav-df1kc วันที่ผ่านมา +1

    Why is websocket server pulling all updates instead of only the updates that the connected user is subscribed to?
    9:16

    • @StingSting844
      @StingSting844 วันที่ผ่านมา

      The WS servers are already bound according to the user's topics. So if you are connected, your client will connect to a WS server and that will in-turn connect to all applicable queues. If I'm connected to a different server then your server won't be subscribed to my events

    • @AsliEngineering
      @AsliEngineering  15 ชั่วโมงที่ผ่านมา

      Both are possible. As per the blog, they pulled the data, but you can go push all throughout.

  • @premvishwakarma6409
    @premvishwakarma6409 วันที่ผ่านมา +1

    Hello sir,
    If possible, please do one video on docker architecture.

  • @MrMikomi
    @MrMikomi 7 ชั่วโมงที่ผ่านมา

    What is the socket master written in or running on?

    • @AsliEngineering
      @AsliEngineering  7 ชั่วโมงที่ผ่านมา

      A separate machine that accepts the updates, filters, and relays them to socket servers over TCP (may be an HTTP API, they have not mentioned the details).
      Consider it as a filtering and relaying machine.

  • @kartech11
    @kartech11 21 ชั่วโมงที่ผ่านมา

    Very informative. What tool are you using to write your notes?

  • @kunalbabbar7399
    @kunalbabbar7399 23 ชั่วโมงที่ผ่านมา

    Instead of resolving the message with socket master cannot we create partition in kafka itself? What is primary use of the socket master then in case?

    • @AsliEngineering
      @AsliEngineering  7 ชั่วโมงที่ผ่านมา +1

      Filtering and relaying. This business logic is with Socket master.

  • @__nitinkumar__
    @__nitinkumar__ 18 ชั่วโมงที่ผ่านมา

    Hey Arpit,
    I wanted to share some constructive feedback regarding the audio quality of your content. I believe you have a great microphone (it seems like a Yeti), but there appears to be an issue with the audio quality.
    To me, it sounds like there is an echo. You might want to consider putting some sound-absorbing mesh on the walls. Also there are many AI tools available these days that can tune the audio and even remove construction noise.
    Your content is excellent, and as a long-time subscriber, I feel it's my duty to let you know about this issue. After coming back to the channel after a few months, I really noticed the audio quality problem. If you can fix this, I believe it will significantly boost the overall quality of the content.

    • @AsliEngineering
      @AsliEngineering  17 ชั่วโมงที่ผ่านมา

      Thanks a ton for sharing. Feedback taken. This time it actually sounded really bad. May be because I was recording very late at night.
      I will get some sound absorbing mesh. Thanks for the suggestion.

    • @AsliEngineering
      @AsliEngineering  17 ชั่วโมงที่ผ่านมา +1

      I checked a few websites and found that my mic settings were not ideal and the mic positioning was not ideal.
      I have changed it and the audio will be better the next time. I have recorded one more video, so the next one will also be poor, but subsequent ones will be much better.
      Thanks for the nudge and constructive feedback. It means a ton.

    • @KaruppiahAL-c2j
      @KaruppiahAL-c2j 2 ชั่วโมงที่ผ่านมา

      👍

  • @hritikkumar5065
    @hritikkumar5065 18 ชั่วโมงที่ผ่านมา

    now socket master also becoming a choking point for the entire setup like rmq inbound cluster

    • @AsliEngineering
      @AsliEngineering  7 ชั่วโมงที่ผ่านมา

      Consider sharding it.

  • @shis10
    @shis10 ชั่วโมงที่ผ่านมา

    CPU 2x ?
    Why Cost not gone up ?

    • @AsliEngineering
      @AsliEngineering  นาทีที่ผ่านมา

      lesser. It reduced, and not increased.

  • @lucasterable
    @lucasterable 15 ชั่วโมงที่ผ่านมา

    Some big tech company migrated some piece of software from X to Y. Hurry! Everybody migrate everything to Y now!

    • @AsliEngineering
      @AsliEngineering  7 ชั่วโมงที่ผ่านมา

      Precisely what should not be done. If it works for you, it works for you.