Kafka · Core Concepts

What is a Consumer Group?

Easyconsumer grouppartition assignmentparallelismoffsets

Interview question

What is a Kafka consumer group, and how does partition assignment work?

How to answer

The short answer

A is a set of consumers that share the same group.id and cooperate to read a topic. Kafka treats them as one logical subscriber.

The golden rule

Within a group, each is assigned to at most one consumer.

So:

  • More consumers in the group → more parallel reads (up to the partition count).
  • 2 groups reading the same topic → each group gets a full independent copy of the stream (each tracks its own offsets).

Warehouse and fraud both see every order. Inside warehouse, each order partition is handled by only one of A/B/C.

Why this matters

  • Scale out processing by adding consumers (until you hit partition count).
  • Isolate applications with different group.id values.
  • Offsets are stored per group per partition (usually in the __consumer_offsets topic).

Tiny example

Topic has 6 partitions. Group has 3 consumers → typically 2 partitions each. Add a 4th consumer → partitions rebalance; each gets fewer. Add a 7th consumer → one sits idle (no free partition).

Interview tip: "Same group = load-balanced; different groups = fan-out / broadcast of the same log."