liveBook · Manning

KIP-392

As explained in Apache Kafka in Action

KIP-392 is a Kafka Improvement Proposal that enables consumers to fetch records from the replica nearest to the client.

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.
A close-up of a black background

AI-generated content may be incorrect.

Shows consumers reading from the nearest replica while producers continue writing to the partition leader. section 9.1.2

How Apache Kafka in Action covers it

How deep it goes
Explains rack-based selection and operational trade-offs, but does not detail the fetch protocol or replica-selection internals.
Examples
Uses same-data-center consumers, stretched clusters, rack-aware replica placement, and leader-directed producers as operational examples.
What it assumes
Assumes familiarity with Kafka consumers, partition leaders, replicas, brokers, and topics while defining rack locations incrementally.
What you can do after
Operate/configure consumers with client.rack to reduce cross-data-center traffic while preserving leader-based production.
How it connects
Connects Kafka consumers, partition leaders, replicas, broker.rack, client.rack, availability zones, and Cruise Control.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.