Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What changed in Kafka 4.0

Kafka · Internals

What changed in Kafka 4.0

Mediumkafka-41
kafka-4kraftkip-848share-groupsbreaking-changes

Question

What are the major changes in Kafka 4.0?

Solution

Kafka 4.0, released in March 2025, marks the total removal of Apache ZooKeeper, requiring all clusters to operate exclusively in KRaft consensus mode. It promotes the next-generation consumer group protocol (KIP-848) to General Availability with broker-side incremental rebalancing, introduces early access for share groups (KIP-932 Queues for Kafka), and raises the minimum Java runtime to Java 17 for brokers and Java 11 for clients. In addition, legacy v0 and v1 message formats are completely dropped, and clients connecting to 4.0 clusters must connect to brokers running version 2.1 or higher.

Complete transition to KRaft consensus

ZooKeeper has been fully eliminated from the Kafka source code. Clusters no longer run hybrid migration modes or talk to external ZooKeeper ensembles. Cluster metadata is managed entirely by an internal Raft quorum of controller brokers writing to the metadata partition log. This change reduces operational complexity, cuts cluster startup times from minutes to seconds, and allows clusters to support millions of partitions without hitting external metadata bottlenecks.

Consumer group protocol and share groups

The KIP-848 next-generation consumer protocol is now GA. Rebalances move from client-side leader calculations to the broker group coordinator. Membership changes happen incrementally without stopping consumption across the entire group, cutting rebalance latency from seconds down to milliseconds.

Kafka 4.0 also introduces early access for KIP-932 share groups. Share groups allow multiple consumers to cooperatively read from the same partition with individual record acknowledgments, bringing queue-like behavior directly into Kafka topics.

Runtime requirements and dropped legacy formats

Platform baselines were updated to modernize broker internals:

  • Brokers require Java 17 or higher; clients require Java 11 or higher.
  • Message format versions v0 and v1 (dating back to Kafka 0.10 and earlier) are dropped, eliminating CPU overhead from down-converting old record batches.
  • Kafka 4.0 client libraries require broker versions 2.1 or newer.
PreviousNext