liveBook · Manning

Standby task

As explained in Kafka Streams in Action, Second Edition

A standby task is a Kafka Streams task that maintains a replicated state-store copy for faster failover when an active task is reassigned.

A standby task shadows an active Kafka Streams task by consuming its changelog topic into a local state store. It does not process records; it keeps state synchronized so reassignment can become active with minimal recovery time. section 7.4.2

Configure and evaluate standby tasks by checking:

  • Set num.standby.replicas above 0 and deploy N + 1 Kafka Streams instances for N desired replicas, ideally on separate machines. section 7.4.2
  • Expect faster recovery after an instance drops out: the standby is already caught up or only a handful of records behind. section 7.4.2
  • Balance near-immediate failover against duplicated state-store data. section 7.4.2
Figure 7.19 A standby task shadows the active task and consumes from the changelog topic, keeping a local state store in sync with the store of the active task.
figure

Trace how a standby consumes the changelog topic and keeps its local state store synchronized with the active task. section 7.4.2

Figure 7.18 When a stateful task gets moved to a new machine, Kafka Streams rebuilds the state store from the beginning of the changelog topic.
figure

Contrast standby failover with rebuilding a newly assigned state store from the beginning of its changelog topic. section 7.4.1

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains changelog consumption, local state synchronization, activation, configuration, deployment capacity, and data-duplication tradeoffs.
Examples
Uses state-store reassignment diagrams showing changelog restoration and standby synchronization during failover.
What it assumes
Assumes state stores, changelog topics, application instances, and task reassignment; distinguishes standby work from record processing.
What you can do after
Operate/configure Kafka Streams with standby replicas and assess recovery speed against duplicated state.
How it connects
Connects standby tasks with Kafka Streams, active tasks, state stores, changelog topics, rebalancing, and failover.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.