Skip to content
Welzin
← All posts

WOSS

Apache Kafka: The Log That Ate Real-Time Data

Aman Mundra · 2026-07-11 · 4 min read

Apache Kafka: The Log That Ate Real-Time Data
Image source
Contents

Summarize using AI

TL;DR - Apache Kafka is the de facto distributed event-streaming platform - a durable, high-throughput publish/subscribe log that sits at the ingestion edge of most modern data systems. Producers append to partitioned, replicated topics; consumers read at their own pace. With Kafka 4.0 (March 2025) the project removed ZooKeeper entirely, running solely on its own KRaft metadata layer, and added a faster consumer rebalance protocol and native queue semantics. It is the streaming stage of the data pipeline behind cloud-native AI.


Most data systems have one component that everything else quietly depends on, the piece that, if it goes down, takes the whole platform with it. Increasingly, that component is Apache Kafka.

What Kafka actually is

Strip away the ecosystem and Kafka is a beautifully simple idea: a distributed, append-only log. Producers write records to the end of a topic; the topic is split into partitions that are replicated across brokers for durability; consumers read forward through the log at whatever pace they choose, tracking their own position. That is the whole mental model, and its simplicity is exactly why it scales.

That design gives Kafka three properties that made it foundational:

  • Durability. Records are persisted and replicated, so the log is a system of record, not a transient buffer. You can replay history.
  • Throughput. The append-only, sequential-write pattern maps perfectly onto how disks and page caches actually work, so a single cluster handles enormous volume.
  • Decoupling. Producers and consumers never talk directly. A dozen downstream systems can each read the same stream at their own speed, and you can add a thirteenth without touching the producer. This is the property that makes Kafka the backbone of event-driven architectures.

That last point is why Kafka shows up everywhere: it is the neutral event bus that lets services, pipelines, and, increasingly, long-running AI agents and tools communicate without being wired directly to each other.

Kafka 4.0: goodbye ZooKeeper

For most of its life, Kafka depended on Apache ZooKeeper to manage cluster metadata - which brokers exist, who leads which partition, and so on. It worked, but it meant running and operating a second distributed system alongside your Kafka cluster, with its own failure modes and its own operational burden.

Kafka 4.0, released March 2025, removed ZooKeeper entirely. Clusters now run on KRaft (Kafka Raft), Kafka's own built-in Raft-based metadata layer. One system instead of two: simpler to deploy, faster to recover, and able to scale to far more partitions. It is the single biggest architectural change in Kafka's history, and it is part of a broader pattern across the Apache data stack this cycle - Kafka, Spark, and Airflow each shed an external dependency to make their core self-contained.

The upgrade has one sharp edge worth knowing: you cannot jump straight from a ZooKeeper-based cluster to 4.0. You must first migrate to KRaft mode on a 3.x release (3.9 is the recommended "bridge"), then upgrade. Brokers, Connect, and Tools now require Java 17.

Two other 4.0 highlights matter for anyone running Kafka at scale:

  • A new consumer group protocol (KIP-848) eliminates the old "stop-the-world" rebalances, where a single consumer joining or leaving would pause the entire group. Rebalances are now incremental and dramatically faster.
  • Queues for Kafka (KIP-932), in early access, brings traditional point-to-point queue semantics to Kafka via "share groups" - letting Kafka serve classic work-queue use cases it previously left to dedicated message brokers.

Where Kafka fits in an AI stack

In a modern AI or data platform, Kafka is the ingestion and streaming layer - the front door. Events arrive (user actions, sensor readings, application logs, model predictions), land durably in Kafka, and flow downstream to orchestration (Airflow) and compute (Spark). Those three form the data-infrastructure backbone under many cloud-native AI systems: the feature data and event history that training and inference depend on.

For agentic systems specifically, Kafka's decoupling property earns its keep: it is the durable bus that lets long-running agent and tool work be triggered, queued, and replayed without tightly coupling the components that produce and consume that work.

Getting involved

Kafka is a mature, extremely active project with an accessible on-ramp for contributors: client libraries, connectors (Kafka Connect), the Streams API, documentation, and a very live issue tracker where triage alone is a genuinely useful first contribution. Larger changes go through KIPs (Kafka Improvement Proposals), the open design-review process where the project's direction is debated in public - the Apache Way in action.

Further reading