+91 80401 38000[email protected]24/7 Expert Support
[email protected]Client Portal →
ServerGurus
← All posts
DevOpsTutorialManaged Services

Microsoft Just Open-Sourced a PostgreSQL Extension That Replaces Temporal and Airflow

By ServerGurus15 July 20265 min read
Microsoft Just Open-Sourced a PostgreSQL Extension That Replaces Temporal and Airflow

Microsoft open-sourced pg_durable on June 5, 2026. It is a PostgreSQL extension that runs durable workflows inside the database. No Temporal workers. No Airflow DAGs. No bespoke job-queue-plus-status-table contraptions. You define your workflow in SQL, and PostgreSQL handles checkpointing, retries, and crash recovery.

If you have ever written a cron job that needed a status table, a retry counter, and a dead-letter queue just to be reliable, pg_durable is the answer you did not know you were waiting for.

What pg_durable Actually Does

A pg_durable function is a graph of SQL steps. PostgreSQL executes each step and checkpoints progress as it goes. If the database crashes, the server restarts, or a step fails, execution resumes from the last durable checkpoint. You do not write retry logic. You do not manage state tables. You define the steps, and pg_durable guarantees they run to completion.

It handles:

  • Automatic retries - failed steps retry with configurable backoff
  • Parallel execution - fan out multiple queries and join results
  • Conditional branching - if-this-then-that logic in pure SQL
  • Scheduling - run functions on a schedule, inside PostgreSQL
  • Crash recovery - PostgreSQL WAL already checkpoints everything; pg_durable extends that to your application logic

The Problem It Solves

Here is what a typical reliable workflow looks like without pg_durable:

-- You need a job queue table
CREATE TABLE job_queue (id SERIAL, payload JSONB, status TEXT, attempts INT, ...);
-- A results table
CREATE TABLE job_results (id SERIAL, job_id INT, result JSONB, ...);
-- A state tracking table
CREATE TABLE job_state (job_id INT, current_step INT, step_data JSONB, ...);
-- A polling worker function (50+ lines of PL/pgSQL)
-- Manual retry logic with exponential backoff
-- Coordination for parallel steps with dependency tracking
-- Dead-letter handling for permanently failed jobs

This is boilerplate that every team writes slightly differently and every team gets wrong at least once. pg_durable replaces all of it with a declarative SQL DSL.

Here is the same workflow with pg_durable:

SELECT df.start(
  a := (SELECT count(*) FROM users),
  b := (SELECT count(*) FROM orders),
  c := (SELECT sum(amount) FROM revenue)
).fan_out(a, b, c).then(
  refresh_dashboard(a, b, c)
);

Three aggregations run in parallel. Then a dashboard refresh runs with the results. If any step fails, it retries. If the database crashes mid-execution, it resumes from the last checkpoint. Six lines of SQL replace 200 lines of boilerplate.

How It Works Under the Hood

pg_durable installs as a PostgreSQL extension with a background worker. The worker polls for pending functions and executes steps. State is stored in PostgreSQL tables backed by WAL, so recovery is automatic. The extension uses PostgreSQL 17 and is built on the PGRX framework (Rust-based PostgreSQL extensions).

The magic is that PostgreSQL's existing durability guarantees extend to your workflow. The same WAL that protects your data also protects the state of your running functions. If PostgreSQL recovers, your workflow recovers.

When to Use pg_durable vs Temporal vs Airflow

pg_durable is not a replacement for every orchestration tool. Here is the decision framework:

  • Use pg_durable when your workflow is SQL-heavy and PostgreSQL is already your source of truth. Data pipelines, ETL jobs, scheduled aggregations, and multi-step transactions that touch only Postgres tables are perfect fits.

  • Use Temporal when your workflow calls external APIs, involves long-running human-in-the-loop steps, or spans multiple services across different languages. Temporal gives you SDKs in Go, Python, Java, and TypeScript. pg_durable gives you SQL.

  • Use Airflow when you need a visual DAG editor, extensive integrations with external data sources, and your organization already has an Airflow deployment with operational knowledge around it.

For the vast middle ground - scheduled jobs, data pipelines, ETL workflows that touch PostgreSQL - pg_durable eliminates an entire class of infrastructure. No worker containers. No separate scheduler. No state management code. Just SQL.

What This Means for Your PostgreSQL Infrastructure

Running pg_durable in production means your PostgreSQL server is now doing more than just serving queries. It is also running background workers that execute durable functions. This has infrastructure implications:

  • More CPU and memory - the background worker consumes resources. Plan for 10 to 20 percent overhead on top of your normal PostgreSQL workload.
  • More I/O - checkpointing writes to WAL. If your workflow is write-heavy, your WAL throughput increases.
  • Monitoring - you need to monitor not just query performance but workflow execution. Failed functions, retry storms, and stuck workflows are new failure modes.

This is where dedicated bare metal PostgreSQL servers earn their keep. On a shared VPS, a background worker consuming an extra 20 percent CPU gets throttled or noisy-neighbored. On dedicated hardware, you size for the workload and get predictable performance.

How to Install pg_durable

# Clone and build
git clone https://github.com/microsoft/pg_durable.git
cd pg_durable
cargo build --release

# Install extension
cp target/release/libpg_durable.so $(pg_config --pkglibdir)/
cp pg_durable.control $(pg_config --sharedir)/extension/

# Enable in PostgreSQL
psql -c "CREATE EXTENSION pg_durable;"

Requires PostgreSQL 17 and Rust toolchain. The build takes about five minutes on a modern server.

ServerGurus PostgreSQL Hosting

We run managed PostgreSQL on bare metal with full extension support. pg_durable is available on any PostgreSQL 17 instance. No shared CPU throttling. No I/O limits. Just dedicated hardware sized for your workload.

If you are running scheduled jobs, ETL pipelines, or data workflows that touch PostgreSQL, pg_durable eliminates the orchestration layer entirely. One less thing to manage. One less thing to break.

Talk to us about managed PostgreSQL hosting.

Ready to build your infrastructure?

Get a quote from our Hyderabad-based team - Tier IV datacenter, real support, INR or USD billing.

View pricingRequest a quoteWhatsApp sales