Skip to content
StackDecode
System Design
18. Advanced Distributed ArchitectureAnimated

Distributed Lock Managers

Services granting locks across nodes.

The idea

Lock managers use consensus and leases so locks survive failures.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

Client AClient BLock serviceacquire "job-42" (lease 10s)
  • current message
  • earlier
  • failure or attack

A asks for the lock with a time-limited lease.

step:
1/7
from:
Client A
to:
Lock service
1/7

Time runs downward. Solid arrows are requests, dashed arrows are replies.

Step by step

  1. 1Request a lock
  2. 2The manager grants it with a lease and token
  3. 3Holder works
  4. 4Release or expire

Where it is used

Exclusive access.

Watch out for

Fencing tokens are needed to stop stale holders.

Related