4 ms·
Is leader election somehow a usage of a global lock? I do agree it should be avoided actively though.
by eva1984 11y ago
Is leader election somehow a usage of a global lock? I do agree it should be avoided actively though.
- jedberg 11y agoI don't think so, there are distributed leader election schemes that don't require a lock. The simplest is using HRW hashing[0] so that each node independently determines the same leader. [0] https://en.wikipedia.org/wiki/Rendezvous_hashing https://en.wikipedia.org/wiki/Rendezvous_hashing
- jodah 11y agoIt's related. Leader election generally[1] requires consensus among distributed processes, and global locks generally[1] require consensus as well. The benefit of this is that both problems can be solved on top of a common consensus implementation which is what http://atomix.io http://atomix.io does. 1: I say generally because you can do fancy things with fancy clocks to avoid running operations through a quorum under certain circumstances, but these carry caveats that preclude them from being reliable enough to use in many use cases.