# Durable beside DBOS

The shape: a durable-execution library. [Why Durable](https://durablesdk.com/why/vs/dbos) steps this walk
beat by beat; this page is the walk in prose, with the page each beat
reads under Sources, and [Compared](https://durablesdk.com/docs/compare.md) is the table of every
product.

## What DBOS gives, as its documentation describes

**A library on your database.** Annotated workflows and steps run inside your app; Postgres is the only required infrastructure, and the inputs, each step's output and the outcome are checkpointed there. [1][2][3][4]

**Deterministic workflow code.** Database access, external calls, randomness and the clock belong in steps. Parallel steps must be started in a deterministic order, reserved step ids the recommended way to hold it. A step whose result differs on replay throws a nondeterminism error at runtime. [5]

**Steps at least once, retries off.** A step is tried at least once and not re-executed once it completes; retries are off by default and set per step. An uncaught error ends the workflow in an error status DBOS does not recover on its own, left for a person to fork or rewind from a step. [5][6]

**A workflow id as the key.** Each execution has an id, a UUID unless you pass your own, and the id doubles as an idempotency key. A repeated id runs once and by default hands back a handle to the workflow already started; a reject policy throws instead. [5]

**Recovery across processes.** On one node interrupted workflows are picked up at startup; across several processes recovery relies on a control plane the app connects to, or a manual process. [1][3][7]

**Checkpoints under a retention policy.** A completed workflow's steps, inputs and outputs stay in the system database; a retention policy you set deletes completed history past a time or a row count, both off by default, and a running workflow is never deleted. [8][6][5]

## The same work under Durable

**Also a library on your Postgres, with no process to keep up.** The one moving part outside the request path is a minute cron; nothing stays resident for the scheduler, the queue or recovery, and the cron minute is the fallback for every wake.

**The key is derived from the input.** `key: ["orderId", "requestId"]`: you name the fields of the input and the engine derives the key, one run per intent; a key that reads the clock is refused before a deploy, never minted as a UUID at runtime.

**The images, then the undos in reverse.** A write reads before it writes and leaves the image it found and the image it left on an append-only, hash-chained ledger; the step declares its undo beside its effect or says why it cannot. The completed steps' undos run in reverse, each its own row, and the run waits in limbo for a person after bounded redrives of a transient cause; a redrive reads the world before it writes.

**Before the deploy.** The same discipline holds, a step the one place a body reads the world. `durable-sdk doctor --host` runs every rule over the tree offline before a deploy, a failed rule one line with its id and its fix; a nondeterministic body there is an error thrown at runtime.

**The agent asks the graph.** `durable-sdk explain <workflow>` prints what the door admits, every step with its undo and its writes, the facts and who listens; `durable-sdk graph walk <subject>` prints the closure from any node; `durable-sdk graph impact --changed` prints what a change reaches before it is made. Offline, over a committed index: an AI coding agent asks before it edits, never guesses.

**Nothing to write but the steps.** No retry switch per step, no patch marker, no control plane; `durable-sdk ledger verify --file <export>` walks the ledger's export offline, and the console reads runs, steps with their images, limbo, facts and limits from your own database.

## What you write yourself

| What you write yourself              | DBOS                                                                                                                                                                                                                                                                                                                                                        | Durable                                                                             |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| A library on your database           | An app that stays up, since its own processes poll the queues, fire the schedules and recover at their own restart. With several servers, each recovers its own workflows by executor id, or its control plane tells one to recover another's. A direct connection to its database, or a pooler in session mode.                                            | the same library, with no process kept up and no control plane; a minute cron       |
| Deterministic workflow code          | That discipline in every workflow function, a slip learned at runtime when a replay's step result differs.                                                                                                                                                                                                                                                  | a step the one place a body reads the world; the doctor holds it before a deploy    |
| Steps at least once, retries off     | Idempotent steps, the retry settings on each step, and the watch on errored workflows through the management tooling.                                                                                                                                                                                                                                       | a provider write reads before it writes; bounded redrives, then limbo with the rows |
| A workflow id as the key             | The id itself, computed from the intent by you and passed at the start, so a resend finds the run it already made.                                                                                                                                                                                                                                          | the intent key derived from the input's fields, never minted at runtime             |
| Recovery across processes            | The control plane's connection, or an executor id in each process's configuration. On a breaking change, a patch statement in the code, with the application version pinned so new processes still recover the old runs. Or else a new version, computed from the source by default, with the old version's processes kept up until their workflows finish. | a parked run is rows; the cron minute the fallback for every wake                   |
| Checkpoints under a retention policy | Any undo of a completed step: a step's own handling is retries and a timeout, and a restart resumes from the last completed step with its return value as the checkpoint. The before image of your own data as well, since the checkpoint is the value the step returned.                                                                                   | the undo declared on the step, each a ledger row; the ledger never pruned           |

When DBOS wins: a team in Python, Go or Java, throughput past one Postgres server with the sharding to carry it, and a control plane that recovers a dead process's runs, sizes the fleet and forks a run from any step.

## Sources

1. https://docs.dbos.dev/architecture
2. https://docs.dbos.dev/typescript/tutorials/scheduled-workflows
3. https://docs.dbos.dev/production/workflow-recovery
4. https://docs.dbos.dev/production/checklist
5. https://docs.dbos.dev/typescript/tutorials/workflow-tutorial
6. https://docs.dbos.dev/typescript/tutorials/step-tutorial
7. https://docs.dbos.dev/typescript/tutorials/upgrading-workflows
8. https://docs.dbos.dev/conductor/retention

---

Prompt for an agent:

```text
Read https://durablesdk.com/docs/compare/dbos.md, then decide between Durable and DBOS for a keyed multi-step job that outlives a request; run durable-sdk doctor --host before and after; a refused line is a refusal id: durable-sdk explain <id>
```
