AdvancedAbout 20 min

    Kafka Consumer Group Rebalancing

    Read the full article on Substack

    7 min read.

    Production Kafka scaling: watch a topic’s partitions get reassigned across a consumer group as consumers join and leave, under the Range and RoundRobin assignors.

    Think of it this way: A consumer group is like a team splitting a stack of mailboxes (partitions): every mailbox is checked by exactly one teammate. Add a teammate and the mailboxes are redealt; if there are more teammates than mailboxes, the extras stand idle.

    Topic orders, 6 partitions; group order-service
    • C1
      P0P1P2
    • C2
      P3P4P5

    Parallelism 2/6.

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Range assignment

    Sort

    Seven partitions, three consumers, Range assignor. Sort each partition to its consumer.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Consumer 1

    Drop items here

    Consumer 2

    Drop items here

    Consumer 3

    Drop items here
    7 pieces left to place

    Quiz

    21 questions
    Question 1 of 21
    Score: 0

    What caps the maximum consumer parallelism in a group?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going