Level 3: Distributed systems · L3.1 Time, clocks, consensus & leader election
Locks, leases and fencing tokens
Use leases with fencing tokens and know when a Redis lock is unsafe.
12 min · Pro
What you take away
- A distributed lock is a lease, and the holder can be paused past its expiry without noticing.
And 3 more inside the class, in Pro.
How the class is laid out
- The problem
- The simple version
- The two reasons to take a lock
- Fencing makes it safe
- When the resource cannot check
- Clocks lie
- Logical clocks
- Consensus
- Raft
- Locks
- Check your understanding