1

We are working on the project where we wish to use Kafka. Based on our learning we have few queries:

Reference URL: https://www.youtube.com/watch?v=BGhlHsFBhLE#t=40m53s

  1. In multiple nodes multiple brokers architecture, can consumer read from in-sync follower?

  2. Any Kafka documentation links that gives us a walk through around such an architecture?

  3. Kafka says that "Producers and Consumers both write to and read from the LEADER replica and Follower replica is a High Availability solution and not meant to be read data from" In this case, how does a same TOPIC be read from multiple brokers? Any documentation / reference links that can help me how this can be achieved?

  4. If the concept of "LEADER / FOLLOWER" is at the partition level and topics reside within a partition, then how can a topic be read from multiple brokers (as the replication on other brokers will be a FOLLOWER replica – from which data cannot be read)?

Matthias J. Sax
62.8k8 gold badges128 silver badges148 bronze badges
asked Sep 8, 2016 at 15:46

2 Answers 2

2
  1. No. Consumers always read from leaders.
  2. I guess there is bunch of material about Kafka -- just search the Internet. Also check out http://docs.confluent.io/3.0.1/
  3. A topic consists of one or more partitions, and partitions are distributed over the brokers. (see https://kafka.apache.org/documentation.html#intro_topics) Thus, for a single topic you can use the (at max) the same number of broker are topic partitions, to read/write date into this topic.
  4. It is the other way round (it is not correct that "topics reside within a partition"): a topic contains multiple partitions.

Also check out this blog post about partitions and replication in Kafka: http://www.confluent.io/blog/hands-free-kafka-replication-a-lesson-in-operational-simplicity/

answered Sep 12, 2016 at 22:47
Sign up to request clarification or add additional context in comments.

Comments

1

No consumers must read just from partition leader. Replication is just for fault tolerance.

Topic is divided to partitions. Partition is a basic unit of replication and distribution. Each partition has its own leader for read and writes. You can specify layout how those partitions should be distributed across brokers.

Check out following short blog describing basic concepts.

answered Nov 3, 2016 at 21:27

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.