liveBook · Manning

Follower node

As explained in Apache Kafka in Action

A Kafka partition follower is a broker that copies partition data from the leader for resilience and failover.

Suppose an online store keeps price changes in a Kafka topic. If a broker holding a partition fails, another broker needs a copy of its data. A follower is a broker that stores a replica of a partition and continuously fetches new messages from that partition’s leader. If the leader fails, a follower can take over. section 4.2.3

Each partition has one leader. Producers and consumers normally communicate with that leader, not its followers. A replication factor of three means three replicas in the normal state: one leader and two followers. The replication factor cannot exceed the number of available brokers. section 4.2.3

Create and inspect a replicated topic

With three brokers available, run `kafka-topics.sh --create --topic products.prices.replication --partitions 3 --replication-factor 3 --bootstrap-server localhost:9092`. Then use `kafka-topics.sh --describe --topic products.prices.replication --bootstrap-server localhost:9092` to inspect each partition’s leader, replicas and in-sync replicas (ISR). In the shown output, partition 0 has broker 2 as leader and brokers 1 and 3 as its other replicas. section 4.2.3

$ kafka-topics.sh \
    --describe \
    --topic products.prices.replication \
    --bootstrap-server localhost:9092
Topic: products.prices.replication PartitionCount: 3 ReplicationFactor: 3
Configs:    #1
Topic: products.prices.replication Partition: 0 Leader: 2 Replicas: 2,1,3
Isr: 2,1,3 Elr:   #2
Topic: products.prices.replication Partition: 1 Leader: 3 Replicas: 3,2,1
Isr: 3,2,1 Elr:
Topic: products.prices.replication Partition: 2 Leader: 1 Replicas: 1,3,2
Isr: 1,3,2 Elr:

Compare the Leader, Replicas and Isr fields across the three partitions. The leaders are distributed among brokers; each partition has three replicas. section 4.2.3

Check replica health as well as replica count. The ISR field identifies replicas that are up to date; a mismatch between ISR and Replicas can indicate a problem, such as a failed broker. Followers fetch data from the leader, and a leader may wait for replication before acknowledging a producer request. Replication lag can therefore affect availability and performance—not just failover readiness. section 4.2.3 section 8.5

How Apache Kafka in Action covers it

How deep it goes
Explains replica counts, leader–follower traffic and ISR inspection, then connects follower fetching and lag to acknowledgments without detailing election internals.
Examples
Uses a three-broker price topic and kafka-topics.sh create and describe output to identify leaders and replicas.
What it assumes
Introduces brokers, topics and partitions before follower roles, then assumes a running Kafka cluster for command-line inspection.
What you can do after
Operate/configure it with kafka-topics.sh by choosing a feasible replication factor and inspecting partition replicas and ISR.
How it connects
Connects followers to partitions, leaders, replication factor, in-sync replicas, producer acknowledgments and the high watermark.

Also explained in

Compare how 3 books explain follower node →

Related concepts

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