Apache Kafka Streaming (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are Replicas, Leaders, and Followers in Kafka partition replication?
senior LevelApache KafkaMicroservices
In Simple Words:
To survive server crashes, Kafka replicates each partition across multiple brokers (determined by replication.factor, typically 3 in production).
- Partition Leader: One broker node is elected leader for a specific partition. All producer writes and consumer reads go to the leader (by default).
- Partition Followers: The other replica brokers act as followers. They do not accept client writes; they act as consumers fetching log records from the leader to keep their local logs identical.
- Failover: If the broker hosting the leader crashes, Kafka automatically promotes one of the in-sync followers to become the new partition leader in milliseconds.