Distributed Lease
ELI5 - The Vibe Check
A distributed lease is a time-limited 'I've got this' claim that one node takes out on a resource or a role, like being the leader, so everyone else knows to back off, but only for a set period. If the lease holder doesn't renew it in time, maybe because it crashed or froze, the lease expires and someone else can safely take over. It's like a library due date: you get exclusive access, but only until the clock runs out.
Real Talk
A distributed lease grants a node time-bounded exclusive ownership of a role or resource, backed by a coordination service such as ZooKeeper, etcd, or Consul, requiring periodic renewal before expiry to retain ownership. Leases enable safe leader election and mutual exclusion without permanent locks that could deadlock a cluster if the holder dies, but they're vulnerable to clock skew and process pauses (like a long garbage collection pause) that can cause a node to believe it still holds a lease after it has actually expired.
When You'll Hear This
"The leader lease expired during the GC pause, and for a moment we had no elected leader at all." / "We renew the lease every 5 seconds with a 15-second TTL to survive brief network blips."
Related Terms
Clock Skew
Every server has its own clock, and those clocks drift apart from each other over time, sometimes by milliseconds, sometimes by embarrassingly more if NTP...
Consensus Algorithm
A consensus algorithm is how a group of servers democratically agree on something even when some of them are flaky or unreachable.
Fencing Token
Say a node holds a lease, but then it freezes for a while, its lease quietly expires, and a new leader takes over, and THEN the frozen node wakes back up...
Quorum
A quorum is the minimum number of nodes that must agree before a distributed system trusts a decision, whether that's electing a leader or confirming a wri...
Split Brain
Split brain is when a network hiccup cuts a cluster of servers in half, and both halves, unable to talk to each other, each decide they're the boss and kee...