What is Apache Kafka?

Kafka is a fast, scalable, durable, and fault-tolerant publish-subscribe messaging system that sends messages between applications, processes, and servers. It is composed of three important components called producer (which acts as Sender), Topics (topic or category of messages), and Consumer (which acts as a Reciever).

Kafka aims to provide high-throughput, low latency for real-time data feeds. It is widely used for real-time streams analytics, ingestion data into Spark, Complex Event Processing, Log aggregation, etc.


Before understanding Kafka Architecture, lets first understand what Kafka Broker is

Kafka Broker:

As Kafka is a distributed framework, Kafka's cluster consists of different servers called Brokers running Kafka. Producers publish the message to Kafka Topics within this Broker and consumer consumes this message from Topics.

Kafka Architecture:

Kafka Architecture is comprised of mainly 3 components


  1. Kafka Producer
  2. Kafka Topics
  3. Kafka Consumer


Each Topic has Partitions, which contains messages in non-changing sequences. Each message is identified using a unique offset. This helps multiple consumers to read from topics at the same time. Each Topics partition can replicate the messages over several Kafka Brokers in the cluster.

Kafka also has a Consumer Group in which different consumers are assigned to consume messages from different partitions of specific Topics. They will receive the messages from a different subset of the partitions in Topic.

In the next posts, I will discuss more Kafka Producers and Consumers and provide JAVA code with explanations for writing Kafka Producer and Consumer.

Also, check out more posts below:



Comments

Popular posts from this blog

Tricky Questions or Puzzles in C

Program to uncompress a string ie a2b3c4 to aabbbcccc

Number series arrangement puzzles