ELI5: Explain Like I'm 5

Consistent hashing

Let's imagine you have some candy that you want to share with your friends at the playground. But, you don't want to just randomly give the candy out, you want to make sure that each of your friends gets their fair share.

So, you come up with a plan where you divide your friends into groups based on some characteristic like their height or age. Then, you give each group a specific number and assign them to one of your pockets.

Now, whenever you want to share your candy, you can just reach into the pocket of the group that you want to give candy to, and you know that each member of that group will get an equal amount.

This is kind of like what happens with consistent hashing. Imagine you have a bunch of computers, and you want to store data on them in a way that is efficient and doesn't overload any one computer.

So, you come up with a system where you assign each computer a number that represents its position in a "circle." When you want to store some data, you give it a number as well, and find the closest computer on the "circle" to store it on.

This way, you can make sure that each computer is responsible for its fair share of the data, and if a computer goes offline or a new one is added, only a small portion of the data needs to be moved around to maintain the balance across all the computers.

Just like how you could easily give candy to a specific group of friends by reaching into a specific pocket, consistent hashing allows you to quickly find the computer responsible for storing a specific piece of data by looking at where it falls on the "circle".