第四期:云原生PostgreSQL的分布式架构演进
Clyde Jin
04-23
DBA
44

第四期:云原生PostgreSQL的分布式架构演进

从分片到存算分离,2026年PostgreSQL如何征服大规模数据挑战

在前三期技术专题的铺垫下,我们已经看到PostgreSQL 18/19的内核能力持续增强,向量检索与图查询等AI生态能力快速融合。而真正驱动PostgreSQL完成“单机数据库→综合性数据平台”这一角色跃迁的底层力量,源自云原生架构的深刻变革。

2026年的PostgreSQL分布式生态,正在经历一场从“分片扩展”到“存算分离”的范式迁移。当Citus、Apache Cloudberry等社区主力持续进化的同时,Google Cloud推动的逻辑复制向主动-主动架构演进、阿里云Serverless Pro模式对存算分离的工程化落地,以及EDB、Aurora、YugabyteDB等商业与开源力量的齐头并进,共同勾勒出一幅云原生时代的分布式PostgreSQL全景图。

一、Citus 14.0:将PG 18的力量带到分布式集群

作为PostgreSQL生态中应用最广泛的分片扩展,Citus在2026年2月迎来了14.0版本,其核心使命是完整适配PostgreSQL 18。

1.1 PG 18能力在分布式集群中的“免费午餐”

Citus的实现方式决定了它作为PostgreSQL扩展的本质:一个Citus集群本质上是多个独立PostgreSQL实例(协调器+多个工作节点)共同工作。这意味着,一旦Citus与新版PG完成兼容性适配,绝大多数上游改进无需额外开发即可“自动生效”。在Citus 14.0中,PG 18的以下能力被直接带入分布式场景:

  • 异步I/O:分片密集的分布式集群中,顺序扫描、位图堆扫描和VACUUM操作从AIO中获得显著加速;
  • 跳跃扫描:在多租户应用中,跳过分布列前缀的查询也能有效使用多列索引;
  • uuidv7():时间有序的UUID在各分片间生成,减少跨分片索引的随机写入开销。

1.2 仍需Citus定制的领域

尽管如此,某些复杂功能仍需Citus团队进行专项适配——包括JSON_TABLE()在分布式查询中的支持、DDL传播的正确性验证,以及PG 18新增时态约束在分片语义下的一致性保证。对于已经或计划采用Citus分片架构的企业而言,14.0是一个值得规划的升级节点。

二、Apache Cloudberry 2.1.0:MPP数据仓库的开源新力量

2026年4月,Apache Cloudberry(孵化中)发布了2.1.0版本,这是继2.0.0正式进入Apache孵化器后的首个重要更新。

Cloudberry的核心定位是MPP数据仓库,继承自Greenplum Database最后一代开源代码,专为大规模分析型工作负载和AI场景设计。2.1.0的核心突破包括:

  • UDP2互联协议:全新实现的计算节点间通信协议,提升分布式查询的执行效率;
  • ORCA优化器增强:支持CTE剪枝和部分聚合下推,多项正确性与内存修复;
  • PAX列存格式LZ4压缩:提升存储效率,配合I/O和内存管理优化;
  • 快速ANALYZE:针对追加优化表的统计信息收集加速,解决大规模环境中的运维瓶颈;
  • MCP服务器:便于与LLM工具和AI工作流集成。

Cloudberry的出现填补了PG生态在“分析型MPP数据仓库”领域的空白。与Citus侧重OLTP/HTAP场景的分片架构不同,Cloudberry沿袭了Greenplum的列式存储与大规模并行执行引擎,与PG 18/19的内核新特性形成互补。值得注意的是,其内核版本目前仍基于PG 14.x,团队正积极推进向PG 16.x的升级,未来内核版本的追赶将是Cloudberry的关键看点。

三、Google Cloud:推动逻辑复制迈向“主动-主动”架构

Google Cloud在2026年初发布的一份社区贡献报告,勾勒出一条清晰的演进路径:让PostgreSQL的逻辑复制从主-从模式走向主动-主动(active-active)架构。

3.1 自动冲突检测:打破双向复制的长期瓶颈

逻辑复制的传统局限在于双向写入场景下,冲突更新可能导致复制中断。Google Cloud工程师向PostgreSQL上游贡献的关键能力是自动冲突检测——数据库在复制过程中可自动识别行级冲突,无需人工干预。这一能力是多节点写入场景的核心突破,也是迈向主动-主动架构的前提条件。

3.2 序列复制与pg_upgrade优化

其他关键贡献包括:将逻辑复制范围从表数据扩展到序列,大幅减少迁移或版本升级时的手动同步需求;修复订阅管理中的自死锁问题;对pg_upgrade的大对象管理优化,缩短大规模部署的升级时间。此外,Google还正在研发复制结构化冲突日志、pg_dump并行数据导出等未来能力。

社区对此反响热烈:Franck Pachot指出,带冲突解决的双向逻辑复制与CockroachDB/YugabyteDB等分布式SQL存在不同的一致性模型基础——前者遵循“最后写入胜出”,后者提供严格ACID语义。但更多观点认为,当超大规模云厂商将主动-主动复制这类企业级特性贡献到上游时,标志着PostgreSQL已成为无可争议的企业默认选择。

四、阿里云Serverless Pro:存算分离的工程化落地

如果说Google Cloud从“复制”维度推动分布式演进,阿里云则从“架构”维度给出了另一条答案——Serverless Pro模式,以存算分离为底座,重塑云原生PostgreSQL的弹性边界。

4.1 从有状态到无状态:架构的范式迁移

传统AnalyticDB PostgreSQL版采用Master/Segment架构,计算节点绑定本地ESSD,数据增长带来存储成本的线性上涨,计算节点有状态导致扩缩容慢;一写多读只能通过“新建集群+复制数据”实现,周期长且存储成本成倍增加。

Serverless Pro模式将持久化数据统一沉降到OSS对象存储,本地ESSD仅用于缓存与临时数据,使计算层趋于无状态。计算与存储解耦后,算力可独立扩缩——峰值快速拉起,低谷及时回收,存储按需付费,避免被本地盘长期绑定。

4.2 Virtual Warehouse:读写分离的极致版本

基于共享存储底座,Serverless Pro支持“主集群+多Virtual Warehouse(VW)”的多集群共享存储架构。主集群处理写入任务,只读业务由独立VW承载,大查询不再抢占主集群资源。创建VW无需复制数据,读扩展从传统“天级数据复制”缩短为“分钟级资源拉起”;多个VW共享同一份底层数据,避免为每个只读集群重复购买存储。

4.3 Log-as-Database的设计思想

Serverless Pro的底层基于“Log-as-Database”思想:将数据库的“随机写Page”转化为WAL的“顺序写”,由存储侧异步回放WAL生成数据页,使最终数据长期驻留在OSS上。其四层架构(计算节点→Log Store→Page Store→OSS)清晰呈现了存算分离的工程全貌。

阿里云已于2026年3月30日正式下线旧版Serverless模式,Serverless Pro成为其云原生数据仓库的标准入口。

五、其他云原生分布式力量

方案 架构路线 关键特点 适用场景
EDB Postgres Distributed 原生分布式 高可用、性能与弹性,全球级分布式支持 企业级全球部署
CloudNativePG 1.29 Kubernetes Operator 8k+ GitHub星标,扩展模块化解耦,供应链安全 K8s环境PG运维
Stolon K8s HA管理器 etcd集群状态管理,自动故障切换 容器化高可用部署
Amazon Aurora PostgreSQL 云托管存算分离 5倍吞吐量,自动存储扩展,Blue/Green切换 云上托管OLTP
CockroachDB 协议兼容版 PG线缆协议兼容,Raft分布式共识,跨地域强一致 全球分布式事务
TiDB for PostgreSQL 协议兼容版 TiDB分布式架构 + PG兼容API层,代码迁移成本低 MySQL/PG混合迁移

协议兼容版指在API层面模拟PostgreSQL通信协议、底层为自研架构的产品类型。这类产品基于云原生基础设施构建,可提供跨区域强一致性与水平读写扩展等原生PG难以实现的能力。

六、总结与展望

回顾2026年云原生PostgreSQL分布式架构的演进全景,四条主线贯穿始终:

第一条主线:分片扩展的持续进化。 Citus 14.0完成了PG 18的完整适配,让异步I/O、跳跃扫描等底层性能红利在分布式集群中兑现。作为分片扩展的代表,Citus持续巩固其在OLTP/HTAP场景的领先地位。

第二条主线:MPP数据仓库的生态新生。 Apache Cloudberry 2.1.0的发布填补了PG生态在分析型MPP领域的空白。继承自Greenplum的列存引擎与大规模并行执行能力,为大数据分析提供了开源新选择。

第三条主线:云厂商驱动的基础能力跃迁。 Google Cloud推动逻辑复制迈向主动-主动架构,阿里云Serverless Pro以存算分离重塑弹性边界。云厂商不仅将PG作为服务对外提供,更将内部大规模运维的实践经验反向贡献给上游社区。

第四条主线:多样化分布式生态的百花齐放。 EDB Postgres Distributed面向企业级全球部署、CloudNativePG成为K8s上PG运维的事实标准、CockroachDB与TiDB等协议兼容版以自研分布式架构满足极端扩展需求——不同的架构路径服务于不同的场景诉求,共同构成了2026年PG分布式生态的完整图景。

回看过去一年的分布式架构演进,一个清晰的趋势正在浮现:PostgreSQL正在从“一个可以被分布式的数据库”演进为“一个原生具备分布式能力的数据平台”。 这种变化不仅体现在技术能力上——存算分离、主动-主动复制、MPP分析引擎;更体现在生态格局上——从单一的分片扩展,走向多种架构路线共存的分布式生态系统。

对于企业架构师和技术决策者而言,2026年的选择前所未有的丰富:是采用轻量级的分片扩展(Citus),还是部署完整的MPP数据仓库(Cloudberry);是依赖云厂商托管的Serverless模式,还是基于Kubernetes自建云原生运维体系——每一条路径都有成熟的开源生态和商业支持作为后盾。

这正是云原生PostgreSQL时代最值得关注的价值:企业可以在不牺牲PostgreSQL生态兼容性的前提下,根据自身的规模、场景和运维能力,选择最适合的分布式演进路径。

📌 下期预告:第五期——PostgreSQL扩展开发实战:用Rust构建自己的PG扩展 从pgvector到VectorChord,从ParadeDB到Citus,PG生态的强大生命力源自其可扩展的内核架构。第五期我们将深入扩展开发实战,以Rust为开发语言,从零构建一个完整的PG扩展,带你掌握PostgreSQL扩展开发的全流程——从环境搭建到Cargo integration,从数据类型定义到性能优化。

(本文数据截至2026年4月,最新动态请以各项目官方发布为准。)

Star
Donate
第三期:PG 19 新特性全景解读
Previous
第五期:PostgreSQL扩展开发实战——用Rust构建自己的PG扩展
Next

Leave a comment

Registration is not required

Clyde Jin
303 Articles
0 Comments
0 Like
Recent Posts

HiddenMerit Daily · Issue 60

📊 HiddenMerit Daily · Issue 60 Focus on Database Frontiers, Practical Insights for DBAs July 22, 2026 | 5 Selected Global Breaking News 01|Oracle Releases Largest Quarterly Patch in History: 1,449 Patches Fix 1,235 CVEs, 261 Critical On July 21, Oracle released its July 2026 Critical Patch Update (CPU), setting a record for the largest single patch release in the company’s history. This CPU contains 1,449 security patches fixing 1,235 independent CVEs across 32 Oracle product families, of which 261 patches are rated Critical. Patch Distribution by Product Family: Product Family Patches Remotely Exploitable Without Authentication Oracle E‑Business Suite 410 45 Oracle Fusion Middleware 355 219 Oracle Communications 168 122 Oracle MySQL 54 9 Oracle Database Server 15 6 Context for This Patch: Oracle had already issued an urgent “Prepare Now” warning a week earlier, emphasising that AI is fundamentally lowering the barrier to discovering and exploiting vulnerabilities – frontier AI models can analyse software changes, reverse‑engineer security patches, and develop attack paths at unprecedented speed. Oracle has collaborated with state‑of‑the‑art models from Anthropic and OpenAI to proactively identify and fix potential security vulnerabilities. Oracle strongly recommends that customers immediately test and deploy this update in their monthly patch cycles. […]

HiddenMerit Daily · Issue 59

📊 HiddenMerit Daily · Issue 59 Focus on Database Frontiers, Practical Insights for DBAs July 21, 2026 | 5 Selected Global Breaking News 01|Oracle Issues Urgent Warning: July 21 Release Update to Fix Large Number of High‑Risk Vulnerabilities, Immediate Deployment Recommended On July 13, Oracle issued an urgent security warning, strongly recommending that all customers running supported Oracle Database versions (including Oracle Database 19c and Oracle AI Database 26ai) immediately test and deploy the Release Update (RU) after its release on July 21. Background: New frontier AI models are significantly lowering the barrier to discovering and exploiting software vulnerabilities – these models can identify weaknesses, analyse software changes, reverse‑engineer security patches, and develop potential attack paths at unprecedented speed and scale. AI models are also becoming increasingly adept at combining multiple weaknesses across the application and data stack into complex attacks, even when individual weaknesses do not themselves pose a serious risk. As a result, protecting systems solely at the network or application layer is no longer sufficient; enterprises must protect the entire technology stack. Fixes Included in This RU: Oracle has collaborated with state‑of‑the‑art models from Anthropic and OpenAI to proactively identify and fix potential security vulnerabilities. The upcoming […]

HiddenMerit Daily · Issue 58

📊 HiddenMerit Daily · Issue 58 Focus on Database Frontiers, Practical Insights for DBAs July 20, 2026 | 5 Selected Global Breaking News 01|CAICT: Domestic Databases Enter Core System “Deep Water,” AI‑Native Leads New Industry Landscape On July 9, at the 2026 Trustworthy Database Development Conference, CAICT released the “Database Development Research Report (2026).” The report notes that domestic databases have basically completed peripheral system replacement and have officially entered the critical business system breakthrough phase. Key Data: The global database market reached $131.6 billion in 2025 (approximately RMB 894.09 billion). The Chinese database market reached $9.49 billion in 2025 (approximately RMB 64.48 billion), and is expected to reach RMB 97.974 billion by 2028, with a CAGR of 13.06%. The number of domestic database vendors has shrunk from a peak of 167 to 94, with a clear head‑concentration effect and an intensifying “Matthew effect.” AI‑Native Becomes the Main Theme: The report points out that database technology is accelerating its evolution toward the AI‑native direction, and the global database industry is entering a new phase of landscape restructuring. The role of databases is upgrading from “underlying support systems” to “core engines enabling intelligent decision‑making and business innovation.” AI agents are becoming […]

HiddenMerit Daily · Issue 56

📊 HiddenMerit Daily · Issue 56 Focus on Database Frontiers, Practical Insights for DBAs July 6, 2026 | 5 Selected Global Breaking News 01|Kingware Releases Manufacturing Scenario Database Evolution White Paper: SQL Server Replacement Enters “Deep Water” On July 5, CETC Kingware published a technical article titled “Database Evolution in Manufacturing Scenarios: How Kingware Replaces SQL Server,” pointing out that the data surge on industrial shop floors has exceeded the processing capacity of single‑node systems. Traditional database architectures that rely on vertical scaling are facing unprecedented performance challenges. Over the next 1‑3 years, manufacturing enterprises will no longer face only the “choice of replacement,” but must answer the strategic question: “How do we build an autonomous data foundation in the context of de‑IOE?” Three Paradigm Shifts: Hybrid Workloads Become the Norm: The IT architecture of modern factories is shifting from separated OLTP and OLAP to HTAP mode. The same data system must simultaneously handle tens of thousands of device instruction writes per second and minute‑level production report analysis. Distributed Architecture Becomes a Hard Requirement: When a single table exceeds 100 million rows with daily increments exceeding 1 million rows, the index maintenance cost of traditional single‑node databases rises exponentially. Autonomous […]
生成中...
扫描二维码
扫描二维码