pingora-ketama
A Rust port of the nginx consistent hashing algorithm.
This crate provides a consistent hashing algorithm which is identical in behavior to nginx consistent hashing.
Using a consistent hash strategy like this is useful when one wants to minimize the amount of requests that need to be rehashed to different nodes when a node is added or removed.
Here's a simple example of how one might use it:
use ;
#
# Output:
We've provided a health-aware example in
pingora-ketama/examples/health_aware_selector.rs.
For a carefully crafted real-world example, see the pingora-load-balancing
crate.