Dung (Donny) Nguyen

Senior Software Engineer

Apache Kafka

Apache Kafka is an open-source distributed event streaming platform used to build real-time data pipelines and streaming applications. Originally developed at LinkedIn and later open-sourced through the Apache Software Foundation, Kafka is designed to handle high-throughput, fault-tolerant, and horizontally scalable messaging across distributed systems. It has become a de facto standard for moving data between systems and for powering event-driven architectures.

Core Concepts

  1. Event (Record/Message): The unit of data in Kafka. Each event has a key, a value, a timestamp, and optional headers.
  2. Topic: A named category or feed to which events are published. Topics are split into partitions for scalability.
  3. Partition: An ordered, immutable sequence of records within a topic. Partitions allow Kafka to parallelize processing and scale horizontally.
  4. Offset: A unique, sequential ID assigned to each record within a partition. Consumers track offsets to know which records they have processed.
  5. Producer: A client application that publishes (writes) events to Kafka topics.
  6. Consumer: A client application that subscribes to (reads) events from Kafka topics.
  7. Consumer Group: A set of consumers that cooperate to consume a topic. Each partition is consumed by only one consumer in the group, enabling load balancing.
  8. Broker: A Kafka server that stores data and serves client requests. A Kafka cluster is made up of multiple brokers.
  9. Cluster: A group of brokers working together to provide scalability and fault tolerance.

Architecture Overview

Kafka follows a publish-subscribe model built on a distributed commit log:

Traditionally, Kafka relied on ZooKeeper for cluster coordination and metadata management. Newer versions use KRaft (Kafka Raft) mode, which removes the ZooKeeper dependency and manages metadata within Kafka itself, simplifying deployment and operations.

Key Features

Delivery Semantics

Kafka supports different levels of delivery guarantees:

The Kafka Ecosystem

Common Use Cases

Advantages

Challenges and Considerations

Conclusion

Apache Kafka has become a cornerstone of modern data architectures, enabling organizations to build scalable, real-time, event-driven systems. By decoupling producers and consumers and providing durable, high-throughput messaging, Kafka supports use cases ranging from simple messaging to complex stream processing and data integration. Understanding its core concepts—topics, partitions, offsets, and consumer groups—is essential for designing reliable distributed systems.