Monedula
Kafka guide contents

Markdown

Part VI · Reference

Kafka Improvement Proposal

KIP-480: the sticky partitioner for records without a key

Producers and transactions · Shipped · since Kafka 2.4 · status checked November 2026

KIP-480 changed where the Kafka producer sends records without a key. Instead of spreading them round-robin, one record per partition, it sticks to one partition until a batch is full and then moves on, which makes bigger batches and lower latency. KIP-794 in Kafka 3.3 fixed its flaw: switching after a fixed number of bytes, so slow brokers no longer attract more data.

Proposal
KIP-480, Sticky Partitioner
Status
Shipped Since Kafka 2.4 (2019); replaced by the strictly uniform version of KIP-794 in 3.3.
Area
Producers and transactions
Uniform-sticky: one partition per batch. No-key records stick to a single partition, then the sticky partition moves on for the next batch. In Kafka 4.x this is the default partitioner's keyless mode (KIP-794), which switches only after batch.size bytes, to a random load-weighted partition; the simulator switches per batch to make it visible. Open this step in the full playground

Why it was needed

Round-robin sounds fair, but it splits a burst of keyless records across every partition, so each batch is tiny and the producer sends many small requests. With linger.ms at 0 that cost throughput and latency on every busy producer.

What it changes

Since KIP-480 (Kafka 2.4) the producer picks a sticky partition for keyless records and keeps it until a new batch starts. That created a feedback loop: a partition on a slow broker filled batches slowly, stayed sticky longer and so received even more records. KIP-794 (Kafka 3.3) switches after batch.size bytes instead, and with adaptive partitioning, on by default, it sends less to partitions whose queues grow. Records with a key still go to the partition their key hashes to.

How to use it

  • Leave partitioner.class unset: the built-in logic is the KIP-794 one.
  • partitioner.adaptive.partitioning.enable (default true) and partitioner.availability.timeout.ms (default 0, off) tune how it avoids slow brokers.
  • partitioner.ignore.keys=true spreads keyed records like keyless ones, at the cost of per-key ordering.

Where it stands

KIP-480 shipped in Kafka 2.4 and KIP-794 in Kafka 3.3. The old DefaultPartitioner and UniformStickyPartitioner classes, deprecated in 3.3, were removed in Kafka 4.0, so the built-in behaviour is now only reachable by leaving partitioner.class unset.

What comes next

Kafka 4.4 added rack-aware partitioning (KIP-1123) on top, which limits the sticky choice to partitions led in the producer's own zone. A misspelled constant for the adaptive setting is deprecated and goes away in 5.0.

See it in the simulator

Sources

All Kafka KIPs