RabbitMQ vs Kafka | Trade-off's to choose one over other | Tech Primers

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 94

  • @manojBadam
    @manojBadam 3 роки тому +40

    Thanks for the nice video. I'm new to rabbitMq couple of questions to understand it better
    1. What happens in RabbitMQ if all the consumer apps are down? will the queue persist the message until one of the consumer comes online?
    2. In rabbitMQ, how does broker knows about the eventType? does it read the. payload or there are any headers to define the eventType?
    3. If i were to have a blue-green deployment model for my consumer apps. Can we define smart rules in rabbitMq broker to send events to blue or green stack dynamically ?
    4. If my rabbitmq queue consumer died during the processing, can another consumer re-process the same message ?

    • @TechPrimers
      @TechPrimers  3 роки тому +55

      Hi Manoj,
      Please find my response:
      1. Yes. Queue does persist and they will keep on pilling messages until the consumer drains the messages out of them.
      2. Usually this is done using the routing key. RabbitMQ uses this key to route to specific consumer queues. Using wildcard, we can easily configure one or more event Type to be consumer in a specific consumer side queue.
      3. Unfortunately, once a message is consumed its drained from the queue. You can have multiple instance of the app to consume from the same queue. that works. But you wont be able to replay the message if something goes wrong in your green instance and you want to roll back. You will have to take care of those messages from your app's end.
      4. There is a Commit message which the consumer has to send to remove that particular message from the queue. If the consumer died and did not send commit for a particular message, then yes another consumer can re-process the same message

    • @manojBadam
      @manojBadam 3 роки тому +4

      @@TechPrimers Thank you so much.. really appreciate your time. I see some similarities between rabbitMq and AWS SQS.

    • @TechPrimers
      @TechPrimers  3 роки тому +4

      Not exactly but sort of. If you merge SNS with SQS you can get routing features. :)

    • @samiullahk7223
      @samiullahk7223 4 місяці тому

      If you use Kafka in small org your financial situation will be like going into icu repair

  • @surenderthakran6622
    @surenderthakran6622 Місяць тому

    We see a lot of comparison videos but most are very shallow and focused on jargons.
    This is one of the videos focused on practical use cases. Nicely done!

  • @cheequsharma7391
    @cheequsharma7391 Рік тому +4

    I was searching about the difference at so many places, but you made the search a full stop. This is no concrete and to the point Explanation. Thanks a lot mate. Subscribed for more. Thanks again , this take a lot of efforts to make such content, much appriciated . :)

  • @devashishrana1637
    @devashishrana1637 Рік тому +2

    Appreciate the video :D
    I think for event distribution in case the events are decoupled you can create two separate topics in KAFKA
    1. TOPIC_EVENT_1
    2. TOPIC_EVENT_2
    Once created, you can create two consumer groups
    1. CONSUMER_TOPIC_EVENT_1_AND_2
    2. CONSUMER_TOPIC_EVENT_2
    Hence, you can add first consumer group to both 1st and 2nd topics, second to only the 2nd topic

  • @tayibahmed6440
    @tayibahmed6440 3 роки тому +9

    In the example at 6:05, you mentioned Kafka would store different event in different partitions - I guess you meant different Topics?

    • @MrXperx
      @MrXperx 3 роки тому +1

      Yeah, I guess he meant topic as well. Partitions for a message is decided on basis of the key provided by the producer and assigned to consumers randomly inside a consumer group.

    • @kps4881
      @kps4881 Рік тому +1

      @@MrXperx Partitions are part of a topic. One topic can have many partitions. If we want to separate events into different partitions for a single topic we can use the event type as the hash key to ensure different event types go into different partitions. This way different consumers of a consumer group can consume different event types from different partitions.

  • @mkbhd2
    @mkbhd2 3 роки тому +9

    Thanks much for putting efforts to explain things in a simpler way as always. I wish you get more viewers/subscribers that what you have right now. Only one suggestion from my end is please try to post more videos. I know it's not easy as I said, as it takes lot of your time. Thanks again!

    • @TechPrimers
      @TechPrimers  3 роки тому +7

      Glad you found it useful Nishanth.
      Viral content is not why I'm here on youtube. :)
      Even if 5 people watch and found it useful and "relevant", thats my success. Thanks for staying connected and providing feedback.
      You should see improvements in frequency and quality soon. ;)

  • @anuragagnihotri5238
    @anuragagnihotri5238 3 роки тому +3

    Thanks for the detailed video. At 07:57 , Kafka has high throughput and highly scalable. What is the comparison with Mb/sec and Req/sec and also what makes RabbitMQ having less throughput is it handling of new messages or storage layer?

  • @BrianStDenis-pj1tq
    @BrianStDenis-pj1tq 3 роки тому +11

    Liked. Well done, and well spoken. Question about your last point on the Kafka limitations about producer coordination regarding partitions. In my experience, producers produce to a topic, not to a partition. And, Kafka evenly distributes the messages across the partitions within the topic. In that scenario, producers don't know or care about how many partitions there are. Are you referring to a mode where producers specify or know about the partitions?

  • @haleemafatima2565
    @haleemafatima2565 Рік тому +1

    You've an excellent understanding Sir! Thank you for simplifying this

  • @chitthiaayeehai
    @chitthiaayeehai 3 роки тому +7

    I have not worked on RabitMQ just have done a few pocs, but Kafka hands down is the most powerful tool i have seen in my career. Spring gives out of the box integration with Kafka and u can plan ur fill application on these two monsters. Kudos !!! to u dude as always :-)

    • @TechPrimers
      @TechPrimers  3 роки тому +12

      Yes can’t agree more. Unknown fact: RabbitMQ also is owned by Pivotal which own spring 😁

  • @CyberGenious24
    @CyberGenious24 Рік тому +1

    definitely a good comparision for a beginner to understand . thank you very much for your efforts.

  • @sagartyagi2450
    @sagartyagi2450 3 роки тому +2

    About the coupling n decoupling part...how about using consumer groups?

  • @abhilash438
    @abhilash438 3 роки тому +4

    very well explained. You are really doing a wonderful job. These videos help a lot in understanding the concepts. I wish you good health and lots of success.

    • @TechPrimers
      @TechPrimers  3 роки тому

      Thank you abhilash. Glad it's helpful

  • @mayurdugar03
    @mayurdugar03 2 роки тому +1

    Thanks man! concisely put.

  • @messi173xpi
    @messi173xpi 3 роки тому +1

    and what is better with Kafka, 1rst or 2nnd option?

  • @alejandropereira
    @alejandropereira 3 роки тому

    I think the example for RabbitMQ in the 10:40 minute is not right. You mentioned that "Sales & Inventory" sends the "order.cancelled" and can be consumed by "billing" and "fulfillment". But, isn't that RabbitMQ cannot replay messages? My understanding says to me that if, for example, "billing" reads the event order.cancelled, then "fullfullment" will miss the message since is not going to be there anymore.

    • @deepanshu_bansal
      @deepanshu_bansal 3 роки тому +1

      i also have same doubt unless we use a dead letter queue for it form where replay is possible.

  • @bautistabaiocchi-lora1339
    @bautistabaiocchi-lora1339 3 роки тому +1

    thanks for the video, its exactly what I was looking for.

  • @s8x.
    @s8x. 4 місяці тому

    isnt rabbitmq more suitable for high throughput stuff since it can prioritize messages?

  • @HariHaraKumar88
    @HariHaraKumar88 3 роки тому +5

    Thank you for your continues efforts to educate others.

  • @sukanya4498
    @sukanya4498 2 роки тому +2

    Good example ! 👍🏼

  • @haroldmurillo5165
    @haroldmurillo5165 11 місяців тому

    Hello! Which one would you use in a case where changes in a specific field in an Oracle database table need to be captured (Change Data Capture) and forwarded to a push notification system like Firebase? Any advices will be appreciated. Thank you.

  • @chilukabharath4809
    @chilukabharath4809 3 роки тому

    the point what i am searching for 3:22 to 3:44 thank you!...

  • @mallikarjunmannam8225
    @mallikarjunmannam8225 Рік тому +1

    Very nice explaination

  • @rhexcasas8452
    @rhexcasas8452 3 роки тому +1

    Thanks nice video. Easy to understand.

  • @invalidred
    @invalidred 3 роки тому

    Kafka has topics and topics have configurable amount of partitions, not sure what the video said regarding partition wrapping events, sounds technically incorrect. Also rabbit mq can be durable.

  • @harbaapkabaap2040
    @harbaapkabaap2040 3 роки тому +3

    Thanks for the nice video! One thing is not clear, what do you mean by "streaming" in kafka? Can you show some messages in action with and without streaming? TCP/IP always streams data, so what do you mean by streaming in kafka? Also RabbitMQ also support pub/sub so the pub/sub example you showed can fit to both the tools.

  • @sriaya1743
    @sriaya1743 3 роки тому +2

    Nice video sir, with spring cloud stream we can configure in a generic way so that we can change from rabbitmq to Kafka and vice-versa.

    • @TechPrimers
      @TechPrimers  3 роки тому

      #Mediator 😁

    • @blasttrash
      @blasttrash 3 роки тому

      what about spring cloud stream?

    • @sriaya1743
      @sriaya1743 3 роки тому +1

      @@blasttrash oops it's cloud stream only...

  • @fdsshhfs
    @fdsshhfs 3 роки тому +1

    Excellent presentation

  • @MA-zo6tb
    @MA-zo6tb Рік тому

    Very good background. However I think it comes to the scenario you presented (good choice of scenario), the options presented are NOT close to real world scenarios being implemented. If someone is doing that, they don't understand the cost and technical implications from choosing either Kafka option 1 and option2. ... It would be good if you can dig deeper into the situations where there is combination, failures, and you are not offloading everything into Kafka.

  • @repotek
    @repotek 7 місяців тому

    Regarding RabbitMQ limitation. RabbitMQ introduced Quorum Queue for streaming

  • @kamalhm-dev
    @kamalhm-dev 3 роки тому +2

    Can Kafka be configured to act like rabbitmq, i.e consuming event only once and will never re-consume previous events?

    • @qh97229
      @qh97229 3 роки тому +2

      Yes, google "kafka exact once consumer"

    • @chilledoutarmix
      @chilledoutarmix Рік тому

      No it cannot. Apache Pulsar would be a better option for this

  • @digisecureagent7679
    @digisecureagent7679 3 роки тому

    In 6:02 you can't guarantee which event goes to which partition in Kafka, so you may also have event 1 and event 2 in partition 2
    The default is round-robin fashion when key is not set, once can use specific client implementation that sets the partition, so it is not possible to do it via producer-console

  • @babe2274
    @babe2274 3 роки тому +3

    Thanks for the very well summed up video. Here are few queries for me
    1.Since kafka is cluster, we have high availability.Is there a way of having high availability for Queue?
    2.If kafka is down for a while,even with 1 broker,it can get all messages from the saved files of local system ,is it possible to recover mssgs if quqe is down for a while ?

    • @kps4881
      @kps4881 Рік тому

      RabbitMQ also supports clusters for HA.
      Rabbit MQ also has persistence. So if a broker goes down and comes back up it can pick up the messages from the persistent store and start processing them.

  • @1225maddy
    @1225maddy 3 роки тому +1

    Need little more info. Where you said rabbit mq has smart broker and Kafka does not any rules at the broker

    • @TechPrimers
      @TechPrimers  3 роки тому

      If you see the example i explained in between, where app2 can have separate queue with its own event topics. That’s what i mean by smart broker with routing rules

    • @1225maddy
      @1225maddy 3 роки тому

      Thank you.

  • @stiffyBlicky
    @stiffyBlicky 2 роки тому

    Does RabbitMQ have some form of persistence?

  • @akshay151993
    @akshay151993 3 роки тому

    Why can't we use RabbitMQ for a streaming use case?

  • @nghiaminh7704
    @nghiaminh7704 Рік тому

    I still can't find any reason to not use Kafka. Not that I'm biased towards it, I'm actually trying to find a use case that Kafka doesn't fit but other message queues do. But the reasons listed here and elsewhere don't satisfy me.

  • @auroshisray9140
    @auroshisray9140 2 роки тому +1

    Thank you !!

  • @dreamcode4204
    @dreamcode4204 2 роки тому

    My instinct tells me for the sample study case, Kafka option 1 is the best. Agree?

  • @sanjaykumardash
    @sanjaykumardash 2 роки тому

    Can you please share the PPT

  • @alirezanet
    @alirezanet 3 роки тому

    In a scenario where we have multiple publishers and a single consumer (2type of events only) what is your suggestion? Kafka or rabbitMQ or neither one just something like grpc.
    I am researching to choose a good tech for Log gathering system. we have a lot of loggers and the server should store all logs in the database.

    • @TechPrimers
      @TechPrimers  3 роки тому

      For log gathering, kafka is the best choice. Infact kafka got created as a steaming log platform

  • @royalbhati7837
    @royalbhati7837 3 роки тому +1

    How are topics in Kafka different from Queues in RabbitMq?

    • @TechPrimers
      @TechPrimers  3 роки тому +5

      In theory both are more or less the same. However, Queues once drained, you cannot get the messages back. But in Kafka, you can get the messages if you have them retained. Kafka uses consumer groups to differentiate different consumers. RabbitMQ uses Queues to segregate consumers. This mean each consumer can get their own copy of messages (in both these platforms)

  • @suhassuvvi5777
    @suhassuvvi5777 3 роки тому +1

    Nice video..We have one use case of using both queue and message streaming Platform..Since Kafka provides smart consumer and doesn't provide queue capability..so we are in process of deciding azure event hub for streaming and azure service bus for queue..But we are also thinking for an option of apache pulsar since it it heavy and not widely used,,we are not thinking for it..What is your suggestions for this use case please? Highly appreciate your response..

    • @TechPrimers
      @TechPrimers  3 роки тому

      Thanks for sharing Suhas. Can you elaborate more on why you need Streaming/Queue both? Any specific reason/requirement?

    • @suhassuvvi5777
      @suhassuvvi5777 3 роки тому

      @@TechPrimers Thanks for the response.. We need Kafka for high throughput requirements and we need queue to have large no queue for customer specific.

  • @manikantamaddipati1090
    @manikantamaddipati1090 3 роки тому +1

    Can you plz make a video on what the meaning of streams

    • @TechPrimers
      @TechPrimers  3 роки тому

      Yes Mani, I did it already. Check it out here - ua-cam.com/video/A3Mvy8WMk04/v-deo.html

  • @shivangitomar5557
    @shivangitomar5557 3 роки тому

    Great video,
    I had a question, how would you decide between choosing rabbitmq with multiple queues vs rabbitmq with direct exchange (where we can specify routing keys)?

    • @ricardotrejoruiz5776
      @ricardotrejoruiz5776 2 роки тому

      Rabbit is mostly used for doing async services inside the microservice ecosistem (same subnet or namespace in kubernetes) with multiple queues. Between ecosistems (different subnets) is where rabbitmq topics are used. Remember inside the same ecosistem using topics increase the amount of compute you need and the risk of crash

  • @ashutoshpanda3252
    @ashutoshpanda3252 3 роки тому +2

    Thnx bro for ur efforts to help us with latest trends in technologies.
    Would be great to have some career based video in IT.
    ♥️♥️♥️♥️♥️Luv ur work... Keep it up bro.

    • @TechPrimers
      @TechPrimers  3 роки тому +2

      I'm just another developer like you Ashutosh. :)
      If i create career based videos, it will digress from the channel's core ideology of learning new Technologies.
      Appreciate you requesting it.

    • @ashutoshpanda3252
      @ashutoshpanda3252 3 роки тому

      Agree bro !

  • @maplebob23
    @maplebob23 3 роки тому +3

    What’s the easiest I
    One? The most human friendly? That’s all I care about.

  • @nbktube1171
    @nbktube1171 3 роки тому

    Rabbit can also be configured to be durable... don't know why you ignored that?

  • @B-Billy
    @B-Billy 3 роки тому +1

    Thank you very much....

  • @guidogranobles
    @guidogranobles 2 роки тому

    Thanks for your effort creating and sharing this video. Why do you say that RabbitMQ only works with push based approach ?, as far as I know RabbitMQ supports pull based approach too.

  • @EtzMe
    @EtzMe Рік тому

    Great.

  • @ShariqueMasoodplus
    @ShariqueMasoodplus 2 роки тому

    RabbitMq support both pull and pushed

  • @Truformable
    @Truformable 3 роки тому +1

    I liked this video not only because it is straight to the point made, but also because there were 666 likes and this number needs to be broken...

  • @jayak3768
    @jayak3768 2 роки тому

    Sorry your explanation does not go the depth of the use cases. For example what do you mean by Rabbit MQ is pub sub kind of model 1:18, then u say used for point to point communication and request response. If it is pub sub it is not point to point, it is publisher publishing to a specific end point with many subscribers consuming from it. So u need to elaborate on than that before moving on.
    Similarly u need to explain how smart broker works for routing the traffic in Rabbit MQ. Kafka has topics, and brokers, so what do brokers do in KAFKA, they do not route the messages/traffic.

  • @vijayjayaram606
    @vijayjayaram606 3 роки тому +1

    Somehow my thinking does not go beyond kafka
    Opinionated

  • @surajpr2521
    @surajpr2521 2 роки тому

    At 6min, I believe consumer cant tell kafka I read messages only from specific partition.

  • @ramiworkstation
    @ramiworkstation 6 місяців тому +1

    You said the word "LEVERAGE" so many times. you almost LEVERAGED everything. nice video though 👍

  • @rishiraj2548
    @rishiraj2548 2 роки тому

    👍

  • @rajatmishra9993
    @rajatmishra9993 3 роки тому

    Rabbit MQ should not be used. It has concept of back pressure. My organization migrated all the things from RMQ to Kafka.

  • @niranjanyadav6454
    @niranjanyadav6454 3 роки тому +1

    🥰

  • @igorshingelevich7627
    @igorshingelevich7627 2 роки тому

    Is there any "no indian education filter" in UA-cam search?

  • @ziadirida
    @ziadirida 9 місяців тому

    Not correct

  • @niranjanyadav6454
    @niranjanyadav6454 3 роки тому

    first to like comment

  • @desh_videsh_story
    @desh_videsh_story 7 місяців тому

    Bhai agar padhna hota to pdfs se padh lete thoda samjhao acche se