1
votes

I am a beginner and trying to get hang on kafka. I read from the documentation that Both the producer and the consumer requests to a partition are served on the leader replica. Does it mean consumer can't read from the followers of a leader. If not, why?. I think if we can read from followers it will improve more paralleism. Any insight into this would be of great help.

1
You might want to read this blog post: confluent.io/blog/…Matthias J. Sax

1 Answers

4
votes

In the current design, a follower passively replicates the leader asynchronously. It's worth noting that not all replicas always keep sync with the leader, but only a part of them, namely, in-sync replicas(ISR). You could specify all the replicas as ISRs, but for the performance consideration, this will impact the producer throughput.

If client reads can be handled by any followers, there will be two possible cost: 1. Kafka must ensure all the replicas contain exactly the same message set at any time, which is a huge effort; 2. It slows down the producer greatly, since a message can be viewed as "committed" only after all the replicas acknowledge it.