Consistent Hash
Consistent Hashing is a distributed system algorithm for assigning values to partitions in a highly dynamic environment.
Example:
Using the algorithm to LB redis cache. (Crate redis = "0.17.0"
).
While the key must implement the hash trait to define a hashing strategy.
The Value must implement the Evict trait to define rebalancing behavior.
let mut ring: = match new.unwrap;
ring.add_node.unwrap;
ring.add_node.unwrap;
ring.add_node.unwrap;
ring.add_node.unwrap;
let client = match ring.get_node;
let mut con = client.get_connection?;
con.get;