AI Summary

Overview

pg_durable brings durable, fault-tolerant execution of long-running SQL functions directly into PostgreSQL. It eliminates the need for external infrastructure like cron jobs, message queues, or separate worker services by allowing you to define entire workflows in SQL. If your PostgreSQL database crashes, restarts, or a step within your workflow fails, pg_durable automatically resumes execution from the last successful checkpoint, ensuring reliability and simplifying complex background processes.

Key Features

  • Durable Execution: Function state is persisted within PostgreSQL, guaranteeing survival through crashes, restarts, and failovers.
  • SQL-Native Definition: Define workflows using a composable SQL DSL, keeping your logic close to your data.
  • Zero Infrastructure: Runs as a PostgreSQL extension, eliminating the need for external services like Redis or Temporal.
  • Database-Aware Primitives: Offers first-class support for scheduling, conditional logic, and parallel execution within SQL.
  • Automated Checkpointing: Each step in a durable function is automatically checkpointed, enabling seamless resumption.

Typical Use Cases

pg_durable is ideal for backend and data engineers, DBAs, and SREs who need to build reliable, auditable background processes that live alongside their data.

  • Data and AI Pipelines: Build robust pipelines for tasks like vector embedding generation, batch data ingestion, transformation, and publication, all managed within PostgreSQL.
  • Automated Maintenance & Operations: Create resilient SQL-based runbooks for scheduled maintenance, database health checks, and automated recovery procedures that must survive server restarts.
  • Complex Workflow Orchestration: Orchestrate fan-out aggregations, external API interactions (e.g., for enrichment or classification), and multi-step processes that benefit from in-database state management.
  • Row-Level Processing: Execute durable, per-row or per-document workflows for tasks like processing new records or handling asynchronous updates.

Repository Trajectory

Trended #15 on daily

June 7, 2026

First tracked on GitTrend

June 7, 2026

Loading README...

Contributors

Languages

Shell

18%

Rust

50%

PLpgSQL

30%

Dockerfile

1%