Apache Kafka is a distributed publish-subscribe messaging system that functions as a fault-tolerant, horizontally scalable commit log. It allows applications to publish, subscribe to, store, and process streams of records in real-time, decoupling data producers from consumers. Originally developed at LinkedIn and open-sourced through the Apache Software Foundation, it is the de facto standard for event-driven architectures and high-volume data ingestion.
Glossary
Apache Kafka

What is Apache Kafka?
Apache Kafka is an open-source, distributed event streaming platform designed for high-throughput, low-latency data pipelines and streaming applications.
Kafka organizes data into topics, which are split into partitions distributed across a cluster of brokers for parallelism. Producers write immutable, ordered sequences of records to partition leaders, while consumer groups read in parallel with each member assigned specific partitions. Its architecture relies on ZooKeeper or the newer KRaft consensus protocol for cluster coordination, and it guarantees durability through configurable retention policies and replication, enabling both real-time stream processing and reliable historical data replay.
Key Features of Apache Kafka
Apache Kafka combines messaging, storage, and stream processing into a single, fault-tolerant system. These core architectural features enable it to handle trillions of events per day at companies like LinkedIn, Netflix, and Uber.
Distributed Commit Log
At its core, Kafka is a distributed, append-only log. Producers write records to the end of a log, and consumers read sequentially using an offset pointer. This immutable, ordered structure provides:
- Total ordering within a partition
- Replayability of entire event streams from any point in time
- Durability through disk persistence, not in-memory queuing
Unlike traditional message queues that discard messages after consumption, Kafka retains data based on configurable retention policies, allowing new consumers to backfill historical data without impacting producers.
Partitioning for Parallelism
Each topic is split into multiple partitions distributed across the cluster. Partitions are the unit of parallelism:
- A topic with 100 partitions can be consumed by up to 100 consumer instances in a consumer group
- Producers can route messages to specific partitions by key, guaranteeing order for all events sharing that key
- Partitions enable horizontal scaling — adding brokers increases both throughput and storage capacity linearly
This design avoids the bottleneck of a single ordered queue while preserving ordering guarantees where they matter.
Consumer Group Load Balancing
Kafka distributes consumption across a consumer group by assigning each partition to exactly one consumer instance within the group. This provides:
- Fault tolerance: If a consumer fails, its partitions are automatically reassigned to remaining members via a group coordinator
- Scale-out consumption: Adding consumers increases processing throughput up to the partition count
- Multi-subscriber fan-out: Different consumer groups read the same topic independently, each maintaining its own offset position
This model decouples production from consumption, allowing multiple downstream applications to process the same event stream at their own pace.
Fault Tolerance via Replication
Every partition is replicated across a configurable number of brokers (typically 3). One broker acts as the leader for reads and writes, while followers passively replicate the log. Key guarantees:
- ISR (In-Sync Replicas): Only replicas that are fully caught up are eligible for leader election
- Acks configuration: Producers can require acknowledgment from all in-sync replicas (
acks=all) for guaranteed durability - Rack awareness: Replicas can be placed across availability zones to survive data center outages
A failed leader triggers an automatic election among ISRs, with zero data loss when acks=all and min.insync.replicas are properly configured.
Log Compaction for State Storage
Beyond time-based retention, Kafka supports log compaction — a retention mechanism that keeps only the latest record for each key. This transforms Kafka into a distributed key-value store:
- Change Data Capture (CDC): Database changes streamed into Kafka maintain a compacted snapshot of current row state
- KTable in Kafka Streams: Compacted topics back stateful stream processing operations
- Event sourcing snapshots: Aggregate state can be rebuilt from compacted topics without replaying the entire event history
Compaction runs asynchronously in the background, periodically removing obsolete records while preserving the most recent value per key.
Exactly-Once Semantics
Kafka provides exactly-once semantics (EOS) across producers, brokers, and stream processors, eliminating duplicate processing even during failures. This is achieved through:
- Idempotent producers: Each message gets a producer ID and sequence number; brokers deduplicate retries
- Transactional writes: Producers can atomically write to multiple partitions using a two-phase commit protocol
- Kafka Streams EOS: State stores and output topics are updated transactionally, preventing partial updates
This guarantee is critical for financial ledgers, inventory systems, and any use case where double-counting is unacceptable.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about Apache Kafka's architecture, core mechanisms, and operational characteristics for data engineers and backend developers.
Apache Kafka is a distributed, high-throughput publish-subscribe messaging system that functions as a fault-tolerant, append-only distributed commit log. It works by having producers publish ordered streams of records (messages) to categories called topics. These topics are partitioned and replicated across a cluster of brokers for parallelism and durability. Consumers subscribe to topics and read records at their own pace, tracked by an offset. This decouples data producers from consumers, enabling real-time data pipelines and streaming applications that can handle millions of messages per second with persistent storage and replayability.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core concepts and architectural patterns that form the foundation of the Kafka streaming platform and its surrounding ecosystem.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us