Apache Kafka Crash Course

2024 ж. 16 Мам.
409 114 Рет қаралды

Apache Kafka is a distributed stream processing software developed by LinkedIn and written in Scala and Java.
Chapters
0:00 Intro
2:32 Kafka Broker
5:39 Kafka Producer
7:11 Kafka Consumer
8:34 Kafka Partitions
12:50 Queue vs Pub-Sub
16:47 Consumer Group
23:06 ZooKeeper
29:45 Coding Example
1:02:48 Kafka Pros-Cons
1:17:00 Summary
Download slides here
payhip.com/b/Y0Cq
(Members get all slides for all my video courses for free)
In this video I want to focus on the basics of Kafka, talk about how it works give finally spin up a Kafka cluster and write a producer and a consumer.
Kafka Components
_ producer
_consumer
_topic
_partition
How Kafka works
Example ( Ride sharing )
Spin Kafka cluster
Write a producer
Write a consumer
Kafka Applications
Pros and Cons
Source Code
github.com/hnasr/javascript_p...
Docker commands spin up kafka
//if you ever mess up or you want to start fresh just stop and remove the containers and rerun the command
docker stop zookeeper kafka
docker rm zookeeper kafka
docker run --name zookeeper -p 2181:2181 -d zookeeper
docker run -p 9092:9092 --name kafka -e KAFKA_ZOOKEEPER_CONNECT=husseinmac:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://husseinmac:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 -d confluentinc/cp-kafka
Get my fundamentals of database engineering course link redirects to udemy with coupon applied (database.husseinnasser.com)
Resources
KIP 500 (Remove Zookeeper)
cwiki.apache.org/confluence/d...
Become a Member on KZhead
/ @hnasr
🧑‍🏫 Courses I Teach
husseinnasser.com/courses
🏭 Backend Engineering Videos in Order
backend.husseinnasser.com
💾 Database Engineering Videos
• Database Engineering
🎙️Listen to the Backend Engineering Podcast
husseinnasser.com/podcast
Gears and tools used on the Channel (affiliates)
🖼️ Slides and Thumbnail Design
Canva
partner.canva.com/c/2766475/6...
🎙️ Mic Gear
Shure SM7B Cardioid Dynamic Microphone
amzn.to/3o1NiBi
Cloudlifter
amzn.to/2RAeyLo
XLR cables
amzn.to/3tvMJRu
Focusrite Audio Interface
amzn.to/3f2vjGY
📷 Camera Gear
Canon M50 Mark II
amzn.to/3o2ed0c
Micro HDMI to HDMI
amzn.to/3uwCxK3
Video capture card
amzn.to/3f34pyD
AC Wall for constant power
amzn.to/3eueoxP
Stay Awesome,
Hussein

Пікірлер
  • Check out my fundamentals of Database Engineering udemy course with over 20 hours of deep database systems lectures. Head to database.husseinnasser.com for a discount coupon. Link redirects to udemy with coupon applied.

    @hnasr@hnasr3 жыл бұрын
    • I love it and the way it’s presented! Will announce on LinkedIn when I get my cert. Thanjs for putting this together!

      @markyoshikawa4278@markyoshikawa4278 Жыл бұрын
  • 27:28 answer: Every broker on a Kafka cluster is also named a Bootstrap Server. All brokers have the metadata required for the clients (producer or consumer) to discover brokers. When a client connects to one of the brokers (which are already configured as bootstrap servers in the Kafka configuration) it makes a "metadata request". The response includes information about topics, partitions, leader brokers, etc. Once the client gets this info, then - in the case of a producer- it makes the write request directly to the leader broker for that specific partition.

    @_sr@_sr2 жыл бұрын
    • Thanks for the explanation

      @hakimbencella4242@hakimbencella42422 жыл бұрын
    • This should be pinned. Thank you!

      @matejlaskomulej@matejlaskomulej2 жыл бұрын
    • if all the brokers maintain this metadata then what's the role of zookeeper.

      @HarshJain-lk8cw@HarshJain-lk8cw2 жыл бұрын
    • @@HarshJain-lk8cw The use of zookeeper is that only one leader is there for a partition at any given time by using some kind of lock registry.

      @boobalangnanasekaran3381@boobalangnanasekaran33812 жыл бұрын
    • This should be pinned. Thanks!

      @syedsabeehahmedfatmi1099@syedsabeehahmedfatmi1099 Жыл бұрын
  • One of the best tutorials i’ve seen. Great class and very funny. Subscribed and waiting for more content!

    @stmasanti@stmasanti3 жыл бұрын
  • This was an awesome tutorial. You're incredibly good at explaining things and keeping people engaged when consuming so much information.

    @mikejeffery8371@mikejeffery83713 жыл бұрын
  • Not only the content, but the way you say it, and your enthusiasm, is something else. You sir deserve all the best, because you are, with no doubt, in the better's shelf..

    @eduardotp541@eduardotp541 Жыл бұрын
  • I made it to the end. :P Thank you so much for the amazing content Hussein.

    @MOHDSALMAN-sj2zu@MOHDSALMAN-sj2zu3 жыл бұрын
  • Dude, I made it to the End. You kept us engaged throughout. I have soo much to learn about Comp Sci!

    @asht7290@asht72902 жыл бұрын
  • I just wanted to express my heartfelt appreciation for the amazing Kafka crash course, Your dedication to simplifying complex topics shines through, and I can't thank you enough for making Kafka so much easier to understand.

    @mubashirimtiaz3836@mubashirimtiaz383610 ай бұрын
  • The explanation and illustration is clear and concise! Thanks for the comprehensive tutorial!

    @jasonngan5747@jasonngan57472 жыл бұрын
  • i had to deal with Kafka in one of my project, so searched for some tutorials, As soon as I saw that you have made a video on this, i had a sense of relief that i dont have to worry about the resource atleast. Thanks for all your efforts man.

    @manishbolbanda9872@manishbolbanda98722 жыл бұрын
  • Amazing video! You have the talent to explain the complicated stuff really clearly😊

    @beatagryczka7108@beatagryczka71083 жыл бұрын
  • Your skillset is brilliant, amazing and fantastic. Thank you so much!

    @sy5294@sy52943 жыл бұрын
  • Sweeeeet... did not feel like a tutorial, but like a friendly chat between deeply connected friends, every word makes clear sense. Kept me engaged every second till the end, yes I made to the end. Well done Sire... 👏👏👏

    @ershad003@ershad003 Жыл бұрын
  • Just started watching and already loving it. I wish you a happy new year and hoping to see more great content like this.

    @frontend-ops@frontend-ops3 жыл бұрын
  • Amazing tutorial! Really find the topic interesting and easy to understand broker, producer, consumer etc.. Thanks for coming up with a great video. Hope we will get to see more on this.

    @myviewsmyreviews2001@myviewsmyreviews20013 жыл бұрын
  • Thank you for this, don't know how I missed it

    @93kazem@93kazem4 жыл бұрын
  • Great tutorial as always. Literally a crash course fit into about an hour. Has everything to get started with kafka, especially because of the hands on.

    @bokilsbk23@bokilsbk2311 күн бұрын
  • Excellent practical explanation of Kafka, I wish every technical tutorial was as easy as this. Thumbs up!

    @nihinlola@nihinlola2 жыл бұрын
  • Couldn't learn kafka better in such a short time. Thanks Hussein.

    @nimasoufiloo2626@nimasoufiloo26263 жыл бұрын
  • This is the BEST educational channel!!! Bravo!

    @atexnik@atexnik3 жыл бұрын
  • Amazing, Hussein! Thanks for the overview of Kafka. I've always been a bit afraid of this beast, but now I understand at least the basics

    @ilyakushlianski6519@ilyakushlianski65192 жыл бұрын
  • This is well detailed even for a beginner, I completely understand whats going on. Brilliant content.

    @user-lq7yg5ej1u@user-lq7yg5ej1u9 ай бұрын
  • Another perfect tutorial. Everything is explained very nicely. Thanks for making Kafka easy to understand in this tutorial.

    @aatifbangash@aatifbangash4 жыл бұрын
    • Atif Ali thanks Atif for your support! Happy I could make such complex topic easy to absorb.. still I didnt cover all what kafka has to offer! Cheers

      @hnasr@hnasr4 жыл бұрын
  • Man, you are the best, thanks a lot for creating such valuable content for free

    @ComisarioLobo@ComisarioLobo2 жыл бұрын
  • I rarely comment on videos but this was genuinely one of the best computer science tutorials I've ever seen!

    @satalkar@satalkar3 жыл бұрын
    • Thank you Anish for taking the time to write this appreciate you!

      @hnasr@hnasr3 жыл бұрын
  • I always got demotivated by the complexity I experienced when I tried to learn this on my own but this one is a gem. I know it might have taken a lot of learning and experience for you to explains this in a simple manner Nevertheless thank you for sharing your knowledge!

    @jithin_zac@jithin_zac3 жыл бұрын
    • Thank you Jithin! And Remember to ask in the community to get access to the slides if you would like to since you are a member❤️

      @hnasr@hnasr3 жыл бұрын
  • Really amazing!!! So many concepts explained in an easy and interesting way. Please keep up the great work.

    @abhasupadhayay6420@abhasupadhayay64203 жыл бұрын
  • bro your tone when explaining these videos are so good. Didn't even feel like someone was teacahing me. It was as if a friend was talking to me lol. Good job man. Your excitement is intoxicating. :)

    @rubensingh6809@rubensingh68092 жыл бұрын
  • the simplest and best tutorial ever!! Good Job

    @alishoman2826@alishoman28263 жыл бұрын
  • made it to end. Amazing video. you made Kafka look so simple, and the best part-> you showed a code demo. clap. clap.

    @manishtanwar4803@manishtanwar48032 жыл бұрын
  • Very nice tutorial. Got a clear understanding of Kafka, especially the part of queue, pub sub, very helpful! Thank you so much!

    @linwang7476@linwang74762 жыл бұрын
  • I really appreciate you from my deep of heart for explaining such complex concepts in super simple way, Excellent :)

    @priyaranjankumarverma2341@priyaranjankumarverma23413 жыл бұрын
  • This course is great because of the example. It's much better than some videos in which only some introductions are represented.

    @yuanqingzhang3648@yuanqingzhang36482 жыл бұрын
  • This is explained simply and perfectly. Thank you for posting this.

    @amizan8653@amizan86533 жыл бұрын
  • I made it to the end. Followed every step and it worked nicely. Thank you for the effort... really helpful

    @peternamagonya5310@peternamagonya5310 Жыл бұрын
  • You explain by answering all the questions people get when learning a topic. Most tutorials just explain concepts.

    @a.yashwanth@a.yashwanth Жыл бұрын
  • Really enjoyed this informative session and yeah, made it to the end !!!

    @shubhamchandra336@shubhamchandra3362 жыл бұрын
  • Thank you so much for such a crystal clear and crisp explanation !!

    @atharwaadawdakar4144@atharwaadawdakar41442 жыл бұрын
  • I made it to the end. Thanks for the tutorial, it was very informative and I appreciate your efforts.

    @simonhuang1357@simonhuang13573 жыл бұрын
  • made it to the end, and every detail was fully explained thanks.

    @robbenbahati@robbenbahati21 күн бұрын
  • You are a hero, Hussein. I spent two afternoons with you on this tutorial and it was an absolute pleasure. Thank you!

    @rogergarza5378@rogergarza53782 жыл бұрын
    • Glad you enjoyed it ❤️

      @hnasr@hnasr2 жыл бұрын
  • This is a great video to understand what Kafka is and how it works, very well explained!

    @flippolis71@flippolis71 Жыл бұрын
  • I made it to the End! Thank you for that video, I can now say I understand Kafka a lot better than 1 hour ago :)

    @mutasworld@mutasworld Жыл бұрын
  • Great explanation and overview over the possibilities of Kafka! Looks like a cool technology!

    @mikaeledebro1144@mikaeledebro11443 жыл бұрын
  • The best stuff on kafka . Made it so simple

    @gokulkpeethu6642@gokulkpeethu66429 ай бұрын
  • truly amazing-so simple and incredibly useful. Great job!

    @amirhosseinmoayedi6205@amirhosseinmoayedi62057 ай бұрын
  • This is THE BEST video on this topic. Thanks a lot!

    @shivangitomar5557@shivangitomar55572 жыл бұрын
  • this is the only tutorial i found that go in the depth and details of a pro should know , and i can compare Kafka with other messaging system like JMS and MQ. Thanks so much for sharing👍👏🙏

    @alexsiuwh@alexsiuwh2 ай бұрын
  • I just watched your RabbitMQ crash course and at the end of the video you mention how Kafka better at some point, then I bumped into this great video. Very clear explanation, love your video!

    @luqmansen@luqmansen4 жыл бұрын
    • Luqman S thanks Luqman! Each software its use cases, I think RabbitMQ Is trying to be more than it really is (a message queue) where as kafka was designed to be a pub/sub and a message queue. If your app needs a queue and a pub/sub (or maybe streaming) than Kafka . If you just need a queue RabbitMQ is the way to go and kafka will be an overkill I think.. I would even consider zeromq as a lightweight mq.. Good luck!

      @hnasr@hnasr4 жыл бұрын
  • Thank you for putting in the effort to make a short and clear to understand video.

    @DavidBwire@DavidBwire Жыл бұрын
  • Watched this video in one session, also applied the practice on my machine, what a great content you are creating Hussien, a must rewatch as always 😉

    @nidalshater4027@nidalshater4027 Жыл бұрын
  • You really know how to do tutorials, great video!

    @stefanmiller5818@stefanmiller58182 жыл бұрын
  • I made it to the end. Excellent. I don’t remember which video previously I saw was so long MD not boring at all. In fact you made it so interesting. May Allah (God) guide and bless you.

    @ibknl1986@ibknl19862 жыл бұрын
  • Amazing video. A gifted teacher like this is quite rare ♥Thanks a lot!! btw made it to the end 😆

    @wanitooo@wanitooo Жыл бұрын
  • By far the best introduction video to Kafka I have seen. Great examples and nice build up to demos that puts theory into practice.

    @t529615@t5296153 жыл бұрын
    • Hans-Jacob Melby thanks Hans!

      @hnasr@hnasr3 жыл бұрын
    • @@hnasr One question though.. Shouldn`t the consumer allways get all messages in the topic (within its partition)? I can see that the property "fromBeginning" i set to true, but when i restart the consumer, it still waits for new mesages. It does not replay the old ones?

      @t529615@t5296153 жыл бұрын
  • how do you only have 23k subs?? you're so good at explaining difficult concepts, tysm!

    @zmm1337@zmm13374 жыл бұрын
    • 61k

      @ballonura@ballonura3 жыл бұрын
    • @@ballonura 79k

      @gtiradob@gtiradob3 жыл бұрын
    • 86.6K

      @mazharuddin3647@mazharuddin36473 жыл бұрын
    • @@mazharuddin3647 88.3k

      @johncerpa3782@johncerpa37823 жыл бұрын
    • @@johncerpa3782 88.4k

      @ManuelMartinez-dj2gr@ManuelMartinez-dj2gr3 жыл бұрын
  • Great video, thanks for making it. Love your accent! You're very easy to understand, follow, and your excitement is fantastic!

    @vbrtrmn@vbrtrmn3 жыл бұрын
    • vbrtrmn glad to know thank you! Lots of people have trouble with my accent glad you like it!

      @hnasr@hnasr3 жыл бұрын
  • made it to the end :))) Thank you Hussein, you are the best!!

    @umair.ramzan@umair.ramzan3 жыл бұрын
  • Enjoyed following this... as always, thanks Hussein!

    @emanuel0723@emanuel07234 жыл бұрын
  • made it to the end 🤟. It was a very good explanation with great clarity. Really Appreciate your work! Thanks a lot 🙏

    @bhaveshgujarathi926@bhaveshgujarathi926 Жыл бұрын
  • Made it till the end ! You can explain something in a super simple manner if and only if you understand it And you do, Thanks !

    @susmitvengurlekar@susmitvengurlekar2 жыл бұрын
  • Thank you for this amazing channel. I enjoy watching your videos and learning more.

    @jassinakhlaqi5474@jassinakhlaqi54742 жыл бұрын
  • Amazing video, you have made a complex topic extremely simple with your style of teaching.

    @PrashantKhanolkarUSA@PrashantKhanolkarUSA Жыл бұрын
  • Amazing explanation Hussein. Every single bit of your lecture is fully understandable. You made difficult thing easy with practical example. You rocked! Good Luck.

    @hirenjoshi2198@hirenjoshi21982 жыл бұрын
  • Brother you're videos are phenomenal they are just top notch.

    @princeabdul4290@princeabdul42903 жыл бұрын
  • This is brilliant and concise. Been looking for a channel like this 👍🏾

    @mzaman8660@mzaman86604 жыл бұрын
    • M Zaman enjoy the content 🙏

      @hnasr@hnasr4 жыл бұрын
  • Thank you man! Really appreciate the hardwork.

    @hey.............@hey............. Жыл бұрын
  • best video on kafka. Thanks a ton!

    @jongxina3595@jongxina3595 Жыл бұрын
  • Amazing video Hussein ! The way you explain helps to register the information in our memory :-)

    @sindhumohana6164@sindhumohana61642 жыл бұрын
  • Thank you. Best video so far for learning kafka. 👍

    @stevensonicteam@stevensonicteam4 ай бұрын
  • Best explanation of Kafka on the internet!

    @saurabhdeshpande8450@saurabhdeshpande84502 жыл бұрын
  • Clear and easy to understand. Although it's a long video, but not boring at all.

    @pongching8697@pongching86973 жыл бұрын
  • Made it to the end! Awesome video Hussein :)

    @shantnukumar1642@shantnukumar1642 Жыл бұрын
  • I was looking for your channel , you really good at explaining things you helped me once , I'm here again , thank you andn jazkAlllah khayran .

    @Goodwin454@Goodwin4542 жыл бұрын
  • Made it to end. Thanks you so much for the quality content.:)

    @pavanr92iitm@pavanr92iitm3 жыл бұрын
  • Hussein, You are a legend!!! Any one can be a master if they follow to your conversations. I like the way yo have a full conversation with yourself - such a good dialogue asking and answering yourself

    @abrahammoyo2939@abrahammoyo29393 жыл бұрын
    • Thank you! I am happy you noticed the conversation style, i have been working on it 😊

      @hnasr@hnasr3 жыл бұрын
  • Made it to the end! Yay! Nice video Hussein!

    @hvuupadhyay5418@hvuupadhyay5418 Жыл бұрын
  • Muchas gracias. Entendí muy bien todos los conceptos. I really appreciate your help!! Thanks.

    @gtiradob@gtiradob3 жыл бұрын
  • I made it to the end. :P Fabulous content! You rock. :D :D

    @diptikaushik8250@diptikaushik82503 жыл бұрын
  • Made it to the end!! Amazing content!

    @satheeshprabhakaran5330@satheeshprabhakaran53302 жыл бұрын
  • Today i understood, its not the subject its the way of teaching...thanks for sharing this wonderful knowledge

    @crypto-saiyan9283@crypto-saiyan9283 Жыл бұрын
  • love your accent and voice.. Great video and explanation

    @leomonz@leomonz4 жыл бұрын
  • Thank you Hussein, it's a great introduction to Kafka

    @ibrahimibrahim1991@ibrahimibrahim19913 жыл бұрын
  • Wow! Wonderfully explained video, including the commands. Thank you

    @sanjitselvan5348@sanjitselvan5348 Жыл бұрын
  • Thanks Nasser I ve made it to the end. wonderful stuff

    @xonmaina@xonmaina Жыл бұрын
  • Made it to the end, now gonna implement the backend of a texting app using Kafka

    @prakharvijay8853@prakharvijay88532 жыл бұрын
  • I made it to the End!!! Thanks so much Hussein!

    @mosespeter9711@mosespeter97112 жыл бұрын
  • Huge props for trying to understand things before you teach them!

    @obiwanus@obiwanus3 жыл бұрын
  • It's good that you included jordan speech...i was just googled that video and came back

    @PramodKumar-hu7mt@PramodKumar-hu7mt Жыл бұрын
  • I have been learning alot from you coach. Thank you so much

    @keaniaeric2719@keaniaeric27193 жыл бұрын
  • you explained Kafka in a very good way , thank you so much :)

    @mostwantedgaming3422@mostwantedgaming3422 Жыл бұрын
  • A very good explanation, I got a good idea of how it works and the reason to use all components

    @N0151@N01512 жыл бұрын
  • Thank you Hussein!! Great explanation as always!

    @santiagobustamante970@santiagobustamante970 Жыл бұрын
  • Thank you very much Hussein, this video helped me a lot. Have best see you next time.

    @nicolaseckell9691@nicolaseckell9691 Жыл бұрын
  • I really enjoyed this video, thanks man ❤️

    @mohammedabdulbary1577@mohammedabdulbary1577 Жыл бұрын
  • oh my god I love this video so much =]] this is such an amazing tutorial and how funny the instructor is : D

    @hangduong6683@hangduong6683 Жыл бұрын
  • Brilliant explanation. Thanks for your kind efforts ❤️

    @RiteshAgarwalGwalior@RiteshAgarwalGwalior Жыл бұрын
  • Thanks for such an awesome video on Kafka!

    @jiun683@jiun6832 жыл бұрын
  • Awesome, such an wonderful session and easy way to represent can only be possible by Hussain Nasser only. It truly cleared lot's of my confusions. Hats Off. Keep up going ..

    @sonjoychakraborty571@sonjoychakraborty571 Жыл бұрын
  • Made it to the end 😁. Thank you!

    @adewaleShotobi@adewaleShotobi Жыл бұрын
KZhead