# Durable work needs storage

Principle `durable-work-needs-storage`. A restarted worker cannot recover intent that existed only in memory.

Also searched as: durability, durable intent.

A running server and a recovery record solve different problems. Choose what must survive termination and how the next worker finds it.

> Remember from chapters 8 and 9 that processes lose their state on termination.

Source: [Q02](/bibliography#q02); [B2](/bibliography#b2-elixir-in-action), [B3](/bibliography#b3-designing-elixir-systems-with-otp).

## Failure it prevents

The service restarts successfully while accepted work disappears.

## Our Effect 4.0.5 reading

Workflow, Activity, and WorkflowEngine describe resumable work. Choose persistent engine storage. WorkflowEngine.layerMemory keeps state only in memory.

Source: `packages/effect/src/workflow/Workflow.ts`, `packages/effect/src/workflow/Activity.ts`, `packages/effect/src/workflow/WorkflowEngine.ts`.

## How to check

Kill the worker after acceptance. Recover the same operation identity from the selected backend. This is our proposed verification, not a quoted procedure.

Continue with [Every task needs an owner](/principles/every-task-needs-an-owner), [Checkpoints follow the promised commit](/principles/checkpoints-follow-commits).

Connect this to [the existing rat-stack guidance](https://ratstack.sh/lore/concurrent-work-needs-an-owner).

Use [the durability skill](/skills/durability) for the full review. Return to [the durability index](/principles/durability).

## Skills
- [Durability starts with a recovery record](/principles/durability)

## Sources
- Jurić, Saša. *Elixir in Action*, Third Edition. Manning, 2024. [Link](https://www.manning.com/books/elixir-in-action-third-edition). ([b2-elixir-in-action](/bibliography#b2-elixir-in-action))
- Gray II, James Edward; Tate, Bruce A. *Designing Elixir Systems with OTP*. Pragmatic Bookshelf, 2019. [Link](https://pragprog.com/titles/jgotp/designing-elixir-systems-with-otp/). ([b3-designing-elixir-systems-with-otp](/bibliography#b3-designing-elixir-systems-with-otp))

## References
- [Effect contributors. Effect 4.0.5. workflow/Workflow.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/workflow/Workflow.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. workflow/Activity.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/workflow/Activity.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. workflow/WorkflowEngine.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/workflow/WorkflowEngine.ts). Pinned source for our Effect mapping, not a claim from the book.
