← Lessons

quiz vs the machine

Gold1430

Databases

The Leader Lease

A time bounded promise that lets a leader serve reads locally without a quorum round trip, as long as its clock has not drifted too far.

5 min read · core · beat Gold to climb

The Problem With Local Reads

In a consensus system a leader cannot safely answer a read from memory. A new leader might have been elected in a partition, making the old leader stale. Confirming leadership on every read with a quorum round trip is correct but slow.

A Lease Fixes the Cost

A leader lease is a promise from followers that they will not elect a new leader for a fixed duration. Once a leader holds a valid lease it can serve reads locally, because no rival leader can exist during that window.

  • Followers grant the lease when they vote or acknowledge heartbeats.
  • The leader renews it with regular heartbeats before it expires.
  • If renewal fails, the leader stops serving reads when the lease lapses.

The Clock Caveat

The lease relies on bounded clock drift. The leader must treat the lease as expired slightly early to cover the worst case skew between its clock and the followers. Get that margin wrong and two leaders could both believe they hold a lease, breaking consistency.

Key idea

A leader lease lets a leader serve fast local reads without a quorum, trusting bounded clock drift and renewing heartbeats to stay safe.

Check yourself

Answer to earn rating on the learn ladder.

1. What does a leader lease let the leader do?

2. What assumption makes the leader lease safe?

3. Why must the leader treat the lease as expiring slightly early?