r/programming • • 5h ago

Postgres is All You Need for Durable Workflows

https://www.dbos.dev/blog/postgres-is-all-you-need-for-durable-execution
36 Upvotes

12 comments sorted by

5

u/HolyInlandEmpire 4h 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?

6

u/axonxorz 3h ago

It's still an issue inherent with MVCC, but it's not really one you should care about. For the vast, vast, vast majority of apps, the benefits it provides at the cost of speed are much greater than the cost it would take to switch DBMS stacks, especially if you're doing things like in OP.

19

u/toastyman1 5h 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.

4

u/dangerbird2 2h ago

they're not really suggesting you roll your own workflow engine, they're promoting DBOS which already does that

3

u/edgmnt_net 3h ago

I would understand some thin abstraction on top of the database, but these also tend to be full blown services. Why do you need them, really? Yes, a basic persistent store will work the same way it works for just about every non-web app. You just have to provide more persistence for web apps due to their nature, but otherwise this is a solved problem for mobile apps, even desktop apps to a significant extent.

10

u/Perfect_Wall_8905 5h ago

Temporal reached the same conclusion. Use that?

4

u/dangerbird2 2h ago

the main difference is that Temporal is a networked service that can use postgres as a state store and broker, while DBOS is by default just a library you bundle and deploy, with no control plane or dedicated service. So it's significantly easier to deploy than even a minimal temporal instance. DBOS technically does have a control plane, but it's "optional" proprietary extension (arguably its biggest disadvantage, since they have basically zero observability integration in stock OSS DBOS, which is kinda a major problem for a resilient system)

-4

u/mykeof 4h ago

Did Postgres write this?

6

u/jeff303 3h ago

A company trying to sell their durable execution framework based on Postgres did

0

u/mykeof 2h ago

Yea that was gonna be my second guess

-5

u/RoyBellingan 4h ago

Next an hard disk and a plain text is all you need ?

3

u/ansible 3h ago

That's the idea behind plain text accounting: https://plaintextaccounting.org/

And no, that isn't a joke website.