Kafka 4: KRaft, new rebalances and queues
ZooKeeper removed, the broker-driven consumer rebalance protocol, share groups, and what changed for Spark jobs.
Step 4 · Structured Streaming · Gold · Kafka in production, lesson 2 of 2
On this page
Read first: Kafka in production (skip if you know it)
In plain words first
Picture a busy restaurant that used to keep its seating plan with a separate booking agency down the street. Every change meant a phone call. KafkaKafka: A system that stores streams of events in topics, in order within each partition, so many readers can read them, and read them again, at their own pace. Learn more → 4 brought the seating plan in-house (KRaft), gave the head waiter the job of reassigning tables without asking every diner to stand up first (the new rebalancerebalance: When a consumer group moves partitions between members because one joined, left or stopped responding. Learn more → protocol), and opened a counter where any free cook takes the next order, instead of each cook owning a fixed set of tables (share groups).
Unlock the full lesson
You have read the free part. The rest of this advanced lesson:
- The 4.x releases
- KRaft: no more ZooKeeper
- The new consumer rebalance protocol
- Share groups: queues for Kafka
- What it means for Spark
- Common mistakes
- Key takeaways
- Interview prep with 3 follow-up questions
- Check yourself: 3 questions
Unlock it with the Complete pass (every advanced problem and lesson) or on its own.
Practise this
Interview problems on streaming, graded on hidden tests
Keep going
Up next · new module: Streaming beyond Spark · 8 min readStreaming on Google Cloud
Pub/Sub, Dataflow (Apache Beam) and BigQuery, mapped to the Spark ideas: windows, watermarks, allowed lateness, triggers, exactly-once, dead letters and ordering.
Related lessons
Kafka in productionStructured Streaming · 7 min read
Consumer groups and offsets
Previous: Kafka in production
Primary sources: Kafka 4.0 release announcement · Kafka upgrade notes · KRaft operations · Kafka design: share groups · KIP-848: the next generation consumer rebalance protocol