Just Use Postgres for Durable Workflows
Durable execution is a method for building reliable programs by regularly checkpointing progress to a database. This approach allows for recovery from failures by reloading the last completed step, similar to saving in a video game. The article argues for using Postgres as the orchestrator for durable execution, simplifying the process by eliminating the need for a separate orchestrator server.
- ▪Durable execution checkpoints program state in a database to recover from failures.
- ▪Using Postgres as the orchestrator simplifies the durable execution process.
- ▪The scalability and availability of a database-backed system depend on the underlying database.
Opening excerpt (first ~120 words) tap to expand
Durable execution is a simple but powerful tool for building reliable programs. The idea is that as your program runs, you regularly checkpoint its progress to a database. That way, if your program ever crashes or fails, you can reload from the last checkpoint to recover it from its last completed step. You can think of this like saving in a video game: you regularly “save” your program’s progress so that if it crashes, you can “reload” it from its last checkpoint. This is most valuable when restarting the workflow after a failure would be costly (e.g., LLM token usage in AI workflows) or incorrect (e.g., placing duplicate orders in an e-commerce workflow). Most commonly, durable execution is implemented via external orchestration.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Dbos.