Kafka Consumer Group Rebalancing
Software Engineer path · lesson 83 of 99Production Kafka scaling: watch a topic’s partitions get reassigned across a consumer group as consumers join and leave, under the Range and RoundRobin assignors.
Key insight
Each partition is owned by exactly one consumer, so throughput scales only up to . With 6 partitions, the group can still add consumers (up to 6) to parallelize further. Every membership change forces a rebalance — cheap here, but a stop-the-world event in production, which is why the CooperativeStickyAssignor exists.
Range assignment
Seven partitions, three consumers, Range assignor. Sort each partition to its consumer.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
Consumer 1
Drop items hereConsumer 2
Drop items hereConsumer 3
Drop items hereTest your knowledge
What caps the maximum consumer parallelism in a group?
The short version
A consumer group is like a team splitting a stack of mailboxes (partitions): every mailbox is checked by exactly one teammate. Add a teammate and the mailboxes are redealt; if there are more teammates than mailboxes, the extras stand idle.
In more depth
Consumer Group Rebalancing
Within a consumer group, each partition is consumed by exactly one consumer. The group coordinator computes the assignment, and any membership change (join, leave, or session timeout) triggers a rebalance.
Parallelism ceiling
Throughput scales only up to min(consumers, partitions) — extra consumers are idle.
Assignors
Interview Questions
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required