Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. Static membership

Kafka · Producers & Consumers

Static membership

Hardkafka-20
static membershipgroup.instance.idrebalancedeployments

Question

What is static membership in Kafka consumer groups, and why use it?

Solution

Static membership lets a consumer keep a stable identity across restarts so the group does not fully rebalance on every brief leave/join.

The problem it solves

With dynamic membership, each consumer gets a generated member id. On rolling restart: 1. Instance stops → leave group → rebalance 2. Instance starts → join group → rebalance again

That doubles rebalance cost during deploys.

How static membership works

You set a durable group.instance.id per instance (unique within the group).

  • Kafka remembers that instance.
  • On restart within session.timeout, the instance can reclaim the same partitions.
  • Avoids unnecessary rebalances when the same logical member returns quickly.
Dynamic: restart → leave + join → rebalances
Static:  restart with same group.instance.id → often keep assignment

Careful ops notes

  • group.instance.id must be unique per running member (e.g. pod name / host id).
  • Do not reuse the same id for two live instances.
  • Still need sensible session timeouts; a permanently dead instance eventually is removed.

Interview payoff

Static membership + cooperative rebalancing is a strong "production hardening" answer for reducing consumer downtime during releases.

Interview tip: "Static membership = stable group.instance.id so brief restarts do not thrash partition assignments."

PreviousNext