4 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
Armin Ronacher discusses creating a lightweight SQL library called Absurd for building durable workflows using only Postgres. It enables reliable execution of tasks that can survive failures and restarts by storing state information in the database. The approach avoids the complexity of third-party services, allowing for self-hosted solutions.
If you do, here's more
Armin Ronacher introduces Absurd, a lightweight SQL-only library designed for durable workflows using PostgreSQL. The aim is to simplify the construction of reliable, long-lived functions that can withstand crashes and restarts without losing state. Traditional durable execution systems often rely on complex third-party services, but Ronacher's approach minimizes extra complexity by leveraging PostgreSQL’s built-in features, particularly its capability to handle queues through the `SELECT ... FOR UPDATE SKIP LOCKED` command.
Absurd operates by breaking tasks into smaller steps, storing each step's result in the database as a checkpoint. When a task fails or needs to pause, it can resume from the last completed step, maintaining its state without redundancy. The library allows for the easy registration of tasks, which can be executed sequentially, and it supports mechanisms for waiting on events or sleeping for specified durations. For instance, tasks can be paused for days or until specific events are emitted, like user confirmation emails.
The implementation example shows how to define a task that interacts with an external API to generate text, demonstrating Absurd's straightforward design. The entire system is encapsulated in a single SQL file that users apply to their database, avoiding the need for additional services or complex integrations. Absurd aims to provide a practical solution for developers looking to implement durable workflows without the overhead of more sophisticated frameworks.
Questions about this article
No questions yet.