What is a Kafka Consumer Group?
Answer
A Consumer Group is a set of Kafka consumers that cooperate to consume a topic. Each partition in a topic is assigned to exactly one consumer in the group at any time — this is the key rule. This enables parallel processing: with N partitions and N consumers in a group, all consumers process simultaneously. If there are more consumers than partitions, some consumers sit idle. If there are fewer consumers than partitions, some consumers handle multiple partitions. Multiple independent consumer groups can read the same topic simultaneously — each group maintains its own offsets and receives all messages independently. This is Kafka's publish-subscribe model: one topic, many independent consumer groups. Consumer groups enable both load balancing (multiple consumers in one group) and broadcasting (multiple groups).