logoalt Hacker News

aynycyesterday at 9:25 PM2 repliesview on HN

OK. I've read it a few times and still don't understand. Where is the distributed part? You store data in a single transaction into postgres. What/who is notifying the message queue?


Replies

KraftyOneyesterday at 9:35 PM

You build a distributed system on top of this! For example, you may have many distributed workers durably executing workflows from the Postgres-backed task queue. The Postgres transactions allow you to atomically perform operations spanning both your task queue and your business data.

Here's another blog post about how a Postgres-backed task queue can run at scale: https://www.dbos.dev/blog/making-postgres-queues-scale

hopppyesterday at 9:39 PM

I've been writing distributed workers for ages with stored functions that have a SELECT FOR UPDATE query.

When workers query the db for jobs the rows get locked by the select and there are no race conditions or duplicate assigned jobs