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
- 01Authoritative patchbay state: Transitions via
topology.update(group, fn)commit atomically inside the coordinator's SQLite database before any external publish runs. - 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.
- 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.
- 04Version-fenced member state channels: Named
stateschannels deliver monotonicTopologyStateUpdate<T>payloads to member shards so stale deliveries are cleanly ignored.
Storage
SQLite + Published Snapshot
Alarm
Shared DurabilityScheduler
Import
durability/experimental