@DBOS_Inc brings durable execution to Postgres without a separate orchestration server. ClickHouse Managed Postgres works with DBOS without app changes.
Qian Li on running it and keeping workflow history in ClickHouse with WalShadow (private preview): https://t.co/cwbhIQrchE
If you’re running millions of durable workflows per day, you probably don’t want to keep them in Postgres forever.
However, you might not want to delete them either, at least not immediately. Workflow history provides a durable audit log for your application that you often want to keep for governance or compliance reasons.
New solution for this problem: workflow archiving. You can now export workflows from your Postgres system database to a long-term archival store, by default Parquet files in object storage like S3. Archival workflows are fully queryable (for example with DuckDB) and can be re-imported into your system database if needed.
Check it out:
👇
I noticed that @Airbnb just open-sourced Skipper, its durable workflow engine. It's great to see another major tech company adopting the idea of building durable execution as a library on top of the database you already have, without requiring a separate orchestration service.
As one article put it: "Skipper's closest relative is, perhaps, DBOS Transact."
Skipper currently supports MySQL and SQLite, while DBOS supports Postgres (and SQLite in select language SDKs).
Another data point showing that durable execution doesn't have to mean adding another complex infrastructure stack.
Join us on Dec 3 for the DBOS User Group!
Three talks + Q&A:
- 1M workflows/sec on sharded Postgres · @petereliaskraft, CTO, DBOS
- Agentic lawyering with Neon Law Navigator · Nick Shook, Neon Law
- What's next for DBOS · @qianl_cs, CEO, DBOS
Sign up here: https://t.co/1YiabRQURu
I'm so glad to see PostgreSQL 19 add ON CONFLICT DO SELECT. It makes idempotent operations simpler and more efficient.
This is particularly useful when building durable queues, workflow orchestration, and other coordination primitives on Postgres, where multiple workers may concurrently try to insert the same record. You can now atomically insert a row or return the existing one on conflict, without an extra round trip or an unnecessary UPDATE.
Two copies of the same supplier invoice come in 40 seconds apart (e.g. one by email, one via portal)
→ they get processed by two workers of the AP agent
→ both check if they already paid
→ the answer for both is "no"
→ we paid the supplier twice, now we have to chase the supplier for a refund
With recently released PG19 you can do:
INSERT INTO invoices (...) VALUES (...) ON CONFLICT (supplier_id, invoice_no) DO SELECT RETURNING worker_id = $ME AS first, amount = $amount AS same_amount
→ the second worker gets the first one's row back
→ compare the amount with RETURNING
→ if it's the same, do nothing
→ if it's different, send it to a human, since someone changed the invoice in the meantime
Shoutout to Max Demoulin of the @DBOS_Inc team, who often sprinkles my LinkedIn feed with really cool pieces on PG (and DBs in general).
Inspiratiob today: "Two requests arrive with the same idempotency key. The first inserts the order. What does the second one get back? Until Postgres 19, released today: nothing."
I've been thinking of more use cases like this and will add them in the comments below. Please share yours!
Original post: https://t.co/m0cwLsXolF
How to manage millions of workflows waiting hours, days, or even weeks for human input?
This is a common challenge with durable workflows. You want workflows to wait as long as needed, but you don't want them consuming resources while doing nothing.
We recently introduced workflow suspension in DBOS, and wrote a blog post explaining how it works.
When a workflow sleeps or waits for a notification, you can now suspend it. A suspended workflow exists only as records in Postgres, consuming no CPU, memory, threads, or queue slots.
When the wakeup time arrives or a notification is received, the workflow resumes from its checkpointed state and continues execution.
This means you can have millions of workflows waiting concurrently, while only consuming compute resources for the ones actively running.
Here's how we built it: https://t.co/OW24j85YXS
DBOS Go v1.9 is out!
This release brings two major enterprise features to Go:
- Workflow suspension: Suspend workflows waiting for notifications or timers without consuming worker resources.
- Sharded Postgres: Scale durable workflows across multiple Postgres databases.
It also includes several bug fixes and improvements to workflow recovery, cancellation, and connection pool management.
Upgrade note: This release bumps the Go version to 1.26 and updates several dependencies, including pgx. The pgx upgrade changes how special characters in connection strings are handled, so check your connection strings before upgrading.
Full release notes:
https://t.co/PjpJJVZRGR
Just released DBOS TypeScript 5.6 and Python 3.6!
Both releases include bug fixes and performance improvements, particularly faster workflow retention.
We also made a behavior change to how workflow management operations (cancel, resume, fork, and rewind) interact with queues.
Previously, these operations would remove a workflow's queue association. Now, workflows retain their original queue, so resuming, rewinding, or forking a workflow automatically re-enqueues it on that queue. You can also specify a different queue when resuming, rewinding, or forking.
Cancelled or terminated workflows still don't occupy queue slots until they're resumed and re-enqueued.
We made this change based on consistent feedback that the previous behavior was unintuitive. Thanks to everyone who raised it!
Release notes:
Python: https://t.co/6O93hMCVNx
TS: https://t.co/McPN3Mdz8Y
Durable Stories is back for Ep. 02: What Just Happened?! Observability for Large-Scale Systems and Agents.
AI makes software easier than ever to build. But does it make software easier to understand, test, and operate reliably?
Join us on Dec 8 for a conversation with Liz Fong-Jones (Honeycomb), @seldo , and @qianl_cs about how observability and testing are evolving in the age of AI.
https://t.co/yIDAqV9nqw
If you've read this blog post before, the updates are mostly in the "Reliability and Security" section. Because security is becoming more challenging today, you want to minimize the attack surface and trim dependencies.
"If an application already depends on Postgres, adopting durable execution does not add any new points of failure to the system nor introduce new surface area to secure."
Durable execution just needs Postgres.
I just refreshed our blog post about this because I think the message remains incredibly timely.
Developers are building lots of systems, particularly agentic ones, right now, and it’s critical that those systems are reliable. Durable execution makes reliability easier by checkpointing a program’s progress in a database so it can use them to recover from any failure.
Traditionally, you did durable execution via external orchestration: use a central orchestrator to manage workflow execution across a fleet of worker servers, dispatching tasks to them and recording whether the tasks completed.
That kind of central orchestrator was always complex and tricky to manage. But increasingly, it’s a liability. It’s a single point of failure for all your systems, breaking everything if it’s down. It’s also a security vulnerability, as workflow history likely contains sensitive data that you need to protect.
To fix this, replace your workflow orchestrator with Postgres. The core idea of durable execution is to checkpoint program state in a database. But if durable execution is about databases, then there’s no reason to have a separate orchestrator server. Instead, it’s simpler and more efficient to use the database itself as an orchestrator and have applications checkpoint state to it directly. This cuts out a potentially-vulnerable single point of failure for a Postgres server you already know how to manage.
I write about this more in the blog post:
👇
Great to see the Fujitsu team putting together a hands-on tutorial on building reliable workflows with DBOS and Fujitsu Enterprise Postgres.
One highlight is how DBOS users, especially those running sovereign or on-premises deployments, can benefit from Fujitsu Enterprise Postgres' Transparent Data Encryption to meet their security requirements.
Durable Stories just shipped its first episode!
Yesterday we talked about Postgres, and it was a great kickoff:
→ 300+ signups
→ two brilliant guests
→ sharp questions from the audience
Huge thanks to @kelvich and @levpgdog for bringing perspectives you only get from building this stuff for real, and to @qianl_cs for steering the conversation.
And to the DBOS community: thank you for showing up, asking the great questions, and sticking around.
If you didn’t make it yesterday, the recording is here: https://t.co/1FK3n117H9
Fun optimization story!
Was recently working on optimizing workflow cron scheduling, so that a single application can support millions of workflow schedules.
The way it worked originally was that each cron schedule was executed by its own thread, which calculated the next schedule fire time, slept until that time, then fired the schedule.
The problem with this design is that one thread per schedule scales poorly. To manage millions of schedules, we need a single thread that can dispatch every schedule. This thread has to keep track of all the schedules, figure out which ones are firing next, wait till their scheduled time, fire them, and repeat for the next schedules to fire.
The key to making this single thread efficient is choosing the right data structure to store the schedules. We chose a min-heap, sorted by next fire time. The dispatch thread builds this min heap from schedule records stored in Postgres. Then, using the min-heap, the dispatch thread repeatedly:
1. Pops the next item off the min-heap. Because the min-heap is sorted by next fire time, this is always the next schedule to fire. Popping an item from a min-heap only takes O(log N) time.
2. Waits until that schedule is ready to fire.
3. Iterates through the min-heap to find all other schedules that fire at that time.
4. Fires all the schedules in a batch.
5. Computes the next fire time for each of these schedules, and inserts them back into the min-heap.
Because min-heaps have exactly the performance properties we need, O(log N) pushes and pops, this approach lets a single process easily handle millions of workflow schedules.