murmur2

A fast, non-cryptographic hash function that Kafka clients use to turn a record key into a partition number.

In more detail

Because every client uses the same algorithm, a Java producer and a Python producer send the same key to the same partition. It is designed for speed and even spread, not security.

Example

murmur2(key_bytes) % num_partitions

Related terms

Taught in

References

Certification courses