Integration / Apache Kafka Interview questions
Explain the lifecycle of a Kafka consumer group rebalance?
A rebalance is the process of reassigning a topic's partitions among a consumer group's current members, triggered whenever group membership changes — a consumer joins, leaves, crashes, or the subscribed topic's partition count changes.
In the classic (eager) rebalance protocol, every member has to stop processing all its partitions during the whole rebalance, even ones it keeps — a real pause in throughput. The newer cooperative/incremental rebalancing (and the KIP-848 next-generation protocol, GA in Kafka 4.0) narrows this down so only the specific partitions actually being reassigned are paused, letting members keep processing their unaffected partitions throughout, which is a meaningful throughput improvement for large, frequently-changing groups.
More Related questions...