Get the latest tech news
Distributed Locks with Redis (2014)
A distributed lock pattern with Redis
We are going to model our design with just three properties that, from our point of view, are the minimum guarantees needed to use distributed locks in an effective way. In our examples we set N=5, which is a reasonable value, so we need to run 5 Redis masters on different computers or virtual machines in order to ensure that they’ll fail in a mostly independent way. Basically, the algorithm safety is retained as long as when an instance restarts after a crash, it no longer participates to any currently active lock.
Or read this on Hacker News