April 2026 • Rich Robertson

Distributed Locks vs. Leases vs. Leader Election

This page is about concept clarification and tradeoffs. It is not a deep failure-mode analysis. Use this page to choose the right coordination primitive before implementation details.

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

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

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

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.