Part of the Distributed Coordination series.
Start here: What Is a Distributed Lock? (With Examples)
Definitions
Distributed lock: ownership claim for a scoped critical section.
Lease: time-bounded ownership with renewal/expiry behavior.
Leader election: current coordinator authority for a group/partition.
In practice, teams conflate these because many platforms expose them through similar APIs. The semantics differ most under failure, not during happy-path execution.
What each gives you
- Lock gives mutual exclusion intent for one scope.
- Lease gives recoverability through timeout-based turnover.
- Leader election gives coordination authority for broader workflows.
A useful framing: lock is a local permission, lease is permission with decay, and leader election is role assignment for a group lifecycle. Mixing these concepts usually produces ambiguous ownership boundaries.
What each does not give you
- Lock does not automatically reject stale writes.
- Lease does not terminate paused processes.
- Leader election does not guarantee write-path correctness by itself.
Correctness must be enforced at the write boundary. None of these primitives removes that requirement.
Operational consequences
Cron ownership usually needs lease behavior. Maintenance leadership usually needs election semantics. Control-plane writes usually need election plus storage-level validation.
Real-world consequence: teams using leader election for control-plane authority often still need per-resource lock or version checks to avoid concurrent mutation between long-running handlers.
Production story: one platform elected a new maintenance leader after timeout, but the old leader resumed after transient stall and continued drain operations. Election was correct; side-effect authorization was not scoped tightly enough.
Choose by workload shape
- Cron ownership: lock/lease.
- Maintenance leadership: leader election.
- Control-plane mutation authority: election + write validation contracts.
Why this breaks in real systems
GC pauses can exceed renewal windows, network delays skew heartbeat visibility, clock drift narrows safe lease margins, and stalled processes resume late with stale authority. These timing effects are exactly where lock, lease, and election semantics diverge.
Two processes can believe they own the lock. The primitive alone does not resolve that at mutation time.
What to Read Next
→ Read next: Distributed Lock Failure Modes in Production.