KIP-392 lets Kafka consumers fetch records from a replica near the client instead of always fetching from the partition leader. Brokers advertise physical or logical locations with broker.rack, while consumers select a matching location with client.rack. section 9.1.2
Reducing cross-data-center traffic
In a stretched Kafka cluster, set client.rack on consumers so they fetch from replicas in the same data center. This reduces inter-data-center traffic and its cloud operating cost. Producers still send records to the partition leader. section 16.1.4 section 9.1.2
Rack-aware placement also supports fault tolerance: Kafka can distribute new-topic replicas across broker rack IDs. Existing topics need a rebalancing tool such as Cruise Control to redistribute replicas. section 16.1.4
Figure 9.1 The consumers are consuming from the nearest replica (in the same rack), but producers still have to produce to the leader of the partition.
Shows consumers reading from the nearest replica while producers continue writing to the partition leader. section 9.1.2
