record key

An optional value attached to a record that decides which partition it goes to, so all records with the same key stay together and in order.

In more detail

The producer hashes the key bytes to choose a partition, so the same key always lands in the same partition while the partition count stays the same. Records without a key have no partition affinity and no ordering relative to each other. Keys also define which records log compaction treats as updates to the same entry.

Related terms

Taught in

References

Certification courses