Labs โ€บ distributed lock and leader election0 / 13

Step 1 of 13 ยท Intro

Design a distributed lock and leader election

Mutual exclusion that survives crashes, pauses and failovers.

How it works

  • โ€บAcquire: a client gets a lease and a fencing token if the lock is free.
  • โ€บRenew: the holder heartbeats before the lease expires.
  • โ€บElect: a leader is just the holder of a well-known lock, with a term that increases.

What you'll build

  1. The API (acquire, renew, release) and the lock schema
  2. A replicated, consensus-style store that survives losing the leader
  3. A sharded namespace for 30,000 requests a second
  4. A limiter and a breaker against herds and cold caches
  5. Reasoning about leases, fencing tokens and durability