FIG_005 [ ROUTING ]
FIG_005 // Interactive Cutaway durability/routing

DurabilityRouting

Advisory load observation and application-owned shard selection across Durable Object shards.

FIG_005 [ DURABILITY_ROUTING ] POW-2 // 60x1S
1 Push → Cache 2 Seek → Invoke 3 result.load → Sync
1 / 5
READY: Watch a write enter the left Intake Port, read the Isolate Cache for Pow-2, write to the winning track, and carry result.load back.
S0 S1 S2 S3 W=2 S0 vs S1 → S0 CACHED PENDING S0 220 S1 380 S2 — S3 — │ = 1,000 LIMIT DATA IN ROUTING.PUSH() SHARDING PIVOT GET_BY_NAME() INVOKE() ARM WRITE + LOAD PULSE ISOLATE CACHE 1,024 MAX • IN-MEM HEAD PARK RAMP NO SILENT FAILOVER SHARD TRACKS ADAPTIVE W=1..4 60x1S BUCKETS IN-MEM • EVICTABLE SPINDLE HUB SOFT_LIMIT = 1,000 PENDING ROWS DURABLE SQLITE ARC
ADAPTIVE WIDTH: W = 2 • SOFT LIMIT: 1,000 • CACHE: ISOLATE-LOCAL (1,024 CAP)
SPEC // 05 [ ARCHITECTURE ]
01 // What it’s for

Why reach for DurabilityRouting

Use DurabilityRouting when a single Durable Object becomes a write or concurrency hotspot and you want to fan incoming work across N independent shards without introducing an external router, queue service, or global registry. Each shard stays an ordinary Durable Object with its own SQLite storage.


02 // How it works

Inside your Durable Object

  1. 01Zero extra infrastructure: Inside each shard, DurabilityRouting owns zero tables and zero alarms—it simply tracks in-flight work and 60 one-second timing buckets in isolate memory.
  2. 02Isolate-local cache & Power-of-Two: The calling Worker caches each shard's latest load snapshot in memory and picks the lighter of two candidates within the current adaptive shard width (W = 1..N).
  3. 03Feedback on the return path: Every RPC response carries a fresh result.load snapshot straight back to the caller so routing converges immediately without extra probe hops.
  4. 04No silent failover: If a chosen shard fails or errors, the caller receives the error directly rather than silently duplicating state onto another shard.
Storage
None (in-memory buckets)
Alarm
None (0 alarms)
Import
durability/routing