On this page
Kafka Improvement Proposal
KIP-1123: rack-aware partitioning, keep producer traffic in its zone
KIP-1123 lets the producer send records without a key only to partitions whose leader sits in the producer's own rack or availability zone. In the cloud that cuts the cross-zone traffic you pay for on every produce. It is off by default and needs partitioner.rack.aware=true plus client.rack on the producer.
- Proposal
- KIP-1123, Rack-aware partitioning for Kafka Producer
- Status
- Shipped New in Kafka 4.4, off by default (partitioner.rack.aware=false).
- Area
- Producers and transactions
- Proposal page
- KIP-1123 on the Apache Kafka wiki
Why it was needed
In a cluster spread over three availability zones, leaders are spread evenly, so about two thirds of what a producer sends crosses a zone boundary. Cloud providers bill that traffic. Consumers already had a fix, fetching from the closest replica (KIP-392), but producers must write to the leader, and the default partitioner picked partitions without looking at where their leaders live.
What it changes
With partitioner.rack.aware=true, the default partitioner chooses its sticky partition for keyless records only among partitions led by a broker with the same rack as the producer's client.rack. Records with a key still hash to their partition as before, so ordering by key is unchanged. If no partition in the producer's rack has a leader, for example after a broker in that zone failed, it falls back to all partitions.
How to use it
- Set client.rack on the producer to the zone it runs in, matching the brokers' broker.rack values.
- Set partitioner.rack.aware=true. It only helps keyless records and only when every zone hosts leaders.
Where it stands
Accepted and shipped in Apache Kafka 4.4 (October 2026) as an opt-in setting of the built-in partitioner. Leader placement still decides how much it saves: zones without leaders get no local partitions.
What comes next
No follow-up is planned. It pairs with KIP-392 on the consumer side, and diskless topics (KIP-1150) go after the same cross-zone bill for replication, which this KIP does not touch.
See it in the simulator
- Kafka rack-aware partitioning: partitioner.rack.aware (Rack-aware partitioning) Step 3: Rack-aware: az-a leaders only Open at this step: Kafka rack-aware partitioning: partitioner.rack.aware
- Kafka rack-aware partitioning: partitioner.rack.aware (Rack-aware partitioning) Step 6: Fallback: every partition Open at this step: Kafka rack-aware partitioning: partitioner.rack.aware
Sources
- KIP-1123: Rack-aware partitioning for Kafka Producer
- KIP-392: Allow consumers to fetch from closest replica