

{"id":14519,"date":"2018-04-23T15:02:15","date_gmt":"2018-04-23T09:32:15","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=14519"},"modified":"2025-03-30T23:08:43","modified_gmt":"2025-03-30T17:38:43","slug":"apache-kafka-tutorial","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/","title":{"rendered":"Apache Kafka Tutorial &#8211; Door to Gain Expertise in Kafka"},"content":{"rendered":"<p>Want to know everything about Apache Kafka? Well, you have come to the right place. Here in Apache Kafka tutorial, you will get an explanation of all the aspects that surround Apache Kafka. We will start from its basic concept and cover all the major topics related to Apache Kafka.<\/p>\n<p>Before moving on to this Kafka tutorial, I just wanted you to know that Kafka is gaining huge popularity on Big Data spaces. A lot of companies are demanding Kafka professionals having strong skills and practical knowledge.<\/p>\n<p>You can learn the theory part here and for implementing the concepts through real-time projects, preparing for interviews you must take <em><strong>Kafka Certification Course<\/strong><\/em>. Here industry veterans will guide you and help you to become the next Kafka Developer.<\/p>\n<p>So, let&#8217;s continue the tutorial.<\/p>\n<h3><span style=\"font-weight: 400;\">What is Kafka?<\/span><\/h3>\n<p>Apache Kafka is a fast, scalable, fault-tolerant messaging system which enables communication between producers and consumers using message-based topics. In simple words, it designs a platform for high-end new generation distributed applications.<\/p>\n<p><span style=\"font-weight: 400;\">Also, it allows a large number of permanent or ad-hoc consumers. One of the best features of Kafka is, it is highly available and resilient to node failures and supports automatic recovery. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">This feature makes Apache Kafka ideal for communication and integration between components of large-scale data systems in real-world data systems. <\/span><\/p>\n<p>Moreover, this technology takes place of conventional message brokers like JMS, AMQP with the ability to give higher throughput, reliability, and replication.<\/p>\n<p>Before moving forward in Kafka Tutorial, let\u2019s understand the Messaging System in Kafka.<\/p>\n<h4>Messaging Systems in Kafka<\/h4>\n<p>The main task of managing system is to transfer data from one application to another so that the applications can mainly work on data without worrying about sharing it.<\/p>\n<p>Distributed messaging is based on the reliable message queuing process. Messages are queued non-synchronously between the messaging system and client applications.<\/p>\n<p>There are two types of messaging patterns available:<\/p>\n<ul>\n<li>Point to point messaging system<\/li>\n<li>Publish-subscribe messaging system<\/li>\n<\/ul>\n<p><strong>You must check the concept of\u00a0Apache Kafka Queuing<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Messaging-System-01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14532 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Messaging-System-01.jpg\" alt=\"Apache Kafka\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Messaging-System-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Messaging-System-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Messaging-System-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Messaging-System-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Messaging-System-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><strong>Point to Point Messaging System<\/strong><\/li>\n<\/ul>\n<p>In this messaging system, messages continue to remain in a queue. More than one consumer can consume the messages in the queue but only one consumer can consume a particular message.<\/p>\n<p>After the consumer reads the message in the queue, the message disappears from that queue.<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><strong>Publish-Subscribe Messaging System<\/strong><\/li>\n<\/ul>\n<p>In this messaging system, messages continue to remain in a Topic. Contrary to Point to point messaging system, consumers can take more than one topic and consume every message in that topic. Message producers are known as publishers and <strong>Kafka consumers<\/strong> are known as subscribers.<\/p>\n<h4>History of Apache Kafka<\/h4>\n<p><span style=\"font-weight: 400;\">Previously, LinkedIn was facing the issue of low latency ingestion of huge amount of data from the website into a lambda architecture which could be able to process real-time events.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"> As a solution, Apache Kafka was developed in the year 2010, since none of the solutions was available to deal with this drawback, before.<\/span><\/p>\n<p>However, there were technologies available for batch processing, but the deployment details of those technologies were shared with the downstream users. Hence, while it comes to Real-time Processing, those technologies were not enough suitable. Then, in the year 2011 Kafka was made public.<\/p>\n<h4>Need of Apache Kafka Cluster<\/h4>\n<p>As we all know, there is an enormous volume of data used in Big Data. For data, there are two main challenges. One is how to collect and manage a large volume of data and the other one is the analysis of the collected data. For dealing with such challenges, you need to have a messaging system.<\/p>\n<p>There are many benefits of Apache Kafka that justifies the usage of Apache Kafka:<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Tracking web activities by storing\/sending the events for real-time processes.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Alerting and reporting the operational metrics.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Transforming data into the standard format.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Continuous processing of streaming data to the topics.<\/span><\/li>\n<\/ul>\n<p><strong>Explore the benefits and limitations of Apache Kafka in detail.<\/strong><\/p>\n<p>Therefore, this technology is giving a tough competition to some of the most popular applications like ActiveMQ, RabbitMQ, AWS, etc because of its wide use.<\/p>\n<h4>Audience for Kafka Tutorial<\/h4>\n<p><span style=\"font-weight: 400;\">Professionals who are aspiring to make a career in Big Data Analytics using Apache Kafka messaging system should refer to this Kafka Tutorial. It will give you a complete understanding of Apache Kafka.<\/span><\/p>\n<h4>Prerequisites to Kafka<\/h4>\n<p><span style=\"font-weight: 400;\">You must have a good understanding of Java, Scala, Distributed messaging system, and Linux environment, before proceeding with this Apache Kafka Tutorial.<\/span><\/p>\n<h3>Kafka Architecture<\/h3>\n<p>Below we are discussing four core APIs in this Apache Kafka tutorial:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Apache-Kafka-Architecture.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14535 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Apache-Kafka-Architecture.png\" alt=\"Apache Kafka\" width=\"772\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Apache-Kafka-Architecture.png 772w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Apache-Kafka-Architecture-150x122.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Apache-Kafka-Architecture-300x244.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Apache-Kafka-Architecture-768x625.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/a><\/p>\n<p><strong>1. Kafka Producer API<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">This Kafka Producer API permits an application to publish a stream of records to one or more Kafka topics.<\/span><\/p>\n<p><strong>2.\u00a0Kafka Consumer API<\/strong><\/p>\n<p>The Consumer API permits an application to take one or more topics and process the continous flow of records produced to them.<\/p>\n<p><strong>3.\u00a0Kafka Streams API<\/strong><\/p>\n<p>The Streams API permits an application to behave as a stream processor, consuming an input stream from one or more topics and generating an output stream to one or more output topics, efficiently modifying the input streams to output streams.<\/p>\n<p><strong>4.\u00a0Kafka Connector API<\/strong><\/p>\n<p>The Connector API permits creating and running reusable producers or consumers that enables connection between Kafka topics and existing applications or data systems.<b><\/b><\/p>\n<h3>Kafka Components<\/h3>\n<p>Using the following components, Kafka achieves messaging:<\/p>\n<h3>1. Kafka Topic<\/h3>\n<p><span style=\"font-weight: 400;\">A bunch of messages that belong to a particular category is known as a Topic. Data stores in topics. In addition, we can replicate and partition Topics. Here, replicate refers to copies and partition refers to the division. Also, visualize them as logs wherein, Kafka stores messages. However, this ability to replicate and partitioning topics is one of the factors that enable Kafka&#8217;s fault tolerance and scalability.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Topic-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14536 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Topic-1.png\" alt=\"Apache Kafka\" width=\"1200\" height=\"517\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Topic-1.png 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Topic-1-150x65.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Topic-1-300x129.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Topic-1-768x331.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Kafka-Topic-1-1024x441.png 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h3>2. Kafka Producer<\/h3>\n<p>The producers publish the messages on one or more Kafka topics.<\/p>\n<h3>3.\u00a0Kafka Consumer<\/h3>\n<p>Consumers take one or more topics and consume messages that are already published through extracting data from the brokers.<\/p>\n<h3>4.\u00a0Kafka Broker<\/h3>\n<p>These are basically systems which maintain the published data. A single broker can have zero or more partitions per topic.<\/p>\n<h3>5.\u00a0Kafka Zookeeper<\/h3>\n<p>With the help of zookeeper, Kafka provides the brokers with metadata regarding the processes running in the system and grants health checking and broker leadership election.<\/p>\n<h4>Log Anatomy<\/h4>\n<p><span style=\"font-weight: 400;\">We view log as the partitions. Basically, a data source writes messages to the log. One of the advantages is, at any time one or more consumers can read from the log they select. Here, the below diagram shows a log is being written by the data source and read by consumers at different offsets.<\/span><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Log-Anatomy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14539 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Log-Anatomy.png\" alt=\"Apache Kafka\" width=\"907\" height=\"517\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Log-Anatomy.png 907w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Log-Anatomy-150x86.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Log-Anatomy-300x171.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Log-Anatomy-768x438.png 768w\" sizes=\"auto, (max-width: 907px) 100vw, 907px\" \/><\/a><\/p>\n<h4><span style=\"font-weight: 400;\">Data Log<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">By Kafka, messages are retained for a considerable amount of time. Also, consumers can read as per their convenience. However, if Kafka is configured to keep messages for 24 hours and a consumer is down for greater than 24 hours, the consumer will lose messages. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">And, messages can be read from last known offset, if the downtime on part of the consumer is just 60 minutes. Kafka doesn\u2019t keep a track on what consumers are reading from a topic.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Partition in Kafka<\/span><\/h4>\n<p>There are few partitions in every Kafka broker. Each partition can be either a leader or a replica of a topic. In addition, along with updating of replicas with new data, Leader is responsible for all writes and reads to a topic. The replica takes over as the new leader if somehow the leader fails.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Partitioning-in-Kafka-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14541 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Partitioning-in-Kafka-1.png\" alt=\"Apache Kafka\" width=\"1200\" height=\"467\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Partitioning-in-Kafka-1.png 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Partitioning-in-Kafka-1-150x58.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Partitioning-in-Kafka-1-300x117.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Partitioning-in-Kafka-1-768x299.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Partitioning-in-Kafka-1-1024x399.png 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h4><span style=\"font-weight: 400;\">Importance of Java in Apache Kafka<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Apache Kafka is written in pure Java and also Kafka\u2019s native API is java. However, many other languages like C++, Python,\u00a0.Net, Go, etc. also support Kafka. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Still, a platform where there is no need of using a third-party library is Java. Also, we can say, writing code in languages apart from Java will be a little overhead.<\/span><\/p>\n<p>In addition, we can use<strong>\u00a0<\/strong>Java<strong>\u00a0<\/strong>language if we need the high processing rates that come standard on Kafka. Also, Java provides good community support for Kafka consumer clients. Hence, it is the right choice to implement Kafka in Java.<\/p>\n<h3><span style=\"font-weight: 400;\">Kafka Use Cases<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">There are several\u00a0<strong>use cases of Kafka<\/strong> that show why we actually use Apache Kafka.<\/span><\/p>\n<p><strong>1. Messaging<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Kafka is the best substitute for traditional message brokers. We can say Kafka has better throughput, replication, fault-tolerance\u00a0and built-in partitioning which makes it a better solution for large-scale message processing applications.<\/span><\/p>\n<p><strong>2. Metrics<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Kafka is mostly utilized for operational monitoring data. It includes aggregating statistics from distributed applications to generate centralized feeds of operational data.<\/span><\/p>\n<p><strong>3. Event Sourcing<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Kafka is a great backend for applications of event sourcing since it supports very large stored log data.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Comparisons in Kafka<\/span><\/h3>\n<p>Many applications offer the same functionality as Kafka like ActiveMQ, RabbitMQ, <strong>Apache Flume<\/strong>, Storm, and Spark. Then why should you go for Apache Kafka instead of others?<\/p>\n<p>Let\u2019s see the comparisons below:<\/p>\n<h4>1. Apache Kafka vs Apache Flume<\/h4>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Apache-Kafka-vs-Apache-Flume-01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19689 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Apache-Kafka-vs-Apache-Flume-01.jpg\" alt=\"Kafka Tutorial\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Apache-Kafka-vs-Apache-Flume-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Apache-Kafka-vs-Apache-Flume-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Apache-Kafka-vs-Apache-Flume-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Apache-Kafka-vs-Apache-Flume-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Apache-Kafka-vs-Apache-Flume-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p><em><strong>i. \u00a0Types of tool<\/strong><\/em><br \/>\n<b><\/b><\/p>\n<p><b>Apache Kafka\u00a0<\/b><span style=\"font-weight: 400;\">&#8211;\u00a0It is a general-purpose tool for various producers and consumers.<\/span><br \/>\n<b><\/b><\/p>\n<p><b>Apache Flume\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; Whereas, it is a special-purpose tool for particular applications.<\/span><\/p>\n<p><em><strong>ii. Replication feature<\/strong><\/em><br \/>\n<b><\/b><\/p>\n<p><b>Apache Kafka\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; Using ingest pipelines, it replicates the events.<\/span><br \/>\n<b><\/b><\/p>\n<p><b>Apache Flume <\/b>&#8211;<span style=\"font-weight: 400;\"> It does not replicate the events.<\/span><\/p>\n<h4>2. RabbitMQ vs Apache Kafka<\/h4>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/RabbitMQ-vs-Apache-Kafka-01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19690 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/RabbitMQ-vs-Apache-Kafka-01.jpg\" alt=\"Kafka Tutorial\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/RabbitMQ-vs-Apache-Kafka-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/RabbitMQ-vs-Apache-Kafka-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/RabbitMQ-vs-Apache-Kafka-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/RabbitMQ-vs-Apache-Kafka-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/RabbitMQ-vs-Apache-Kafka-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">One of the foremost Apache Kafka alternatives is RabbitMQ. So, let\u2019s see how they differ from one another:<\/span><\/p>\n<p><em><strong>i. Features<\/strong><\/em><br \/>\n<b><\/b><\/p>\n<p><b>Apache Kafka\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; It is distributed. The data is shared and replicated with assured durability and availability.<\/span><br \/>\n<b><\/b><\/p>\n<p><b>RabbitMQ<\/b><span style=\"font-weight: 400;\">\u00a0&#8211; It offers comparatively less support for these features.<\/span><\/p>\n<p><em><strong>ii. Performance rate<\/strong><\/em><br \/>\n<b><\/b><\/p>\n<p><b>Apache Kafka\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; Its performance rate is high, up to 100,000 messages\/second.<\/span><br \/>\n<b><\/b><\/p>\n<p><b>RabbitMQ <\/b>&#8211;<span style=\"font-weight: 400;\"> Whereas, the performance rate of\u00a0RabbitMQ is around 20,000 messages\/second.<\/span><\/p>\n<p><em><strong>iii. Processing<\/strong><\/em><br \/>\n<b><\/b><\/p>\n<p><b>Apache Kafka\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; It allows reliable log distributed processing. Also, there exist stream processing semantics built into the Kafka Streams.<\/span><br \/>\n<b><\/b><\/p>\n<p><b>RabbitMQ<\/b>\u00a0<span style=\"font-weight: 400;\">&#8211; The consumer is just FIFO based, reading from the HEAD and processing sequentially.<\/span><\/p>\n<h4>3. Traditional Queuing Systems vs Apache Kafka<\/h4>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Traditional-queuing-systems-vs-Apache-Kafka-01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19692 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Traditional-queuing-systems-vs-Apache-Kafka-01.jpg\" alt=\"Kafka Tutorial\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Traditional-queuing-systems-vs-Apache-Kafka-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Traditional-queuing-systems-vs-Apache-Kafka-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Traditional-queuing-systems-vs-Apache-Kafka-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Traditional-queuing-systems-vs-Apache-Kafka-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Traditional-queuing-systems-vs-Apache-Kafka-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p><strong>i. Messages Retaining<\/strong><br \/>\n<b><\/b><\/p>\n<p><b>Traditional Queuing Systems\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; Most queueing systems discard the messages after it has been processed from the end of the queue.<\/span><br \/>\n<b><\/b><\/p>\n<p><b>Apache Kafka\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; Here, messages persist even after being processed. They don\u2019t get removed as consumers receive them.<\/span><\/p>\n<p><strong>ii. Logic-based processing<\/strong><br \/>\n<b><\/b><\/p>\n<p><b>Traditional Queuing Systems\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; It does not allow to process logic based on similar messages or events.<\/span><br \/>\n<b><\/b><\/p>\n<p><b>Apache Kafka\u00a0<\/b><span style=\"font-weight: 400;\">&#8211; It allows to process logic based on identical messages or events.<\/span><\/p>\n<h3>Summary<\/h3>\n<p><span style=\"font-weight: 400;\">In this Kafka Tutorial, we have seen the basic concept of Apache Kafka, Kafka components, use cases, and Kafka architecture. At last, we saw the comparison between Kafka vs other messaging tools. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Any queries in the Kafka Tutorial? Enter in the comment section. We are waiting for your response.<\/span><b><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to know everything about Apache Kafka? Well, you have come to the right place. Here in Apache Kafka tutorial, you will get an explanation of all the aspects that surround Apache Kafka. We&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":22807,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[19734,7848,7858,7860,7968,7970],"class_list":["post-14519","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kafka","tag-apache-kafka-history","tag-kafka-architecture","tag-kafka-cluster","tag-kafka-components","tag-kafka-tutorial","tag-kafka-use-cases"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache Kafka Tutorial - Door to Gain Expertise in Kafka - DataFlair<\/title>\n<meta name=\"description\" content=\"Apache Kafka Tutorial - Learn about Kafka Cluster, Architecture, Components, Kafka Partition and Kafka Use Cases. Grab the tutorial now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Kafka Tutorial - Door to Gain Expertise in Kafka - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Apache Kafka Tutorial - Learn about Kafka Cluster, Architecture, Components, Kafka Partition and Kafka Use Cases. Grab the tutorial now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-23T09:32:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-30T17:38:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Kafka-Tutorial-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Kafka Tutorial - Door to Gain Expertise in Kafka - DataFlair","description":"Apache Kafka Tutorial - Learn about Kafka Cluster, Architecture, Components, Kafka Partition and Kafka Use Cases. Grab the tutorial now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Apache Kafka Tutorial - Door to Gain Expertise in Kafka - DataFlair","og_description":"Apache Kafka Tutorial - Learn about Kafka Cluster, Architecture, Components, Kafka Partition and Kafka Use Cases. Grab the tutorial now!","og_url":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-04-23T09:32:15+00:00","article_modified_time":"2025-03-30T17:38:43+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Kafka-Tutorial-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Apache Kafka Tutorial &#8211; Door to Gain Expertise in Kafka","datePublished":"2018-04-23T09:32:15+00:00","dateModified":"2025-03-30T17:38:43+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/"},"wordCount":1773,"commentCount":13,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Kafka-Tutorial-01.jpg","keywords":["Apache Kafka History","Kafka architecture","Kafka Cluster","Kafka components","Kafka tutorial","Kafka use cases"],"articleSection":["Apache Kafka Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/","url":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/","name":"Apache Kafka Tutorial - Door to Gain Expertise in Kafka - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Kafka-Tutorial-01.jpg","datePublished":"2018-04-23T09:32:15+00:00","dateModified":"2025-03-30T17:38:43+00:00","description":"Apache Kafka Tutorial - Learn about Kafka Cluster, Architecture, Components, Kafka Partition and Kafka Use Cases. Grab the tutorial now!","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Kafka-Tutorial-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Kafka-Tutorial-01.jpg","width":1200,"height":628,"caption":"Apache Kafka Tutorial - Kafka For Beginners"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/apache-kafka-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Apache Kafka Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/kafka\/"},{"@type":"ListItem","position":3,"name":"Apache Kafka Tutorial &#8211; Door to Gain Expertise in Kafka"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/14519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=14519"}],"version-history":[{"count":2,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/14519\/revisions"}],"predecessor-version":[{"id":144690,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/14519\/revisions\/144690"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/22807"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=14519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=14519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=14519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}