Skip to content

Coordination & Consistency

Leadership, fencing, stale-write rejection, lease-based conflict resolution.

When to read this section

You have multiple processes that need to agree on something — who is the leader, whose write wins, when a stale epoch should be rejected. The naive approach (consensus library, paxos / raft cluster) is a lot to operate. These recipes use the lease primitive as the coordination primitive: a fenced lease IS the leadership, and a stale-epoch write IS a typed refusal.

Suggested order

  1. Real-Time Collaboration With Lease-Based Conflict Resolution — the smallest “I need a leader” program. Shows fencing semantics in code.
  2. Stale-Write Rejection in Distributed Leader Election — adds the typed-refusal behavior on stale writes. Read this once your leader recipe is solid.

What’s not here

This is a small section by design. Coordination patterns appear across the cookbook tagged fencing and revocation; the two recipes here are the load-bearing distributed-coordination basics. For application-layer revocation (a tenant’s GPU lease being reclaimed mid-decode, for example), see GPU & Inference / revocation and recovery.