Integration / Apache Kafka Interview questions
When would you choose the cooperative sticky partition assignment strategy?
Partition assignment strategies decide how a consumer group's partitions get distributed among members during a rebalance, and they differ mainly in how much churn they cause when membership changes.
| Strategy | Behavior |
| Range | Assigns contiguous partition ranges per topic; can be uneven with multiple topics. |
| Round Robin | Spreads partitions evenly across members, topic-agnostic. |
| Sticky | Minimizes partition movement between rebalances, but still uses the eager (stop-the-world) protocol. |
| Cooperative Sticky | Same stickiness goal as Sticky, but with incremental rebalancing so unaffected partitions keep processing. |
partition.assignment.strategy=org.apache.kafka.clients.consumer.CooperativeStickyAssignor
Cooperative sticky is the right default choice for most production groups, especially larger ones or ones with frequent membership changes (autoscaling consumer pools, rolling deployments), because it combines minimal partition movement (less state to rebuild, less cache-warming cost per rebalance) with incremental rebalancing (no full-group processing pause). It's less necessary for a small, stable group that rarely changes membership, where the difference between strategies is unlikely to be noticeable in practice.
More Related questions...