Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understand Kafka replication factor

Tags:

apache-kafka

When we say a topic is created with a Replication factors = 3. Does this mean each partition will have total of 3 replicas - out of which 1 will be leader and 2 will be replicas?

Or does this mean that there will be 3 replicas on top of 1 leader replica and therefore totally 4 replicas?

like image 838
Ankit Sahay Avatar asked Aug 04 '26 20:08

Ankit Sahay


1 Answers

The replication factor of 3 includes the leader itself and 2 followers. Think of that factor in a more mathematical way: 1 times 3 still results in 3.

Let me give an example. A topic created with 3 partitions, replication factor of 3 results in 9 replicas. Three of those nine are leaders, the other six will be followers.

Unfortunately I didn't find something about that in the official documentation of Apache Kafka. But you can find some more details here https://www.javatpoint.com/kafka-topic-replication

like image 180
maxgruber19 Avatar answered Aug 07 '26 12:08

maxgruber19



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!