blog-post-how-to-do-distributed-locking

http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html

blog-post-how-to-do-distributed-locking#purpose-of-locks1

Efficiency: Taking a lock saves you from unnecessarily doing the same work twice (e.g. some expensive computation). If the lock fails and two nodes end up doing the same piece of work, the result is a minor increase in cost (you end up paying 5 cents more to AWS than you otherwise would have) or a minor inconvenience (e.g. a user ends up getting the same email notification twice).

Correctness: Taking a lock prevents concurrent processes from stepping on each others' toes and messing up the state of your system. If the lock fails and two nodes concurrently work on the same piece of data, the result is a corrupted file, data loss, permanent inconsistency, the wrong dose of a drug administered to a patient, or some other serious problem.

blog-post-how-to-do-distributed-locking#purpose-of-locks1

blog-post-how-to-do-distributed-locking#more-complicated-than-mutex

a lock in a distributed system is not like a mutex in a multi-threaded application. It's a more complicated beast, due to the problem that different nodes and the network can all fail independently in various ways.

blog-post-how-to-do-distributed-locking#more-complicated-than-mutex

Refers to paper-chubby-lock-service

Referring Pages

article-redlock blog-post-is-redlock-safe

People

person-martin-kleppmann