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
- 01Single atomic acceptance TX:
enqueue()persists the message payload and one obligation row per configured target inside onectx.storage.sqltransaction—together with scheduling the object's single alarm. - 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.
- 03Shared scheduler cooperation: Retry timing delegates to the object's shared
DurabilityScheduler, keeping multiple fanout channels multiplexed onto Cloudflare's one physical DO alarm. - 04One-way DLQ quarantine: Once a target exhausts its retry budget, the undelivered obligation diverts to your
dlqcallback without holding up the rest of the queue.
Storage
ctx.storage.sql
Alarm
Shared DurabilityScheduler
Import
durability