advanced

Consumer group

Scale consumption by sharing partitions or queue work across instances while preserving the broker-specific delivery and ordering model.

A consumer group shares work: each partition or queue shard is consumed by at most one member at a time, enabling horizontal scale. Rebalance occurs when members join or leave — briefly pausing consumption.

Trade-off: scale-out versus rebalance disruption and the limit that max consumers often equals partition count in Kafka.

On interviews: why adding ten consumers to a three-partition topic only three work; rebalance storms during deploys.

Common pitfalls: multiple groups reading same topic without understanding independent offsets; frequent rolling deploys causing rebalance lag.

Checklist:

  • Size partitions for target parallelism.
  • Use cooperative rebalance and static membership where supported.
  • Stagger deploys or use pause-aware rebalancing.
  • Monitor rebalance duration and lag per partition.