In the release announcement for Dasha 1.10, its author Dmitry Bulashev shared a telling production war story. PostgreSQL's internal counters are local to each node and are not replicated: an administrator sees an index on the primary with zero scans (idx_scan = 0) and drops it, and a minute later production grinds to a halt because analytical queries on a read standby depended on that exact index. At the same time, in November 2026, the Workhorse team at Stablemates opened the public beta of a tool born from the mirror-image problem: when you park an external in-memory queue broker next to PostgreSQL, a database transaction rollback leaves "ghost" jobs in the queue for rows that never existed.
Comparing both releases, one practical question jumped out at me: how can you use PostgreSQL's own infrastructure to run background jobs reliably while protecting a high-availability cluster from silent replication failures? Let's walk through an end-to-end scenario: a Patroni-managed PostgreSQL cluster runs batch report exports in the background, while monitoring ensures the write load never brings down the replicas.
Fault-Tolerant Job Queue Workhorse Built on PostgreSQL
Compare two ways to trigger a background batch export. With an external broker, the backend inserts a request into a PostgreSQL table and then sends an event over the network to the queue. There is no shared transaction: send the message before COMMIT and a worker may read an uncommitted or rolled-back row; send it after COMMIT and a process crash leaves the request stranded in the database with no background job.
The open-source Workhorse library (Apache 2.0 license, @stablemates/workhorse on NPM, docs at workhorse.run) moves the queue inside PostgreSQL 15–18 as versioned SQL functions. Enqueuing a job happens in the exact same SQL transaction as the data change: if the transaction rolls back, the job disappears with it. Schedules, retries, durable waits, and history live in database tables and are visible in a built-in web dashboard.
You might ask: "What if a worker is building a twenty-step export and crashes on step fifteen? Or stalls on a network call, loses the job, and then 'wakes up' and overwrites another worker's fresh result?"
I checked the project's architecture docs—Workhorse prevents this with two mechanisms:
- Checkpoints: step progress is saved into the job's
JSONBpayload like a bookmark. After a crash, a new worker resumes the export from step sixteen instead of starting over. - Fence tokens: when claiming jobs via
FOR UPDATE SKIP LOCKED, the database issues a monotonically increasing ownership token—like a coat-check ticket that invalidates an old duplicate. If a stalled worker with an expired lease wakes back up, the SQL function rejects its stale token.
A single SQL protocol with ordered on-the-fly migrations lets you run workers in TypeScript, Python, Go, Rust, Ruby, Java, Kotlin, and C#.
Workhorse delivers jobs with at-least-once semantics: external side effects (sending emails, charging payments) still require idempotency keys. If your queue must sustain millions of events per second or keep running when the primary database is completely down, the authors recommend a dedicated external broker.
Patroni Cluster Monitoring and Wait Analysis in Dasha 1.10
When background workers are busy writing checkpoints and generating exports, write-ahead log (WAL) pressure in a Patroni cluster climbs. Traditional monitoring forces you to install agents on every DB host and manually update configs after a failover. Released on November 9, 2026, the open-source Dasha 1.10 monitor (GPLv3 license, code in the Dasha repository) runs without host agents or third-party extensions, connecting strictly with read-only pg_monitor and pg_stat_statements privileges.
Version 1.10 introduces Patroni cluster auto-discovery via etcd v3 or Consul configuration stores (DCS) with read-only TLS support. Dasha turns each scope into a cluster and links primary and standby nodes by system_identifier even behind a virtual IP (VIP), updating topology automatically when leadership changes.
Still, how do you tell ahead of time that a lagging replica under heavy background-job traffic is about to hit max_slot_wal_keep_size without hammering the database with persistent connections?
What caught my attention most in Dasha 1.10 is its Replication slot invalidation forecast. The monitor takes just two LSN readings using the server clock over a 30-second to 5-minute window, without holding a connection open in between. By calculating the WAL generation rate, Dasha compares the volume retained by the slot against the remaining max_slot_wal_keep_size headroom and shows the time remaining before the replica is lost.
To pinpoint bottlenecks immediately, the Activity & Waits screen (for PostgreSQL 14+ with compute_query_id) polls pg_stat_activity every 1–10 seconds (at most once per second per host), breaking sessions down by CPU, wait types (IO, Lock, LWLock), and idle in transaction, with drill-down into the lock tree. It also adds progress and ETA for COPY, a Health Score (0–100) from Prometheus or VictoriaMetrics exporters, exemption from penalties for "cold" tables (no writes for over 7 days) with VACUUM (FREEZE, ANALYZE) recommendations, 17 schema checks, and pg_stat_io analysis. We covered earlier versions of the monitor in our August ecosystem roundup, and backup verification is covered in our breakdown of backup verification utilities.
Pairing the transactional Workhorse queue with Dasha 1.10 lets you run background jobs and protect Patroni replication from WAL exhaustion without extra infrastructure sprawl. Their roadmaps also show where the ecosystem is headed: Workhorse already ships an LLM specification, and Dasha 1.10 gained a read-only Model Context Protocol (MCP) server with 35 tools and 5 prompts. PostgreSQL is turning into a self-contained platform where job queues, failover observability, and AI diagnostics run directly on native database primitives.
