A Kafka consumer group is a set of consumers that share a group ID and divide topic partitions among themselves so an application can process a stream in parallel while each partition is owned by one group member at a time.
For production teams, the important questions begin after that definition: how much lag is acceptable, what causes rebalances, when should offsets be committed, and how will the group recover after a crash, slow dependency, deployment, or replay? These decisions determine whether a consumer failure is a short catch-up event or a backlog that outlives the topic's recovery window.
Raff Technologies supports 3,000+ customers and 15,000+ VMs, and our operating rule is to treat consumer lag as a recovery-budget signal before treating it as a reason to add workers. More consumers help only when partitions and downstream capacity allow them to do useful work.
This guide continues from Kafka Architecture for Small Teams and Kafka Partitions: Keys, Replication & Scaling Trade-Offs. Those pages own the topic and partition model; this page owns consumer-group behavior, lag, rebalances, offsets, and recovery planning.
Consumer groups distribute partition ownership across workers
Consumers with the same group.id cooperate as one logical application. Kafka assigns the group's subscribed partitions across active members, allowing multiple consumer instances to process different partitions concurrently.
That creates a simple capacity boundary: a group cannot use more active partition-level workers than the topic provides partitions. If a topic has eight partitions, a ninth consumer in the same group cannot create a ninth independently assigned partition.
The detailed partition-count decision belongs in the Kafka partitions guide. At the consumer-group layer, the important question is whether the available partition ownership is being converted into useful application throughput.
A group should therefore have a clear application owner and workload purpose. Separate applications that must each receive the stream normally use separate consumer groups. Instances of the same horizontally scaled application normally share a group so they divide the work.
The group model also creates an operational contract:
| Group responsibility | Question the team must answer |
|---|---|
| Partition ownership | How many workers can do useful work concurrently? |
| Offset progress | What processing point is safe to resume from? |
| Rebalance behavior | What happens to in-flight work when ownership changes? |
| Lag | How far behind is each partition and the group overall? |
| Recovery | Can the group catch up before retained events expire? |
| Side effects | Are retries and replays safe for downstream systems? |
A healthy broker does not guarantee a healthy consumer application. The broker may continue accepting and retaining events while one consumer group falls steadily behind.
Consumer lag measures backlog, not business latency by itself
Consumer lag is the distance between the latest available position in a partition and the consumer group's committed or current processing position, depending on the metric being used.
Lag is useful because it shows whether the group is keeping up with incoming work. But a lag value is usually a record count, not a direct measure of elapsed time or customer impact.
A lag of 10,000 records can mean very different things:
- seconds behind on a high-volume telemetry stream;
- hours behind on a low-volume billing stream;
- one hot partition while the rest of the group is current;
- a short deployment spike that is already draining;
- a sustained deficit where production exceeds processing capacity.
For operational decisions, pair lag with event age, producer rate, consumer processing rate, and the topic's retention window.
| Lag pattern | First interpretation |
|---|---|
| Brief spike that quickly drains | restart, deployment, or short dependency slowdown |
| Steady lag at a stable level | consumer is behind but matching current production rate |
| Continuously increasing lag | sustained processing capacity deficit or blocked downstream work |
| Lag concentrated in one partition | key skew, hot partition, or partition-specific processing issue |
| Group-wide lag after scaling/deploy | rebalance or cold-start effects |
| Low lag but stale product behavior | investigate downstream processing and commit correctness |
At Raff, we use recovery headroom as the more useful question: if this group stopped making progress now, how long would the team have to detect the problem, restore processing, and catch up before the oldest required events leave retention?
A conceptual recovery budget is:
retention window * detection time * repair or restart time * catch-up time = recovery headroom
That is more actionable than a universal lag threshold because event rates and business criticality differ by workload.
Rebalances move partition ownership and can interrupt useful work
A rebalance occurs when Kafka needs to change which consumer owns which partitions in a group.
Common causes include:
- a consumer joining the group;
- a consumer leaving or crashing;
- a process restart or deployment;
- a consumer failing to poll within its allowed interval;
- a subscription change;
- a change to the subscribed topic's partition count.
The Apache Kafka 4.3 ConsumerRebalanceListener documentation notes that partition reassignment can be triggered by group membership changes, subscription changes, or administrative partition-count changes. Kafka's consumer configuration also defines max.poll.interval.ms as the maximum delay between poll() calls before a consumer can be considered failed and its partitions reassigned.
The cost of a rebalance is application-specific. It can include:
- temporarily reduced processing while ownership changes;
- partition-local caches warming again;
- state or connections being recreated;
- in-flight records needing careful handoff;
- offset commits around revoked partitions;
- duplicate processing when work completed but its offset was not committed;
- delayed catch-up when many consumers restart together.
This is why frequent rebalances are not merely a broker metric. They can become application latency and recovery events.
A practical distinction is whether the rebalance is expected or churn. Scaling a group from four to eight workers is expected. A group that repeatedly loses and rejoins the same members because processing exceeds poll timing or because instances are unstable has an operating problem.
Kafka 4.3 supports classic and newer consumer rebalance protocols
Current Apache Kafka 4.3 supports two consumer-group rebalance protocols: the earlier classic protocol and the newer consumer protocol introduced through KIP-848.
Apache Kafka documents the newer Consumer protocol as generally available since Kafka 4.0. Its fully incremental design reduces the need for a global synchronization barrier and is intended to improve consumer-group scalability and rebalance time. In Kafka 4.3, the client can enable it with group.protocol=consumer; the classic protocol remains supported.
This matters because not every rebalance recommendation applies identically to both protocols.
With the newer Consumer protocol:
- heartbeat and session-timeout control move more toward broker-side configuration;
- assignment is server-side;
- the protocol uses incremental assignment behavior;
- some classic client settings, including
heartbeat.interval.ms,session.timeout.ms, andpartition.assignment.strategy, are not used in the same way.
Teams should therefore identify which protocol their clients use before applying tuning advice copied from older Kafka material.
The durable operational goal is the same in either case: avoid unnecessary ownership churn and make partition handoff safe when it does occur.
Offset commits define the restart point, not whether work was correct
Kafka consumers track progress through offsets. A committed offset gives the consumer group a restart position after a process exits or partition ownership moves.
Apache Kafka stores committed consumer-group offsets through the group coordinator, and current Kafka clients support both automatic and manual offset commits.
The application design question is when an offset becomes safe to commit relative to the side effect the record causes.
Consider a consumer that reads an order event and writes to another system.
If the application commits the offset before completing the side effect, then crashes, the restarted group can resume after a record whose business work never completed.
If the application completes the side effect first and crashes before committing the offset, the record may be delivered again after restart. The downstream operation must then tolerate duplicate processing or provide its own idempotency control.
| Commit relationship | Main failure risk |
|---|---|
| Commit before business work completes | skipped business work after failure |
| Business work before commit | duplicate work after failure |
| Atomic/transactional coordination where supported | lower mismatch risk, with added design complexity |
This is why offset management and application correctness cannot be separated.
Kafka 4.3's consumer configuration enables automatic commits by default for standard clients, with periodic background commits. That default is convenient, but production applications should deliberately decide whether its timing matches the application's processing and side-effect model.
Manual commits provide tighter control, but manual does not automatically mean correct. The commit must still represent a processing point the application can safely resume from.
Offset reset is a recovery decision rather than a routine tuning control
Kafka's auto.offset.reset setting defines what a consumer should do when it has no valid committed offset for a partition, including cases where the old offset no longer exists because retained data has been deleted.
Kafka 4.3 currently supports behaviors including earliest, latest, by_duration, and none.
These options carry business consequences:
| Reset choice | Operational meaning |
|---|---|
| Earliest | replay retained history from the oldest available offset |
| Latest | begin from the newest available position and skip retained backlog |
| By duration | resume from a time-relative position supported by current Kafka clients |
| None | fail instead of silently choosing a reset position |
There is no universally safe default for every application.
For analytics, replaying retained events may be acceptable. For payments or workflow orchestration, silently jumping to the latest offset can skip required business events. Conversely, replaying a large retained history without idempotent consumers can repeat side effects.
Offset resets should therefore be part of a documented recovery procedure with a known answer to three questions:
- What data can be replayed safely?
- What data must never be skipped?
- Which downstream side effects are idempotent or deduplicated?
This guide intentionally stops at the decision model rather than providing reset commands. Command-level offset manipulation is an operational procedure and should be reviewed against the exact consumer group and incident before execution.
Recovery planning connects lag, retention, and catch-up capacity
A consumer group is recoverable only if the required events remain available long enough for the group to resume and catch up.
The recovery plan should consider four intervals:
- detection time: how long before the team knows the group is unhealthy;
- repair time: how long to restore the consumer or its downstream dependency;
- backlog growth: how much new work arrives while the group is impaired;
- catch-up time: how long restored consumers need to drain the accumulated backlog.
A team can have seven days of retention and still have poor recovery if a slow consumer needs six days to drain a two-day backlog.
The useful relationship is:
catch-up throughput > incoming throughput
If restored processing only matches current production, the backlog never shrinks. The group needs temporary or permanent excess processing capacity, a reduction in per-record work, or a change in downstream constraints.
Recovery planning should also define the validation step after the lag reaches zero. Zero lag means the group has caught up to the stream position; it does not prove that every downstream side effect, database write, notification, or derived state is correct.
For business-critical streams, recovery should end with application-level verification rather than a green lag graph alone.
The decision framework separates scaling, rebalance, and recovery problems
Consumer-group incidents become easier to diagnose when the symptom is mapped to the correct control.
| Symptom | Primary decision | Avoid assuming |
|---|---|---|
| Lag increases across all partitions | consumer/downstream throughput | that more partitions are automatically required |
| One partition carries most lag | partition key or workload skew | that more consumers will fix one hot partition |
| Consumers repeatedly leave and rejoin | poll timing, process stability, protocol behavior | that the broker is necessarily overloaded |
| Lag spikes during every deployment | rollout and rebalance behavior | that sustained capacity is insufficient |
| Group recovers but repeats side effects | offset/side-effect ordering and idempotency | that lag itself is the problem |
| Offset no longer exists | retention and recovery policy | that latest is safe |
| More consumers sit idle | available partition ownership | that worker count equals useful parallelism |
| Lag reaches zero but product remains stale | downstream validation | that Kafka processing is correct end-to-end |
Use this decision order:
1. Confirm whether lag is group-wide or partition-specific. 2. Compare incoming rate with processing and catch-up rate. 3. Check whether a rebalance or member churn explains the change. 4. Verify offset progress and commit behavior. 5. Verify downstream dependencies and side effects. 6. Compare recovery time with the remaining retention window. 7. Scale consumers only when partitions and downstream capacity can use them.
This keeps three different problems separate: partition design, consumer execution, and recovery safety.
The upcoming Kafka monitoring guide will own metric selection, broker health, under-replicated partitions, and alert design. For the broader observability model today, Database Monitoring for Small Teams explains how to choose signals and escalation boundaries without turning dashboards into an operations strategy.
Managed Kafka moves broker operations but leaves group correctness with the application
A managed Kafka service can own more of the broker lifecycle, infrastructure, replication operations, and service maintenance. It does not decide how your consumer application commits offsets or handles repeated business work.
The application team still owns:
- group IDs and workload boundaries;
- consumer concurrency;
- acceptable lag and event-age targets;
- processing time and downstream backpressure;
- commit timing;
- idempotency and retry behavior;
- replay and offset-reset policy;
- validation after recovery.
Raff maintains a dedicated Managed Kafka product path. Because availability, versions, plan sizes, and pricing can change faster than editorial guidance, use the live product page for current service details rather than treating this guide as a product specification.
The operating boundary remains straightforward: a managed platform can reduce the broker pager, but consumer lag and business recovery still belong to the application team.