Durability starts with a recovery record
Effect is not BEAM. Fibers do not provide private process heaps or OTP restart strategies. A durable operation needs storage and a recovery owner.ΒΆ
Use the durability skill to review a design. The durability system page10 shows the patterns rat-stack ships. These pages separate the book principles from our Effect API mappings.ΒΆ
The mappings were written and checked against Effect 4.0.0. The template now pins Effect 4.1.2, and the mappings have not been re-audited against it. Check your own Effect pin before you apply a mapping.ΒΆ
Reading order
- Effect is not BEAM9: Fibers share a runtime; scope35 ownership does not supply isolated heaps or OTP restart strategies.ΒΆ
- Durable work needs storage16: A restarted worker60 cannot recover intent that existed only in memory.ΒΆ
- Every task needs an owner9: Give child work a lifetime, a failure observer, and a recovery decision.ΒΆ
- Supervision chooses what restarts11: Restart policy follows dependency shape and bounds repeated recovery.ΒΆ
- Restart must reconstruct known state9: Execution recovery and state recovery need separate contracts.ΒΆ
- Retry needs idempotent effects15: Repeating an operation must preserve its intended observable result.ΒΆ
- Checkpoints follow the promised commit10: Persist state and progress together when one store can transact both.ΒΆ
- Replay needs stable inputs9: Historical processing must not silently depend on todayβs clock or external decisions.ΒΆ
- Old events must still decode9: Retained data needs compatibility rules before recovery depends on it.ΒΆ
- Dead letters need a return path15: Exhausted work needs durable evidence, an owner, and deliberate redrive15.ΒΆ
- Timeouts bound waiting20: A local timeout20 stops waiting; it does not prove the remote action never happened.ΒΆ
- Retry load needs a budget10: One retry owner must control attempts, delay, and aggregate load.ΒΆ
- Circuit breakers have state10: A breaker stops doomed calls and controls probes before restoring traffic.ΒΆ
- Bulkheads isolate scarce capacity10: Reserve independent capacity for workloads that must not starve each other.ΒΆ
- Backpressure reaches the producer10: Bounded consumption helps only when upstream respects waiting or refusal.ΒΆ
- Admission control protects recovery10: Refuse or defer work that cannot be served usefully under current load.ΒΆ
- Steady state recycles resources9: Every accumulation needs a deliberate recycling policy.ΒΆ
- Queries need result bounds7: Limit result cardinality7 before the driver materializes an oversized response.ΒΆ
- Failures keep their meaning10: Expected refusals, infrastructure faults, and defects need different policies.ΒΆ
- Cleanup can be an idempotent postcondition10: Already-absent state can be success when absence is the operationβs intended result.ΒΆ
- Pure cores reduce timeline coupling9: Move deterministic rules out of time-dependent actions and shared mutable state.ΒΆ
- Recovery needs model tests10: Test sequences of failures and recoveries against explicit invariants.ΒΆ
- Golden signals expose overload9: Measure latency, traffic, errors, and saturation, including failed work.ΒΆ
- Shared schemas need a transition period7: Keep old and new representations usable while consumers migrate.ΒΆ
- Durable timers need recovery7: Persist scheduled intent when losing a worker must not lose its deadlines.ΒΆ
- Request lifetime is not durability9: Worker
waitUntilhas a shared post-response allowance; required work needs a durable marker and redrive.ΒΆ
Existing rat-stack paths
- Scopes release resources when work ends35.ΒΆ
- Concurrent work needs an owner23.ΒΆ
- Lifecycles are machines27.ΒΆ
- Queues, Pipelines, Workflows and K2 do different jobs8.ΒΆ
- The error model38.ΒΆ
- Schemas define the boundary30.ΒΆ
- Accumulate independent errors10.ΒΆ
- Cache completed values8.ΒΆ
- Layers make dependencies explicit21.ΒΆ
- Property-based testing22.ΒΆ
- Uncomplect.ΒΆ
- Add a lifecycle machine.ΒΆ
- Investigate a failure.ΒΆ
Sources
Read the durability bibliography33 for books, sections, and checked short quotations. API names describe the Effect 4.0.0 source.ΒΆ
Sources
- Gray II, James Edward; Tate, Bruce A. Designing Elixir Systems with OTP. Pragmatic Bookshelf, 2019.. Pragmatic Bookshelf. Build a Functional Core; Isolate Process Machinery in a Boundary; Customize Your Lifecycle; Big, Loud Worker-Bees; Add Persistence as a Boundary Service; Test the Boundary. Accessed 2026-10-23.
- Nygard, Michael T. Release It!: Design and Deploy Production-Ready Software. Pragmatic Bookshelf, 2007.. Pragmatic Bookshelf. Β§4.4 Unbounded Result Sets; Chapter 5 Stability Patterns: Β§5.1 Timeouts, Β§5.2 Circuit Breaker, Β§5.3 Bulkheads, Β§5.4 Steady State, Β§5.5 Fail Fast, Β§5.6 Handshaking, Β§5.7 Test Harness, Β§5.8 Decoupling Middleware. Accessed 2026-10-23.
- Effect contributors. Effect 4.0.0. workflow/WorkflowEngine.ts. Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.
Last changed 2026-11-08 in fa39fa0. Source on GitHub. Change log.
Linked from
- Admission control protects recovery. Refuse or defer work that cannot be served usefully under current load.
Return to the durability index.ΒΆ
- Agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
Durability starts with a recovery record β A reading order for storage, replay, worker ownership, overload, and recovery tests.
- Backpressure reaches the producer. Bounded consumption helps only when upstream respects waiting or refusal.
Return to the durability index.ΒΆ
- Bulkheads isolate scarce capacity. Reserve independent capacity for workloads that must not starve each other.
Return to the durability index.ΒΆ
- Change log. What changed in the files served here, newest first.
Durability starts with a recovery record β new page: Initial commit from joelhooks/rat-stack template
- Checkpoints follow the promised commit. Persist state and progress together when one store can transact both.
Return to the durability index.ΒΆ
- Circuit breakers have state. A breaker stops doomed calls and controls probes before restoring traffic.
Return to the durability index.ΒΆ
- Cleanup can be an idempotent postcondition. Already-absent state can be success when absence is the operationβs intended result.
Return to the durability index.ΒΆ
- Concurrent work needs an owner and a bound. Limit active work, retain result order, and stop child work when its owning lifetime ends.
For work that must survive a crash, read every task needs an owner and the durability index.ΒΆ
- Dead letters need a return path. Exhausted work needs durable evidence, an owner, and deliberate redrive.
Return to the durability index.ΒΆ
- durability. Keep a rat-stack app standing when a provider, pool, or dependency slows down or a worker dies. Use at any I/O boundary, connection pool, provider call, shared waiter, fan-out, flag, gate, or work that can outlive a request, or when asked "what happens when this is slow", "add a timeout", "make this durable", or "what survives a crash".
The durability index gives the reading order.
- Durability bibliography. Books, checked short quotations, source limits, and Effect mapping provenance.
Return to the durability index.ΒΆ
- Durable timers need recovery. Persist scheduled intent when losing a worker must not lose its deadlines.
Return to the durability index.ΒΆ
- Durable work needs storage. A restarted worker cannot recover intent that existed only in memory.
Return to the durability index.ΒΆ
- Effect is not BEAM. Fibers share a runtime; scope ownership does not supply isolated heaps or OTP restart strategies.
Return to the durability index.ΒΆ
- Every task needs an owner. Give child work a lifetime, a failure observer, and a recovery decision.
Return to the durability index.ΒΆ
- Failures keep their meaning. Expected refusals, infrastructure faults, and defects need different policies.
Return to the durability index.ΒΆ
- Full agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
- Golden signals expose overload. Measure latency, traffic, errors, and saturation, including failed work.
Return to the durability index.ΒΆ
- Old events must still decode. Retained data needs compatibility rules before recovery depends on it.
Return to the durability index.ΒΆ
- Pure cores reduce timeline coupling. Move deterministic rules out of time-dependent actions and shared mutable state.
Return to the durability index.ΒΆ
- Queries need result bounds. Limit result cardinality before the driver materializes an oversized response.
Return to the durability index.ΒΆ
- Queues, Pipelines, Workflows and K2 do different jobs. Pick a Cloudflare product for work outside a request by the unit you track: a message, a row, a step, or a record in a log.
Next, read Durable work needs storage, then the durability index.ΒΆ
- Rat Stack lore | rat-stack. Short, source-grounded notes on the ideas and decisions behind rat-stack.
Durability starts with a recovery record β A reading order for storage, replay, worker ownership, overload, and recovery tests.
- Recovery needs model tests. Test sequences of failures and recoveries against explicit invariants.
Return to the durability index.ΒΆ
- Replay needs stable inputs. Historical processing must not silently depend on todayβs clock or external decisions.
Return to the durability index.ΒΆ
- Request lifetime is not durability. Worker waitUntil has a shared post-response allowance; required work needs a durable marker and redrive.
Return to the durability index.ΒΆ
- Restart must reconstruct known state. Execution recovery and state recovery need separate contracts.
Return to the durability index.ΒΆ
- Retry load needs a budget. One retry owner must control attempts, delay, and aggregate load.
Return to the durability index.ΒΆ
- Retry needs idempotent effects. Repeating an operation must preserve its intended observable result.
Return to the durability index.ΒΆ
- Shared schemas need a transition period. Keep old and new representations usable while consumers migrate.
Return to the durability index.ΒΆ
- Source change history (log.md). The generated change log as Markdown.
Durability starts with a recovery record β new page: Initial commit from joelhooks/rat-stack template
- Steady state recycles resources. Every accumulation needs a deliberate recycling policy.
Return to the durability index.ΒΆ
- Supervision chooses what restarts. Restart policy follows dependency shape and bounds repeated recovery.
Return to the durability index.ΒΆ
- Timeouts bound waiting. A local timeout stops waiting; it does not prove the remote action never happened.
Return to the durability index.ΒΆ