Skip to main content

Key

An optional value attached to each message that determines, via hashing, which partition it's stored in.

The key is the mechanism that guarantees relative ordering between messages: all messages with the same key land on the same partition (via hashing the key), and are therefore read in the order they were written. Messages without a key are distributed across partitions in an approximately uniform way (round-robin/sticky), with no ordering guarantee between them.