Kafka keys and adding new partitions

However, adding more partitions to an existing topic doesn’t guarantee that new messages with a given key will land in the same partition as before.

Why is this not guaranteed? If a key maps to a partition before the adding new partition, what is preventing it from mapping to the same partition after the mapping?

Generally, new partitions shouldn’t be added to a topic if partitioning by keys is important.

Why is this not recommended?

Hi @dgdp

Can you specify the lesson with chapter no. in the course which states these lines? I am not able to find it.

Hi Usman,

This is in the Partitions lesson of the Basics chapter: