Semicolony ELI5 · comic

Distributed lock.

A single key, held across machines, that lets only one of them touch a shared thing at a time.

  1. shared three machines, one thing
    1

    Many machines, no shared memory — yet only one should touch the shared thing.

  2. lock store
    2

    So you keep a single key in a store every machine can reach.

  3. Got it — mine.
    waiting… waiting…
    3

    Whoever grabs the key gets exclusive permission; the rest wait or back off.

  4. a lease, not forever — TTL
    4

    The key is a lease, not forever: it auto-expires unless the holder keeps renewing.

  5. …wait, still mine?
    stalled expired — handed on
    5

    The danger: a holder stalls past expiry, so the lease is handed on while it still thinks it holds it.

  6. resource seen: 24 #23 stale token refused
    6

    A fencing token fixes it: each grant gets a higher number, and the resource refuses any stale one.

One key, held across machines, so only one of them touches the shared thing at a time.
Semicolony semicolony.dev/eli5/distributed-lock/comic
← All ELI5 explainers