01 // What it’s for
Why reach for DurabilityLog
Use DurabilityLog when multiple independent consumers need their own offset positions, ordered replay, or parallel batch leasing over a partition's history—without provisioning Kafka or an external streaming cluster.
02 // How it works
Inside your Durable Object
- 01Deduplicated offset rail:
append()assigns strictly monotonic offsets inctx.storage.sqland deduplicates retried writes by optional key. - 02Independent consumer cursors: Each named consumer tracks and commits its own offset cursor independently without slowing down or affecting other readers.
- 03Contiguous lease fencing: Parallel workers can
lease()non-overlapping ranges; the committed high-water cursor advances contiguously and refuses to leap over an unsettled gap. - 04Cold-first explicit retention: The log sets zero automatic alarms—when your code calls
trim(), hot records flush safely to your optionalcold.writestore before SQLite deletion, remaining transparently readable viacold.read.
Storage
SQLite + Optional Cold Store
Alarm
None (explicit trim())
Import
durability