The replication factor is the number of copies of each partition that Kafka keeps across different brokers to ensure data durability and availability.
Click to reveal answer
beginner
Why is having a replication factor greater than 1 important?
It helps protect data from loss if a broker fails by keeping copies on other brokers, so the system can continue working without losing messages.
Click to reveal answer
beginner
What happens if the replication factor is set to 1?
There is only one copy of each partition, so if the broker holding that partition fails, the data is lost and unavailable until the broker recovers.
Click to reveal answer
intermediate
How does Kafka decide which brokers hold replicas of a partition?
Kafka distributes replicas across brokers to balance load and increase fault tolerance, ensuring replicas are on different brokers to avoid single points of failure.
Click to reveal answer
intermediate
What is the relationship between replication factor and fault tolerance?
Higher replication factor means more copies of data, which increases fault tolerance because the system can survive more broker failures without losing data.
Click to reveal answer
What does a replication factor of 3 mean in Kafka?
AEach partition has 3 copies on different brokers
BThere are 3 partitions in the topic
CThe topic can only have 3 messages
DThe broker can handle 3 clients
✗ Incorrect
Replication factor 3 means each partition is copied 3 times on different brokers for safety.
If a broker fails, what helps Kafka keep data available?
ADisabling replication
BReplication factor greater than 1
CUsing a single broker
DHaving only one partition
✗ Incorrect
Replication factor > 1 means copies exist on other brokers, so data stays available.
What risk does a replication factor of 1 pose?
AData loss if the broker fails
BToo many copies of data
CSlower message delivery
DMore disk space used
✗ Incorrect
With only one copy, if the broker fails, data is lost.
How does Kafka improve fault tolerance with replication?
ABy limiting the number of partitions
BBy deleting old messages
CBy storing replicas on different brokers
DBy using a single broker
✗ Incorrect
Replicas on different brokers prevent single points of failure.
What is a downside of increasing the replication factor?
AFewer brokers needed
BLess data safety
CMessages get lost faster
DMore disk space and network usage
✗ Incorrect
More replicas use more disk space and network resources.
Explain what the replication factor is and why it matters in Kafka.
Think about how Kafka keeps copies of data to avoid losing it.
You got /3 concepts.
Describe what happens when the replication factor is set to 1 and a broker fails.
Consider what happens if there is no backup copy.
You got /3 concepts.
Practice
(1/5)
1.
What does the replication factor in Kafka control?
easy
A. The size limit of each partition
B. The number of copies of each partition stored across brokers
C. The number of partitions in a topic
D. The number of consumers in a consumer group
Solution
Step 1: Understand replication factor meaning
The replication factor defines how many copies of each partition Kafka keeps on different brokers.
Step 2: Differentiate from other Kafka settings
Partitions count and consumer group size are unrelated to replication factor.
Final Answer:
The number of copies of each partition stored across brokers -> Option B
Quick Check:
Replication factor = number of copies [OK]
Hint: Replication factor = copies of data stored [OK]
Common Mistakes:
Confusing replication factor with partition count
Thinking replication factor controls consumer groups
Assuming replication factor limits partition size
2.
Which of the following is the correct way to set the replication factor when creating a Kafka topic using the command line?
D. Replication factor cannot be greater than the number of brokers
Solution
Step 1: Understand replication factor limits
Replication factor must be less than or equal to the number of brokers to ensure each replica is on a different broker.
Step 2: Check cluster size vs replication factor
Replication factor 5 is greater than 3 brokers, which is invalid.
Final Answer:
Replication factor cannot be greater than the number of brokers -> Option D
Quick Check:
Replication factor ≤ brokers [OK]
Hint: Replication factor must not exceed broker count [OK]
Common Mistakes:
Thinking partitions must equal replication factor
Ignoring cluster size limits
Assuming topic names have restrictions here
5.
You want to create a Kafka topic with 4 partitions and a replication factor of 3 for high availability. However, your cluster has only 2 brokers. What is the best solution?
hard
A. Create the topic with 1 partition and replication factor 3
B. Set replication factor to 4 to match partitions
C. Increase the number of brokers to at least 3
D. Create the topic with replication factor 2 instead
Solution
Step 1: Check replication factor vs brokers
Replication factor 3 requires at least 3 brokers to store replicas on different machines.