Partitions enable parallelism
A topic is split into partitions, each an independent ordered log. Within a consumer group, each partition is read by exactly one consumer at a time. So the number of partitions sets the maximum parallelism: ten partitions allow at most ten active consumers.
Assignment strategies
- Range: assigns contiguous blocks of partitions per topic to each consumer.
- Round robin: spreads partitions evenly across all consumers, good for balance.
- Sticky: keeps assignments stable across rebalances to reduce churn.
Rebalancing
When a consumer joins or leaves, the group rebalances and partitions are reassigned. During this the group pauses briefly. Frequent rebalances hurt throughput, so sticky strategies aim to move as few partitions as possible.
Flow
Key idea
Partition count caps consumer parallelism; assignment strategies balance load while sticky assignment minimizes disruptive rebalancing.