3rd-Eden / node-hashring

hashring is a consistent hashing algorithm for Node.js that is compatible with libketama and python's hash_ring package
MIT License
350 stars 61 forks source link

When vnodes get larger, will the link I get change? #53

Open aopstudio opened 3 years ago

aopstudio commented 3 years ago

For example, first time my config is var ring = new HashRing({ '127.0.0.1:11211': { vnodes: 50 }, '127.0.0.2:11211': { vnodes: 200 }, });

And assumed ring.get('a') == '127.0.0.1:11211'

Next time, my config is var ring = new HashRing({ '127.0.0.1:11211': { vnodes: 200 }, '127.0.0.2:11211': { vnodes: 50 }, });

Now is ring.get('a') == '127.0.0.1:11211'? Or it could be '127.0.0.2:11211' ?