Citing CockroachDB as an example of scaling Postgres made me spit out coffee. Was this LLM-written?
The efforts we've undergone to make Oban (and Pro) work with CRDB have been ridiculous. Feature detection all over because of a lack of common operators and functions that can't be used in indexes. The worst is the rampant "serialization_failure" errors that force continual transaction retries. Not how I'd suggest scaling Postgres. That said, as a predecessor to dbos in building durable workflows just using Postgres,…
Building durable workflows on Postgres
41–50 of 159 posts
Re: Building durable workflows on Postgres
#42Citing CockroachDB as an example of scaling Postgres made me spit out coffee. Was this LLM-written?
Re: Building durable workflows on Postgres
#43All you need is Postgres until you scale into TBs of data. We use Postgresql as a durable workflow engine, vector search, time-series data, BM25 search, OLTP/OLAP engine, and a queue. It's basically the only dependency we have for https://lobu.ai The main benefit is centralizing all the data in one place so we don't need to worry about copying data in between multiple systems. Once something becomes the bottleneck, y…
I'm in the same camp. Do you use any specific extensions? Especially for OLAP and time series (partitioned tables + related extensions work fine, but curious if you use anything else)
I think if you grow enough to look for these extensions, it's usually better to bet on purpose-specific tooling. For example, I use DuckDB/Iceberg combination extensively for columnar data and connect DuckDB to PG when I need it.
Re: Building durable workflows on Postgres
#44Continuously amazed by what you can do with few tools, as long as Postgres is a part of your toolkit. I recently developed a distributed queue and it works really great - benchmarks great too, with no race conditions or conflicts. I used SKIP LOCKED so that workers can compete safely. You can also have multiple workers across nodes avoid conflict by using session wide mutexes i.e. pg advisory lock.
Edit: Actually I checked this again and apparently the advice has now changed to the inverse.
Re: Building durable workflows on Postgres
#45Earlier quoted context omitted.
Listen/notify is poised to become much better in PG 18 and 19
Why’s that?
Re: Building durable workflows on Postgres
#46Earlier quoted context omitted.
Why’s that?
In pg19 https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit... will land, which significantly improves NOTIFY performance. Right now LISTEN/NOTIFY doesn't scale to very busy instances because a `NOTIFY` within a transaction takes a global lock .
Re: Building durable workflows on Postgres
#47How do you incorporate secrets in this kind of implementation? Stored in db?
Re: Building durable workflows on Postgres
#48Re: Building durable workflows on Postgres
#49Postgres is not cheap to run in the cloud at scale. We went for the cheapest infra, which is basically the disk storage.
Re: Building durable workflows on Postgres
#50That said, my gamer-brain wants to call this "Save-scumming at scale." Which is to say, a lot of people already know that this approach works, but maybe they haven't made the connection to abstract CS stuff.
Another strategy that can be used to build robustness is to build your workflow out of idempotent operations. That can be useful for situations where the workflow state is too large to back up. Instead, you just run the job from the top and it's a bunch of no-ops until you start making progress again.