Package Usage: go: stathat.com/c/consistent
Package consistent provides a consistent hashing function.
Consistent hashing is often used to distribute requests to a changing set of servers. For example,
say you have some cache servers cacheA, cacheB, and cacheC. You want to decide which cache server
to use to look up information on a user.
You could use a typical hash table and hash the user id
to one of cacheA, cacheB, or cacheC. But with a typical hash table, if you add or remove a server,
almost all keys will get remapped to different results, which basically could bring your service
to a grinding halt while the caches get rebuilt.
With a consistent hash, adding or removing a server drastically reduces the number of keys that
get remapped.
Read more about consistent hashing on wikipedia: http://en.wikipedia.org/wiki/Consistent_hashing
1 version
Latest release: almost 8 years ago
263 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/stathat.com/c/consistent