CCAAK practice question 2 of 15

A developer is working for a company with internal best practices that dictate that there is no single point of failure for all data stored. What is the best approach to make sure the developer is complying with this best practice when creating Kafka topics?

Full set: 54 questions
Answer options
A: Set ‘min.insync.replicas’ to 1.
B: Use the parameter --partitions=3 when creating the topic.
C: Make sure the topics are created with linger.ms=0 so data is written immediately and not held in batch.
D: Set the topic replication factor to 3. Correct answer
Correct Answer:
D. Set the topic replication factor to 3.
Explanation

The core principle to avoid a single point of failure for data in Kafka is replication. The topic's replication-factor determines how many copies of each partition's data are stored across different brokers in the cluster. Setting the replication factor to 3 (a common best practice) ensures that for each partition, there is one leader and two follower replicas on three separate brokers. If one broker fails, the data remains available on the other two, and a new leader can be elected from the in-sync followers, thus preventing data loss and service interruption.

Why Incorrect

A. Setting min.insync.replicas to 1 weakens durability. It allows a producer's write to be considered successful after only the leader broker has received it, risking data loss if that broker fails before replication occurs.
B. Partitions are for parallelism and scaling, not fault tolerance. A topic with many partitions but a replication factor of 1 still has a single point of failure for the data in each partition.
C. linger.ms is a producer-side configuration that controls batching to optimize throughput. It has no impact on how data is stored on the brokers for fault tolerance.

References

1. Confluent Documentation, "Kafka Topics": "Replication is at the core of Kafka's fault tolerance. The replication factor specifies how many copies of the data are made... For a replication factor of N, Kafka can tolerate up to N-1 server failures without losing any committed messages. A typical replication factor is 3."

Source: Confluent Documentation, "Manage Topics" section.

2. Apache Kafka Documentation, "3.4 Replication": "Replication is at the heart of Kafka's fault-tolerance... We recommend using a replication factor of 3, which allows for tolerating 2 broker failures."

Source: Apache Kafka 3.7 Documentation, Section 3.4 "Replication".

3. Confluent Documentation, "Producer Configs": The documentation for min.insync.replicas states, "When set to 1, the producer will get an acknowledgement as soon as the leader has written the message to its local log." This highlights the risk associated with this setting, which contradicts the goal of high availability.

Source: Confluent Documentation, "Producer Configuration Settings".

Scroll to Top