FIG_008 [ TOPOLOGY ]
FIG_008 // Interactive Cutaway durability/experimental

DurabilityTopology

Authoritative shard membership with published zero-hop reader snapshots and version-fenced state push.

FIG_008 [ DURABILITY_TOPOLOGY ] SNAP // 0-HOP
1 TX update() 2 Outbox Publish Lamp 3 Zero-Hop Read / State
1 / 6
READY (SNAP v7): Click any Brass Plug Jack on the Patchbay to cycle ACTIVE → DRAINING → REMOVED, or push version-fenced state channels & repair slow writes.
COORDINATOR DO 1 TX SHARD 0 WRITES + READS ACTIVE SHARD 1 WRITES + READS ACTIVE SHARD 2 WRITES + READS ACTIVE UPDATE() SNAP v7 SEALED STATE DIAL limits v3 SQLITE TX // INTERNAL durability_topology_groups v7 durability_topology_writes CLEAN outbox: durability.topology IDLE OUTBOX PUT() PUBLISHED SNAPSHOT DETACHED READ STORE v7 • ENCODED COORD: #A1 S0 W+R S1 W+R S2 W+R LANDING DEADLINE CLEAN ✓ durability_topology_writes UNCONDITIONAL STORE • 0 DUE 0 COORD HOPS READER WORKERS TOPOLOGY.CLIENT LOCAL CACHE CACHE v7 MONOTONIC FENCE ✓ WRITE TARGETS ACTIVE [S0, S1, S2] ACTIVE LAMPS ONLY READ TARGETS ACT+DRN [S0, S1, S2] ACTIVE + DRAINING DETACHED SNAPSHOT READ PATH • ZERO COORDINATOR CALLS OUTBOX STATE PUSH APPLY IF v > CUR SHARD 0 WRITE+READ limits v3 ✓ APPLIED • FENCE v3 MEMBER DO • RECEIVING SHARD 1 WRITE+READ limits v3 ✓ APPLIED • FENCE v3 MEMBER DO • RECEIVING SHARD 2 WRITE+READ limits v3 ✓ APPLIED • FENCE v3 MEMBER DO • RECEIVING BRASS PATCHBAY CLICK JACKS (3) UPDATE() LEVER SNAP + STATE DIAL SQLITE TX GROUPS + WRITES MEMBER SHARDS STATE CHANNEL DOs JEWEL LAMP BOARD DETACHED SNAPSHOT CLIENT CACHE MONOTONIC FENCE ZERO-HOP ROUTES W=ACT • R=ACT+DRN LANDING DEADLINE REPAIR SLOW WRITE STATE CHANNEL VERSION-FENCED SHARD MEMBERS APPLY IF v > CUR
GUARANTEE: READERS NEVER CALL COORDINATOR • VERSION-FENCED STATE CHANNELS
SPEC // 08 [ ARCHITECTURE ]
01 // What it’s for

Why reach for DurabilityTopology

Use DurabilityTopology when a coordinator Durable Object owns which shards exist for a group (active, draining, removed) and needs Workers to discover membership with zero hops to the coordinator—while also pushing shared config/limits out to member shards reliably.


02 // How it works

Inside your Durable Object

  1. 01Authoritative patchbay state: Transitions via topology.update(group, fn) commit atomically inside the coordinator's SQLite database before any external publish runs.
  2. 02Detached published snapshot: Encoded snapshots are pushed to an external read store (such as KV or R2) so Reader Workers learn membership directly without hitting the coordinator DO.
  3. 03Landing deadline repair: If a snapshot write fails or stalls, the shared scheduler retries automatically until the published board matches the coordinator's committed epoch.
  4. 04Version-fenced member state channels: Named states channels deliver monotonic TopologyStateUpdate<T> payloads to member shards so stale deliveries are cleanly ignored.
Storage
SQLite + Published Snapshot
Alarm
Shared DurabilityScheduler
Import
durability/experimental