Consumer groups are Kafka's mechanism for scalable, fault-tolerant consumption — consumers in a group share the work of consuming a topic's partitions, with automatic rebalancing. Understanding them in depth is key to building scalable Kafka consumers.
How consumer groups distribute work
A CONSUMER GROUP = consumers cooperating to consume a topic:
→ each PARTITION is assigned to exactly ONE consumer in the group (at a time)
→ partitions are distributed across the group's consumers → PARALLEL consumption
→ e.g. 6 partitions, 3 consumers → 2 partitions each
→ scale consumption by adding consumers (UP TO the partition count — extra consumers idle)
