微软开源 pg_durable:PostgreSQL 内置持久化执行
值得看指数 67.0 NO. 011 · 2026.06.06
发布2026/06/05Score189Comments42
为什么值得看
pg_durable 是微软开源的 PostgreSQL 扩展,让 SQL 函数具备故障恢复能力,崩溃后自动从断点续跑。对已在用 Postgres 的团队,这意味着可以省掉外部队列、定时任务和状态表的基础设施堆栈。
编辑判断
持久化执行这个赛道已有 Temporal、Cadence 等成熟方案,但它们都是独立服务,需要额外运维。pg_durable 的差异化在于把执行引擎下沉到数据库层,利用 Postgres 本身的 MVCC 和 WAL 做状态快照,省去了跨网络调用的序列化开销和分布式事务复杂度。
不过这也意味着你被绑定在 Postgres 生态里,且当前仅支持 PL/pgSQL 函数。如果你的后台任务已经用了 Celery、RQ 或 BullMQ,迁移成本主要在把业务逻辑翻译成 SQL 过程。对于数据密集型、步骤多、容错要求高的工作流(如金融对账、ETL 管道),这个架构比外部队列更省资源;但如果是 I/O 密集型、需要调用大量外部 API 的场景,PL/pgSQL 的表达力会成为瓶颈。
最值得观察的是微软的"把计算推向数据"战略——这和他们之前开源的 pg_cron、pgvector 形成组合拳,Postgres 正在从数据库变成应用运行平台。
社区反馈
意见分歧 42 条评论
核心争论:数据库内持久化执行能否替代外部工作流编排,还是代码层控制更优
2026 is the year of the Postgres queue! (DBOS[0], pgQue[1]) It's awesome that the community is contributing this and giving us the option to use it. As an ex-app engineer though, I kind of prefer my queue logic to be in code, in Git, but maybe with the right tooling, you can change my mind. :) [0]:
Yeah, it's harder to work on, or maybe just different, but I guess the docs, info(searchable docs, posts, experience), and tooling are lacking. What's the story for version control, debugging, testing, releasing? It'd be cool to have everything together for data locality and simplifying the stack, b
Contributor here. Good points, we do need to develop some best practices around managing function versioning and lifecycle for pg_durable. https://github.com/microsoft/duroxide - also OSS, the durable execution framework pg_durable is built on itself supports function versions. W