liveBook · Manning

Leader-follower replication model

As explained in Apache Kafka in Action

The leader-follower principle assigns one replica as the leader that handles coordination and other replicas as followers that copy its data.

A leader coordinates one partition’s replicas: producers send records to it, while followers fetch the log and report their offsets. Followers stay current so an in-sync replica can take over when the leader fails. section 5.3

A Kafka replication flow makes the operational trade-offs visible:

  • Distribute partition leadership across brokers to balance coordination and write load. section 5.3
  • Let followers fetch records and expose their offsets so acknowledgments can reflect replica progress. section 5.3

Three-broker product-price topic

A topic with three partitions and replication factor three places every partition on all three brokers while spreading leaders across them. Stopping Broker 3 moves Partition 1’s leadership to Broker 1; restarting Broker 3 restores synchronization, and preferred leader election can return leadership to Broker 3.

How Apache Kafka in Action covers it

How deep it goes
Explains producer flow, follower fetching, offsets, controller failover, recovery, and preferred leader election.
Examples
Demonstrates a three-partition product-price topic, broker shutdown and restart, topic inspection, under-replication checks, and preferred election.
What it assumes
Assumes familiarity with Kafka replication and partitioning, then develops broker leadership and follower behavior.
What you can do after
Operate/configure Kafka replication and diagnose leadership, synchronization, broker-failure, and preferred-election states.
How it connects
Connects replication with partitioning, Kafka brokers, producers, consumers, acknowledgments, in-sync replicas, and leader election.

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.