r/programming • u/alexeyr • 18d ago
Postgres is All You Need for Durable Workflows
https://www.dbos.dev/blog/postgres-is-all-you-need-for-durable-execution
161
Upvotes
r/programming • u/alexeyr • 18d ago
50
u/HolyInlandEmpire 18d ago
I love Postgres and everything it stands for. However, I do understand that for frequent updates it's inefficient because it the way it stores them and deals with indices, especially multiple of them.
Is this still an issue, or has it perhaps been fixed, with the right preparation?
60
u/toastyman1 18d ago
Nah, idk why you'd want to roll your own workflow engine - you'd just end up re-inventing something very temporal shaped - which you can already slap ontop of postgres.
Unless your companies core value prop relies directly on workflow orchestration, or your problem space is simple enough that a basic check pointing system will work - no way in hell I'd re-invent this wheel.
15
u/Perfect_Wall_8905 18d ago
Temporal reached the same conclusion. Use that?
7
u/DreamsTheyStole 17d ago
Using a database instead of running a whole orchestrator like Temporal is a reasonable call. On Postgres, workflow state means lots of row churn, so you get dead tuples and a lot of autovacuum work, and it can get ugly under load if you don’t tune it. InnoDB updates rows in place and keeps old versions in undo logs, and I’ve had a smoother time with MariaDB for this pattern. It also has a thread pool, which helps when a bunch of polling workers hit it at once.
-7
u/mykeof 18d ago
Did Postgres write this?
-8
u/RoyBellingan 18d ago
Next an hard disk and a plain text is all you need ?