Search tldr

Postgres Transactions are a Distributed Systems Superpower

Co-locating durable workflow metadata and application data in Postgres lets both commit atomically, eliminating critical failure windows. DBOS uses this to offer exactly-once transactional steps and a simpler transactional-outbox pattern.

Share

Postgres Transactions are a Distributed Systems Superpower

Author: Peter Kraft and Qian Li | Published: 2026-06-15 | Generated: 2026-07-03 | Domain: dbos.dev
Tags: ‘#postgres’ ‘#durable-execution’ ‘#distributed-systems’ ‘#idempotency’ ‘#transactional-outbox’


TLDR

DBOS argues that workflow state should often live in the same Postgres database as application data, rather than in a separate workflow system. A shared transaction can atomically persist both a business-data update and workflow checkpoint, removing the retry window that produces duplicate effects; it can also atomically enqueue downstream workflow work, replacing much of the operational machinery of a conventional transactional outbox. This approach makes durable workflows simpler while retaining fault tolerance for database-backed operations.

Key Takeaways

  • Transactional steps provide exactly-once database effects: A step’s application-data updates and its workflow checkpoint are committed in one Postgres transaction. On commit, both persist; on failure before commit, both roll back and the step can safely rerun.
  • Durability alone does not ensure idempotency: A workflow can crash after a step changes data but before its result is checkpointed. Retrying a non-idempotent operation—such as crediting $100—could incorrectly apply it twice.
  • Co-location removes application bookkeeping: Conventional idempotency commonly requires tables such as applied_payments to track whether an operation ran. Atomic checkpointing eliminates this extra guard logic for transactional steps.
  • Workflow enqueueing can implement a transactional outbox: A Postgres enqueue_workflow UDF creates a row containing the workflow name, queue, and input in the same transaction as an application update; a worker later dequeues and executes it.
  • The design reduces operations overhead: Compared with a separately polled outbox or external workflow system, database-backed workflow enqueueing avoids dedicated polling, delivery, retry, monitoring, and reconciliation infrastructure for database/workflow consistency.

Images & Media

Keep reading