Skip to content

docs: durable-execution feasibility study#259

Draft
NikolayS wants to merge 7 commits into
mainfrom
claude/hn-discussion-study-JLOve
Draft

docs: durable-execution feasibility study#259
NikolayS wants to merge 7 commits into
mainfrom
claude/hn-discussion-study-JLOve

Conversation

@NikolayS
Copy link
Copy Markdown
Owner

What

Adds blueprints/DURABLE_EXECUTION_FEASIBILITY.md — a strategic evaluation of whether PgQue should extend beyond a queue into a durable-workflow / durable-execution engine on Postgres (DBOS / absurd style), and the realistic adoption odds if it does.

Prompted by the HN thread "Building durable workflows on Postgres" (in which PgQue itself is cited for its snapshot+truncate design).

How it was researched

Deep parallel investigation of the six systems the thread orbits — DBOS, absurd, Temporal, Restate, Rivet, Gadget Silo — grounded against blueprints/SPECx.md §2.3 (workflow engines as a deliberately separate category) and CLAUDE.md Rules #2 (PgQ engine is sacred) and #3 (reduce cleanly to PgQ primitives).

Key findings

  • The category is real and PgQue's framing fits it ("just your Postgres", Apache-2.0, managed-PG compatible) — but absurd already occupies the exact niche a PgQue durable layer would target, with Ronacher's distribution.
  • Concurrency-model mismatch is the crux: every durable engine uses SELECT … FOR UPDATE SKIP LOCKED + leases; PgQ uses snapshot+TRUNCATE rotation. A durable layer would need a new claim/lease table beside the engine — a second concurrency model — and the zero-bloat differentiator does not transfer to it.
  • Latency is no longer an objection: 0.2.0's 100 ms ticker cadence is competitive with absurd/DBOS polling.
  • ~80% of DBOS's work is the multi-language replay runtime, not SQL — the real cost of going further.

Recommendation

  • Tier 1 (now, low risk): own "transactional durable enqueue" — a feature DBOS under-documents and PgQue can demonstrate trivially.
  • Tier 2 (optional, experimental): an absurd-style checkpointed-steps layer in sql/experimental/, single SDK, explicitly labelled — only on real user pull.
  • Tier 3 (not recommended): head-on Temporal/DBOS workflow platform.
  • Keep the zero-bloat queue the headline; durable steps are a feature of it, not a repositioning.

Verification

Documentation only. No code paths changed; no tests affected.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 3 commits May 30, 2026 08:42
Evaluate whether PgQue should extend into a durable-workflow engine
(DBOS/absurd-style) on Postgres, and the adoption odds if so.

Synthesizes deep research on DBOS, absurd, Temporal, Restate, Rivet,
and Gadget Silo, grounded against SPECx 2.3 positioning and the PgQ
engine constraints. Key finding: the durable layer needs SKIP-LOCKED
claim/lease semantics, a second concurrency model beside PgQ rotation,
so the zero-bloat differentiator does not transfer. Recommends a thin
transactional-durable-enqueue + experimental checkpointed-steps path
rather than a head-on Temporal/DBOS competitor.
Earlier draft concluded the zero-bloat differentiator does not transfer
to a workflow layer, assuming a mutable workflow_status row updated per
step (the DBOS/absurd strategy). That was wrong.

Model workflow state transitions as appended events over the rotating
log (continuation-passing): each step enqueues its successor instead of
mutating a row. Transitions become appends, not UPDATEs, so zero-bloat
carries through. Exactly-once handoff falls out of insert_event +
finish_batch in one transaction; sleep/timers use the rotating send_at
from PR #237; exclusivity is structural via cooperative consumers; the
only mutable state is a current-state projection bounded by concurrency.

Verdict flips from 'do not compete' to 'compete on a substrate
SKIP-LOCKED systems cannot match for high-throughput durable workflows'.
Remaining real risk: awaitEvent/join semantics.
Event-sourced durable-execution layer authored with samospec (all-Claude
panel). Ships SPEC.md, self-contained HTML brief (BRIEF.html/index.html),
and auxiliary artifacts under blueprints/workflows/. .nojekyll added for
GitHub Pages.
@NikolayS NikolayS temporarily deployed to github-pages May 30, 2026 09:48 — with GitHub Pages Inactive
@NikolayS NikolayS temporarily deployed to github-pages May 30, 2026 09:50 — with GitHub Pages Inactive
@NikolayS NikolayS temporarily deployed to github-pages May 30, 2026 10:08 — with GitHub Pages Inactive
@NikolayS NikolayS temporarily deployed to github-pages May 30, 2026 12:19 — with GitHub Pages Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants