Build a Distributed Lock

fencing tokens and leases

Challenge 1 of Coordination & ConsensusAdvanced~60 minFree

Build the coordination primitive behind leader election and exclusive access: mutual exclusion with owner tokens, self-expiring leases so a crashed holder can't deadlock the system, monotonic fencing tokens that stop stale writers, lease renewal for long jobs, and a Redlock-style quorum across N nodes.

5 steps

  1. 1Mutual Exclusion
  2. 2Self-Expiring Leases
  3. 3Fencing Tokens
  4. 4Renewing the Lease
  5. 5Redlock Quorum
Start step 1