Try
↑ ↓ move↵ openesc close

Interview prep / Partitioned logs

Senior · Partitioned logs · System design interview question

What happens during a consumer group rebalance, and how do you limit the damage?

Sketch your own answer first, then compare it with the one below.

A strong answer

When a member joins, leaves or fails, the group redeals partitions. In the simple protocol every member stops reading, then each partition resumes from its committed offset. During the pause producers keep writing, so lag builds. Work done since the last commit is read again.

Damage grows with frequent rebalances. Causes are slow processing that looks like a failure, flaky health checks, and rolling deploys that restart members one by one.

To limit it, tune timeouts so slow work is not mistaken for failure, restart members gently, commit more often, and use newer protocols that move fewer partitions at a time. Consumers must also be idempotent, because the repeat is built in.

Sources

Learn it by running it

The partitioned logs lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms