CCDAK practice question 9 of 25

If a topic has a replication factor of 3...

Full set: 150 questions
Answer options
A: 3 replicas of the same data will live on 1 broker
B: Each partition will live on 4 different brokers
C: Each partition will live on 2 different brokers
D: Each partition will live on 3 different brokers Correct answer
Correct Answer:
D. Each partition will live on 3 different brokers
Explanation

A replication factor of 3 for a Kafka topic means that for each partition, there will be a total of three identical copies, known as replicas. To achieve fault tolerance, Kafka distributes these replicas across different brokers in the cluster. One of these replicas is elected as the "leader," which handles all client read and write requests for that partition. The other two replicas are "followers," which passively copy the data from the leader. If the broker holding the leader replica fails, one of the follower replicas on another broker is promoted to become the new leader, ensuring data availability and durability.

Why Incorrect

A. Placing all replicas on a single broker would offer no fault tolerance, as a single broker failure would result in the loss of all copies of the data.
B. A replication factor of 3 corresponds to three total copies of each partition, which are placed on three distinct brokers, not four.
C. A replication factor of 3 corresponds to three total copies of each partition, which are placed on three distinct brokers, not two.

References

1. Confluent Documentation, Apache Kafka > Design > Replication: "The replication factor is set at the topic level. It determines how many copies of a topic’s partition logs are maintained and on how many brokers... Each partition has one leader and one or more followers (replicas). The total number of replicas, including the leader, constitutes the replication factor." This confirms that the factor defines the total number of copies distributed across brokers.

2. Apache Kafka Documentation, 3. Design > 3.2 Replication: "The unit of replication is the topic partition... The total number of replicas including the leader is the replication factor. All writes to the partition go to the leader and the leader writes the messages to its log... Followers consume messages from the leader and append them to their own logs." This explains the leader/follower model and that the factor equals the total number of copies.

3. Kleppmann, M. (2017). Designing Data-Intensive Applications. O'Reilly Media. Chapter 5, Replication, p. 156: "In Kafka, replication is implemented at the partition level. When a topic is created, you can configure how many replicas each partition should have... For example, if the replication factor is 3, then one broker is the leader for the partition, and two other brokers are followers." This academic source corroborates the distribution of leader and follower replicas across different brokers.

Scroll to Top