FIG_007 [ OUTBOX ]
FIG_007 // Interactive Cutaway durability/experimental

DurabilityOutbox

Transactional latest-state convergence with coalesced 1-slot staging and monotonic version fencing.

FIG_007 [ DURABILITY_OUTBOX ] SEQ // CHECK-VALVE
1 TX Stage (Coalesce) 2 Swing Check-Valve 3 Ratchet + Gen Ack
1 / 6
STEADY: Stage rapid updates to watch 1-slot coalescing, fire a concurrent stage to test generation fencing, or slam a stale v40 into the check-valve.
GEN FENCE • NO DLQ TX BONNET CAP SEATED v45 APP STATE TABLE v42 COMMITTED ✓ BATCH_DELAY WINDOW 1-SLOT GEN 1 EMPTY 0 SKIPPED durability_outbox 1 TX 0 4 2 durability_outbox_seq VERSION SINK LIVE v42 KEEP MAX(VERSION) ✓ SYNCED v42 APP TABLE SAME SQLITE TX DATA IN TX.STAGE(K, VAL) OUTBOX SLOT 1 ROW • COALESCES SEQ ODOMETER MONOTONIC FOREVER SWING VALVE OPENS ► / SLAMS ◄ VERSION SINK KEEP MAX(V) (CLICK) 1-WAY RATCHET ZERO REGRESSIONS GEN FENCE ACK RETRIES FOREVER
GUARANTEE: LATEST-STATE CONVERGENCE • NO DLQ (RETRIES FOREVER)
SPEC // 07 [ ARCHITECTURE ]
01 // What it’s for

Why reach for DurabilityOutbox

Use DurabilityOutbox when downstream projections only need the latest committed version of each key—never every intermediate edit. Because stage() lives in the same SQLite database as your application tables, your state and publication intent commit or roll back as a single atomic unit.


02 // How it works

Inside your Durable Object

  1. 01Rigid 1-TX coupling: Call outbox.stage(key, value) inside ctx.storage.transaction() right next to your own SQL writes—if the transaction aborts, nothing leaks to the outbox.
  2. 021-slot latest-state coalescing: Rapid updates to the same key overwrite the pending slot and bump the monotonic durability_outbox_seq odometer, skipping intermediate writes during batchDelayMs or outages.
  3. 03Generation & version fencing: Every publication carries its monotonic version; sinks keep the highest version seen so a delayed retry of an older version can never clobber newer state.
  4. 04Selective per-entry retry: Returning from publish(entries) acknowledges every entry except those explicitly marked via entry.retry().
Storage
durability_outbox + _seq
Alarm
Shared DurabilityScheduler
Import
durability/experimental