Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
distributed_computing:locks [2017/09/09 11:34] – angelegt phreazer | distributed_computing:locks [2017/09/09 12:30] (current) – phreazer | ||
---|---|---|---|
Line 3: | Line 3: | ||
Locks, mutexes, semaphores, monitors are usually associated with concurrent programming. But exclusive resource access is also needed in distributed environments, | Locks, mutexes, semaphores, monitors are usually associated with concurrent programming. But exclusive resource access is also needed in distributed environments, | ||
+ | ====== Locking service ====== | ||
+ | When having multiple instances of a service, it needs to be ensured that the action is performed only by one instance. | ||
+ | A leader will be elected, and failure needs to be detected and dealt with. Consensus algorithm like Paxos exist. | ||
+ | A separate locking service could be build, which is able to manage locks. The service needs a strongly consistent datastore, which holds information about the lock (who holds it, how long) and there needs to be logic to deal with failures. | ||
+ | |||
+ | ====== Implementations ====== | ||
+ | |||
+ | * Distributed locking with Zoo-Keeper: https:// | ||
+ | * Hashicorp Consul: https:// | ||
+ | * Google Chubby | ||
+ | * Distributed locks with Redis: https:// | ||
+ | * Not recommended when lock should be used for guarantee correctness (http:// | ||
+ | * Relational database | ||
+ | * Fencing tokens | ||
+ | * Linearizable writes | ||
+ | * Writes should appear to be instantaneous. Once a write completes, all later reads should return the value of that write or the value of a later write. Once a read returns a particular value, all later reads should return that value or the value of a later write. |