A consistent hash ring with bounded loads Consistent hashing with bounded loads implementation using Red Black Tree
nodes := []string{"a", "b", "c"}
cnf := &xring.Config{
VirtualNodes: 300,
LoadFactor: 2,
}
hashRing := xring.NewRing(nodes, cnf)
node,err:=hashRing.Get("foo")
/*
Call this post execution of any function, else
the traffic would be load balanced, and get stuck if
all nodes are busy
*/
hashRing.Done(node)
- Add more test cases
- Performance test for xxhash
https://ai.googleblog.com/2017/04/consistent-hashing-with-bounded-loads.html
xring Image source: https://ai.googleblog.com/2017/04/consistent-hashing-with-bounded-loads.html