From the course: Complete Guide to Apache Kafka for Beginners

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Consumer replica fetching: Rack awareness

Consumer replica fetching: Rack awareness - Kafka Tutorial

From the course: Complete Guide to Apache Kafka for Beginners

Consumer replica fetching: Rack awareness

Hi. So here is another theory lecture. And in this one we're going to look at the default behavior with partition leaders of the consumer. So we've seen this before. We know that the consumer reads by default from the leader of your partition. But if you have multiple data centers, you probably have maybe a higher latency and also high network charges because, well, your consumer may be in a different data center from your broker. Okay? So if you have the same AZ, for example, the same data center in AWS, a Cloud computing platform, then you have no cost. But if they are in different AZs, then there is a cost for moving the data from one AZ to the next. Therefore, it becomes very interesting to look at Kafka consumer replica fetching. So since Kafka 2.4, it is possible for you to configure your consumers to read not from the leader replica but from the closest replica. Two reasons; it may improve latency and also decreased network cost if using the Cloud. So this is an example. So we…

Contents