portunus_affinity_hash (portunus v0.8.0)

View Source

Rendezvous (highest-random-weight) hashing: each node scores its weight for the key, the highest wins. Keys spread evenly across members, and a membership change only moves the keys that hashed to the gained or lost node. Args is ignored. phash2/1 is portable, so every node agrees.

Summary

Functions

kind()

-spec kind() -> deterministic.

score(Key, Members, Args)

-spec score(term(), [node()], term()) -> non_neg_integer().