Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not sure if this is exactly what you are looking for, but I'd do some digging into consistent hash rings.


Oh, interesting: https://en.m.wikipedia.org/wiki/Consistent_hashing

> Consistent hashing maps objects to the same cache machine, as far as possible. It means when a cache machine is added, it takes its share of objects from all the other cache machines and when it is removed, its objects are shared among the remaining machines.

I guess the challenge here is that subscriptions are sparse: I.e. one ws connection can carry multiple channel subscriptions, thus undermining the consistent hash.


There's a number of ways to tweak the algorithm, e.g. by generating multiple hashes per endpoint and then distributing them around a unit circle.

I've seen this used to consistently allocate customers to a particular set of servers, not just ensure you are hitting the right cache. It doesn't fully solve the subscription issue where multiple people are in multiple channels, but it could probably be used as a building block there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: