Distributed Lock
A coordination mechanism that attempts to provide mutually exclusive ownership of a logical resource across multiple processes or machines.
Distributed-Systems Context
A distributed lock coordinates exclusive ownership of a logical resource across processes or machines. A robust design defines owner identity, lease or expiry behavior, crash recovery, and what happens when a stale owner resumes. Fencing tokens are especially important when the protected resource can accept writes after ownership changes.
Failure-Model Boundary
Writing a key with SETNX is not a complete distributed-lock protocol under every failure model. Network partitions, process pauses, clock assumptions, and resource-side validation must be considered.