What is a Message Queue and When should you use Messaging Queue Systems Like RabbitMQ and Kafka

Поделиться
HTML-код
  • Опубликовано: 25 дек 2024

Комментарии • 156

  • @asadjivani4074
    @asadjivani4074 3 года назад +33

    What really exemplary about your videos is that you first explain the need and then explain the tools, keeping "necessity is the mother of invention" intact.

  • @karthikeyansrinivasan52
    @karthikeyansrinivasan52 4 года назад +116

    2020 is not all bad..... we learn a lot from your videos. Thanks for being there for us.

    • @hugopfeffer4175
      @hugopfeffer4175 3 года назад +2

      Extend this comment to 2021. I have tons of content at my disposal from my company but still come back to youtube for some basic stuff. I love this!

    • @geekyprogrammer4831
      @geekyprogrammer4831 Год назад

      This comment aged bad. All IT professionals are in trouble atm

    • @larbiishak1974
      @larbiishak1974 4 месяца назад

      Extend this comment to 2024 .. High Valuable content

  • @Rxlochan
    @Rxlochan 4 года назад +116

    You have a wonderful passion for Software Engineering. You just pulled me into this awesome ocean of software engineering. I'm super addicted to you channel. I've been watching all you videos continuously. Thank You🙏

    • @hnasr
      @hnasr  4 года назад +10

      Ravilochan thank you for beautiful words 😊

    • @MsBijay007
      @MsBijay007 3 года назад +1

      @@hnasr i don't know why but it feels like you made your videos just for me, that you are explaining only to me....what i mean by that is that your videos ware not made just for the sake of covering a topic and upload to youtube....you really care a lot to make sure your viewers understand the concept you are talking about...very personal touch in your videos...as a self-taught frontend developer, videos like this help me understand the backend stuffs in a more frienddly way and feel less like a imposter...you are awesome and keep doing this hussain :) thank you very much !!

  • @dprophecyguy
    @dprophecyguy 4 года назад +41

    I am overwhelmed by the amount of the number of videos you post. I just found out your channel and it seems everything you post is essential for learning. So from today, I have decided to just watch any video you post as soon as possible to keep up with you.

  • @tejsingh1970
    @tejsingh1970 4 года назад +7

    Best RUclips Channel for almost every concepts in backend

  • @levonsarkisyan8389
    @levonsarkisyan8389 4 года назад +7

    One of the most brilliantly simple explanations on RUclips. Thanks a lot, Hussein!

    • @hnasr
      @hnasr  4 года назад

      ❤️

  • @bubbyprime
    @bubbyprime 3 года назад +2

    The way you explained this was extremely clear. I just landed a new job as a software engineer and the technology this company uses is Kafka. I took a messaging queue as something literal to actual messages. This makes a lot more sense now.

  • @skylarkerzner8486
    @skylarkerzner8486 4 года назад +22

    Love your teaching style Hussein. I enjoy you always making it a fun experience -- it allows me to consume more educational content without feeling exhausted. I also really appreciate your commentary on opinions and habits of engineers around each video's topic, and your comparisons between different technologies -- it adds more context and useful information that you can't find in other educational content. Thank you for making these videos, and best wishes to you!

    • @hnasr
      @hnasr  4 года назад +3

      Skylar Kerzner thank you Skylar! I am so happy you are enjoying the content dear. 😊

  • @monishkamble9066
    @monishkamble9066 2 года назад +1

    I was wading through "JMS" search results on RUclips and stumbled upon your video. And to my luck I found (a gem) somebody who explains concepts with such an enthusiasm.
    This is the first time I am subscribing to a channel just by watching it's first video itself.

  • @prabinlamsal74
    @prabinlamsal74 Год назад

    With the power of this one video, you have become one of my favourite people on the internet.

  • @azr_sd
    @azr_sd 4 года назад +2

    I recently implemented a simple queue system in mysql and php. I store all the jobs in a table with all the data I need. And then for each kind of job I have written python script to perform the job.
    It sends emails to the users, developed api's for dashboard where user can see the results,state etc and now me watching this video makes me confident about my solution :)

    • @hnasr
      @hnasr  4 года назад +2

      This is cool!!! your design is very simple and elegant for your use case

    • @navjot7397
      @navjot7397 3 года назад

      Interesting, but sending an email doesn't look like very heavy task, why do want to add extra latency in db read and writes? and also, have you compared the performance to a simple processing?

    • @azr_sd
      @azr_sd 3 года назад

      @@navjot7397 actually here job can be anything from pdf files generation to web crawling etc iam sending email notifications regarding job status an built a dashboard on top my db to show the status of the job.

    • @navjot7397
      @navjot7397 3 года назад

      @@azr_sd got it. cool mate

  • @kalmanjudin1336
    @kalmanjudin1336 Год назад

    Nice! This method of consuming knowledge through a "virtual talk" is the next level. Entertainment and experience in one box!

  • @KennethKJM
    @KennethKJM 2 года назад

    thanks hussein for the video! i didnt understand message queues at first, but you literally covered all my questions in this video.

  • @realohh
    @realohh 5 месяцев назад

    Have been learning Networking, backend and database from you on Udemy. It has been a great journey until now. Love your content

  • @psionski
    @psionski 3 года назад

    When you said “think whether you need a queue”, I actually did, and realized I don’t! I thought of a much simpler solution, thanks to that intro, LOL :D

  • @smonkey001
    @smonkey001 3 года назад +4

    If you wanna do a "instant" response with a standard REST, well, return first and do the heavy job after.

  • @arunkumarkc5006
    @arunkumarkc5006 3 года назад

    My All-time favorite channel !!

  • @amitkumargouda1768
    @amitkumargouda1768 2 года назад +1

    Really appreciate how you explain complex topics in an easy way.

  • @manasyadav2910
    @manasyadav2910 3 года назад

    I always feel like first liking the video and then start watching it. This channel is the greatest i have seen so far

  • @cowsauce9099
    @cowsauce9099 3 года назад +1

    Not exactly what I was looking for, but the explanation was so clean and clear that I stuck around for the whole thing! Great video!

  • @rajnesingh123
    @rajnesingh123 2 года назад

    What a lovely way to explain Hussein , right to the basics and answering the fundamental question , WHY ??

  • @ankitaburman5406
    @ankitaburman5406 Год назад

    5 mins in the video , I immediately subscribed

  • @nelsonbravo7971
    @nelsonbravo7971 3 года назад +1

    Excellent video, We need more of this kind of videos help to decision making, identify and understanding the problem then analyze what tech/method can solve or minimize the problem.
    also finally understood the difference of queue and pub/sub 10:52 .
    thanks for share your knowledge.👍

  • @JanacMeena
    @JanacMeena 3 года назад

    Whoa, I'm reading the same book on your shelf- Made To Stick!

  • @abdalrhmaahmed342
    @abdalrhmaahmed342 3 года назад

    little people nowadays can illustrate these topics in laymen terms, keep going

    • @hnasr
      @hnasr  3 года назад

      Thanks 🙏

  • @atticus2581
    @atticus2581 2 года назад

    That answered lots of questions I had, and some I didnt have but should have had as well. Well done and thank you, subbed!

  • @henryowenz
    @henryowenz 2 года назад

    At the end you mentioned that the web server
    should not process your request, it should just
    respond. My question is, what are the other options
    a developer should use to process request/data?
    Should it be another server/service that the web
    server then makes a API request to? Or maybe the
    web server then connects to a message broker and
    sends the data as a job to a server/service that just
    handles processing the data for that specific job? I
    know this video is from 2 years ago but the
    information is timeless, thank you for all the content
    you've created for the community!

  • @HappyBaby_99
    @HappyBaby_99 2 года назад

    I love how you explain concepts.. new fan!

  • @MarcoAZeballosS
    @MarcoAZeballosS 2 года назад

    Awesome content and explanation as always, thanks Hussein

  • @acromos
    @acromos 6 месяцев назад

    Exactly what i was looking for 👌🏻. Thnaks

  • @stiffer_do
    @stiffer_do 3 года назад

    Amazing video Hussein! Thanks for sharing!

  • @tristheflash6928
    @tristheflash6928 8 месяцев назад

    I really respect you and appreciate your valuable insights. Thank you very much for sharing your knowledge.

  • @ruhankhandakar
    @ruhankhandakar 4 года назад +4

    Man you just awesome.. I wish you had a full fledged backend course..

    • @hnasr
      @hnasr  4 года назад +4

      Thanks Ruhan. I don’t even think it’s possible to make such course. Backend engineering is a continuous learning process and can’t be learned in an hour or two. Check out my playlist ruclips.net/p/PLQnljOFTspQUNnO4p00ua_C5mKTfldiYT

  • @ahmedelgaidi
    @ahmedelgaidi 2 года назад

    Good explanation
    I started to love the system design stuff.

  • @miguelmalcolm2171
    @miguelmalcolm2171 3 года назад

    I can't tell you how many times I've circled back to Big O notation and it still escapes me - 7:32 Great video.. thanks for sharing

  • @ArunPanchareddy
    @ArunPanchareddy 4 года назад +1

    Thank you 👍🏽 this clears conceptual and architecture views

    • @hnasr
      @hnasr  4 года назад

      My pleasure Arun!

  • @jonathanorrego6199
    @jonathanorrego6199 2 года назад +1

    Actuallty NodeJs has more than one thread... because the event loop uses libuv and kernel primitives for the event loop. Resulting in more than one thread... it can take all the multithreads of your machine for async.

  • @mind77749
    @mind77749 4 года назад +1

    one more video consumed! awesome!

  • @serhiihorun6298
    @serhiihorun6298 3 года назад

    I’ve started to press like button before watching

  • @lukaspabijonavicius6890
    @lukaspabijonavicius6890 3 года назад

    You are amazing! The explanation is so clear! :D

  • @gnarfish5555
    @gnarfish5555 2 года назад

    I love your explanation. I’ve been moving to backend development and these things or issues I am seeing a lot

  • @dev-playing-gt
    @dev-playing-gt 4 года назад

    If there were some visual resources, I would understand more easily but this also helped me a lot!

  • @akrambensouici4129
    @akrambensouici4129 4 года назад +1

    what an amazing explanation thank you very much

  • @fahadnoor2579
    @fahadnoor2579 2 года назад +1

    Thank you for an awesome explanation. But yes as a norm after a perfect explanation and understanding questions arise. So my question is if we use RabbitMQ / Kafka for long processes it will use the same server resources right ? Then why not we use async requests to do so ? I mean it will work in same way right that it won't halt your second request but still be working on first request on same time? Another question is why we use RabbitMQ / Kafka but not Hangfire ? Please help to understand the differences with a simple example. May be it will be helpful for others. Thanks

  • @hnaveediqbal
    @hnaveediqbal 4 года назад +4

    Please make a video on eventsourcing, how they are related or different from message queues. I am confused with it. TIH

  • @vibekdutta6539
    @vibekdutta6539 4 года назад

    You are awesome, though you only know about technology and not about algorithms, but hey, your videos are fabulous, totally became a fan!

    • @hnasr
      @hnasr  4 года назад +3

      Thank you 😊 correct I have many limitations one of them are algorithms another thing is frontend dev. Glad you are enjoying the content ❤️

    • @vibekdutta6539
      @vibekdutta6539 4 года назад

      But knowing technologies is a great thing too, the one I lack, that's why your videos are so awesome, the one in which you've explained the OSI model is fantastic, what the actual fuck you talked about, no one literally never taught it so elegantly. Thanks! M just an undergrad hahahah!

  • @ramvarma8588
    @ramvarma8588 4 года назад +2

    Could you please make a video on kafka? Explaining about brokers and how fast can we process data and performance perspective?

    • @hnasr
      @hnasr  4 года назад

      ram varma its your lucky day 😊 Apache Kafka Crash Course
      ruclips.net/video/R873BlNVUB4/видео.html

  • @semu8143
    @semu8143 4 года назад

    Man, you are amazing, I can't thank you enough for posting these videos and making technologies such as RabbitMQ and Kafka that were giving me and incredible hard time so approacheable!

  • @muralidhar40
    @muralidhar40 3 месяца назад

    Hussein, love you man, from India

  • @bd3723
    @bd3723 4 года назад +2

    Thank you for this explanation. Took a few videos to find this one! Great examples. Figuring all this stuff out when new to this field has definitely been a steep climb. Definitely needed this.

  • @erensrtky
    @erensrtky 4 года назад +2

    I am stuck at last part you talking about web server doesn't calculate anything, its just response to incoming request but if web server did not calculate who do that :) I know its weird question but im not a experienced developer.

    • @hnasr
      @hnasr  4 года назад +3

      No it is actually a very important question! Another service can be responsible to do the actual work. You make a request, the web server accepts it and writes it to the queue, and responds back to the client. A service talks to the queue and consume the work and do the heavy work and takes 1 hour or so and writes it back to the queue.
      Here is an example Illustrated here Publish-Subscribe Architecture (Explained by Example)
      ruclips.net/video/O1PgqUqZKTA/видео.html
      That being said I if your requests can be processed quick your webserver can server that traffic. Its all a game of trade off. Only use a tech when you absolutely need it

    • @erensrtky
      @erensrtky 4 года назад

      @@hnasr Thank you for good explanation, i have project ideas needs to has multi services, they are not gonna be a simple crud aplication so your videos will give me aspirations to build that projects, thank you again.

  • @lachinmark9151
    @lachinmark9151 4 года назад +1

    Great explanation man

  • @sirjansingh310
    @sirjansingh310 4 года назад

    A queue would also help you if the ordering of requests really matters to your system. HTTP communication won't guarantee this because things are asynchronous

  • @goodylili
    @goodylili 2 года назад

    This is really great
    Please can you make a roadmap based on your channel for beginners, there's really a lot to learn from here but the paradox of choice is really big

  • @20FBC
    @20FBC 4 года назад +3

    Can you guys help me?
    I'm creating a dashboard.
    So, the goal is to work with stats to provide the user an overview of how the things are going for the past months and the other part is to fetch data from the social media to see how the public is reacting to it. Is this a good example to use a Messaging Queue?
    I tried to implement Kafka on windows, using NodeJS. I was able to create a topic, send some simple messages and consume them.
    (I used kafka-node)
    My view (and doubt) about this is: I have my PostgreSQL DB and my node backend API. Will Kafka run in beetwen them?
    I mean, if I want to make a request, first I will subscribe to a certain kafka topic, which will have the ability to connect with the DB and get the information I want. Is that how it works?
    I'm having trouble connecting Kafka to my DB using nodeJS as well.
    I hope I was as clear as possible. Sorry about my english.
    Thanks in advance.
    Greetings from Portugal!

  • @betsegawlemmaamersho1638
    @betsegawlemmaamersho1638 2 года назад +1

    Nice video. I wish you used diagrams to explain the concepts rather than waving your hands.

  • @sumarouno
    @sumarouno 4 года назад

    Nice explanation about queue. Awesome.

  • @devviz
    @devviz 2 года назад

    🌆8pm july 4 2022
    6:44 solution > inform user of a received request using queue, then alert user the request is successful; basically pretend its done while it actually not

  • @DipenHansawala
    @DipenHansawala 3 года назад +1

    Can any one help me to guide what is the best solution for bellow app?
    I want to create a pos system that can sync data on local network.
    i.e. their are 3 pos system on store and all connect on same network. If any pos place any order, that data should be sync to rest 2 pos. And ya also any large data using full sync.
    Should I use ZeroMQ for syncing locally?

  • @khayryazzez
    @khayryazzez 3 года назад +1

    what could be better when creating a chat service (audio and video) =>Web-sockets OR RabbitMQ

    • @hnasr
      @hnasr  3 года назад +2

      Both

  • @raihanulalamhridoy4714
    @raihanulalamhridoy4714 3 года назад

    Thank you for the explanation. You should use a graphics tablet. It is well understood when you draw while explaining.

  • @sanjeevdiitm
    @sanjeevdiitm 4 года назад +2

    Your could have explained using block diagram, leaving the video in between

  • @ericndirangu5758
    @ericndirangu5758 4 года назад

    If your process is indeterministic, long running or resource hungry ... Thanks Nasser

  • @ayusharyal6346
    @ayusharyal6346 3 года назад

    So should I learn it just for the sake of knowing it, or just wait until its a necessity in a project ?

  • @Douglas_Gillette
    @Douglas_Gillette 2 года назад

    Great video. FYI There is a low hum on your audio.

  • @WeekendStudy-xo6lq
    @WeekendStudy-xo6lq Год назад

    Can queue can also help with being losseless? If server fails handling the request he lost it but if it was in some queue maybe they can help how?

  • @chrispure7461
    @chrispure7461 2 года назад

    Great. Wondering, when to go for MQ's like AMQ, Rabbit vs Kafka?

    • @hnasr
      @hnasr  2 года назад

      Good rule of thumb is when requests are naturally long running for synchronous workload. I gave example with compression or copyright check

    • @chrispure7461
      @chrispure7461 2 года назад

      @@hnasr Thanks. I mean for async applications, how to choose MQ like between RabbitMQ vs Kafka. If you have covered this already in a different video, I can check that out.

  • @wassim5622
    @wassim5622 4 года назад +1

    great video hussein, can you please explain to me the difference between message queues and message broker

    • @hnasr
      @hnasr  4 года назад

      wassim queues are the actual data structure, broker is the queue manager. Clients talk to message broker that writes and reads from the queue

    • @wassim5622
      @wassim5622 4 года назад

      @@hnasrunderstood! thanks hussein

  • @chlebasmaslomasalamou
    @chlebasmaslomasalamou 4 года назад

    But how will the client on frontend find out that computation is done ? Should client do every x seconds GET request to get actual state ?

  • @stefanpgr
    @stefanpgr 3 года назад

    awesome!! One question tho, I want to build a platform for a nationwide grocery store, queuing system is a good choice, right?

  • @senior_java
    @senior_java 3 года назад

    Please, make a video on the newest RabbitMq feature Streams.

  • @romantsyupryk3009
    @romantsyupryk3009 4 года назад +1

    Thanks so much for this video tutorial.

  • @InstituteofConceptualPhysics
    @InstituteofConceptualPhysics 3 года назад

    Excellent. Use diagrams too. 🙏🙏

  • @vaibhavjain3906
    @vaibhavjain3906 4 года назад +1

    Hi Hussein. Great Video as always. Just a side question - How do you make these beautiful thumbnails? Any special software?

    • @hnasr
      @hnasr  4 года назад +2

      Thanks Vaibhav! Ye I use Canva , I am really bad at photoshop

  • @ezenwatadestiny2881
    @ezenwatadestiny2881 8 месяцев назад

    Thank you so much ❤

  • @user-rp9iis1en6h
    @user-rp9iis1en6h 4 года назад

    Hi Hussein,
    Thanks for the tutorial. One thing that is confusing me, is MQ is just another layer that could be fit in front of the existing API or we have to implement MQ at the very beginning stage of the development?
    What i meant is, suppose I have developed an api that works using request, response model and after some days due to heavy usage and heavy load application can't serve consistently so I want to implement MQ on the top of existing application. Is this sounding a good?
    And also please clarify, suppose My api have two endpoints, one- send email, two-receive email. So, i can create two copy of my application and in RabbitMq i can create two queues, for send email queue, i can bind it with copy1's send email method and for received email queue i can bind it to copy-2's receive email method. Is this how it should be done?

    • @hnasr
      @hnasr  4 года назад +2

      Moving from request/response to a queue is a big task. I think you should anticipate that load and design your application in that way. Alternatively you can have sync vs async endpoints and route your clients accordingly

    • @user-rp9iis1en6h
      @user-rp9iis1en6h 4 года назад

      @@hnasr Thanking again for your prompt response. That clarifies all of my confusions.

  • @liquidcode1704
    @liquidcode1704 2 года назад

    The reasons software exists on the backend:
    1. The reason is to piss me off
    2. The problem it solves is, I am perfectly happy and having a wonderful day, but that isn't acceptable!

  • @jyotisaxena9014
    @jyotisaxena9014 2 года назад

    Cool... U explained it

  • @yahyaensa
    @yahyaensa 3 года назад

    Hello @Hussein Nasser.
    I realy love your channel, i don't know how i never saw it before, thanks a lot for your great content !
    Just one question, in the case you are talking we can still use just a normal Database to save the jobs that we need to run, it still dosen't explain why the need of a message queue on top of database.

  • @HannesTschofenig
    @HannesTschofenig 4 года назад

    It is wonderful if you believe that all technology exists for a reason. Ever heard about the not-invented-here probloblem?

  • @alittlebyte
    @alittlebyte Год назад

    Why would you want to use a queue if you are using serverless (i.e. Cloudflare Workers with Cloudflare Queues)

  • @headlinerbeats
    @headlinerbeats 3 года назад

    Whats the difference/benefit over something like socket io ?

  • @ayoubhr77
    @ayoubhr77 3 года назад

    Assalamu 3alaykom Hussein, good content, i have a question tho. Whats the difference between the asynchronous nature of something like nodejs and a messaging queue system like RabbitMQ?

  • @DF-ss5ep
    @DF-ss5ep 4 года назад

    Great video. But according to your definitions, Kafka is more like a pub-sub system than a queue.

    • @hnasr
      @hnasr  4 года назад +1

      Daniel Fazeres Correct Kafka is a Pub/Sub system that can be configured to act like a queue with consumer groups. RabbitMQ is a message queue that can be configured to be a pub/sub system with exchanges.

  • @tarunstv796
    @tarunstv796 3 года назад

    "Request is indeterministic" and "process is by nature long running"
    Doesn't these two points eventually mean same thing?

  • @metrocartao
    @metrocartao 4 года назад +1

    well explained!

  • @zidanbadr1658
    @zidanbadr1658 Год назад

    that's amaaaizing 😂😂😂

  • @vim55k
    @vim55k 4 года назад +1

    Should be also in the message queue playlist?

    • @hnasr
      @hnasr  4 года назад +1

      Thanks for helping me organize the content 😊

    • @vim55k
      @vim55k 4 года назад +1

      @@hnasr no problemos

    • @vim55k
      @vim55k 4 года назад +2

      Helps me, helps you. Something small that I can do to thank for your great investment

  • @hellowill
    @hellowill 2 года назад

    Kafka is more pub/sub streaming ('reactive') than a queue like AWS SQS

  • @virajsingh8865
    @virajsingh8865 4 года назад

    Can you also talk about message and task queues?

  • @mubeenali5972
    @mubeenali5972 4 года назад

    thank you very much for talking about queues. can you give an openion about sleeping workers in a queue. in my case, it is not cpu bound. i have to call an api periodically to check for a specific transaction status. so i didn't go for rabbit mq or any other packages.
    i used gevent greenlets as workers. will it cause any cpu usage issues when worker count increases?

    • @hnasr
      @hnasr  4 года назад

      Mubeen Ali hey Mubeen, from reading online about greenlets( first time I know about if) it seems its just multithreading or multiprocessing system for a single node) so I don’t think it give the power to scale horizontally like a fully fledged message queue system like rabbitMQ

    • @hnasr
      @hnasr  4 года назад

      Again this is perfectly fine on a small system and you can go very far with a single instance with multi processing) keep it simple is my moto

    • @mubeenali5972
      @mubeenali5972 4 года назад

      @@hnasr thanks for the openion. now i can work on more options

  • @srujanbelde7178
    @srujanbelde7178 4 года назад

    Your explanation is very good but hard to visualize. It would be great if you can write or draw as you speak.

  • @mojalefatsoaeli4367
    @mojalefatsoaeli4367 4 года назад +2

    Thank you!

  • @mohitsoni3819
    @mohitsoni3819 Месяц назад

    Nice explanied sir

  • @ruixue6955
    @ruixue6955 3 года назад

    1:43
    3:33 problem: 3:42

  • @chandanga28
    @chandanga28 2 года назад

    Why do you say GRPC is stateful ?

  • @000ahamed
    @000ahamed 3 года назад +1

    Hey man, What's with you and reverse proxy ? Lol, been hearing that phrase in almost all the videos . JK :)

  • @herokim5113
    @herokim5113 4 года назад +1

    who else thinks he is so brilliant but also handsome???

  • @harishmehta2992
    @harishmehta2992 2 года назад

    Excellent

  • @Raaviolis
    @Raaviolis 4 года назад

    Seen it been use a lot for change data capture on etl data engineering side of things