FIG_003 [ FANOUT ]
FIG_003 // Interactive Cutaway durability

DurabilityFanout

Durable acceptance in one SQLite transaction with independently retried per-target deliveries.

FIG_003 [ DURABILITY_FANOUT ] 1 TX // 1→N TUBES
1 TX Accept (3 Pins) 2 1→3 Tube Fanout 3 Isolated Settle / DLQ
1 / 4
READY: Click any right-side receiver bell to jam/unjam it live, or trigger a scenario below to see 1→3 isolation.
SQLITE TX AIRLOCK SET_ALARM() IDLE BATCH #1042 PURGED ✓ key: b-1042 • 3 targets durability_fanout_messages OBL 1 // CONSUMER 1/5 SETTLED (IDLE) PIN 1 • DELIVER() RPC OBL 2 // ARCHIVE 1/5 SETTLED (IDLE) PIN 2 • STORAGE() SINK OBL 3 // WEBHOOK 1/5 SETTLED (IDLE) PIN 3 • EXTERNAL HTTP durability_fanout_deliveries TO HOOK 1 // CONSUMER LIVE DELIVER() • WORKER RPC ✓ ACK() SETTLED 2 // ARCHIVE LIVE STORAGE() • IDEMPOTENT ✓ AUTO-ACK OK 3 // WEBHOOK LIVE DELIVER() • EXT HTTP ✓ ACK() SETTLED DLQ // QUARANTINE DLQ(ENTRY) • BY ID STANDBY (FLAP SHUT) MANIFEST ROW DEDUPE + 3 PINS DATA IN FANOUT.ENQUEUE() OBLIGATIONS 3 ISOLATED ROWS SET_ALARM() SAME SQLITE TX CONSUMER RPC DELIVER() (CLICK) ARCHIVE SINK STORAGE() (CLICK) WEBHOOK EXT HTTP (CLICK) DLQ PAWL SQLITE PRE-COMMIT DLQ STORAGE RETRY DLQ ONLY
WHY FANOUT: 1 ATOMIC TX → 3 ISOLATED CONSUMERS (CLICK ANY BELL TO JAM LIVE)
SPEC // 03 [ ARCHITECTURE ]
01 // What it’s for

Why reach for DurabilityFanout

Use DurabilityFanout when every accepted message must reach multiple independent destinations (for example, a live consumer RPC, an archive sink, and an external webhook) where a slow or failing target must never block or roll back delivery to healthy targets.


02 // How it works

Inside your Durable Object

  1. 01Single atomic acceptance TX: enqueue() persists the message payload and one obligation row per configured target inside one ctx.storage.sql transaction—together with scheduling the object's single alarm.
  2. 02Isolated per-target delivery: Targets are invoked outside storage transactions; if Webhook returns 503, Consumer and Archive still settle cleanly while only Webhook backs off and retries.
  3. 03Shared scheduler cooperation: Retry timing delegates to the object's shared DurabilityScheduler, keeping multiple fanout channels multiplexed onto Cloudflare's one physical DO alarm.
  4. 04One-way DLQ quarantine: Once a target exhausts its retry budget, the undelivered obligation diverts to your dlq callback without holding up the rest of the queue.
Storage
ctx.storage.sql
Alarm
Shared DurabilityScheduler
Import
durability