文档 扩展 博客 服务 GitHub

PostgreSQL in Great STYle

开箱即用的 PostgreSQL 发行版,本地优先的 FLOSS RDS

$ curl -fsSL https://repo.pigsty.cc/get | bash
Pigsty Architecture

使用 PostgreSQL,你是否觉得……

😵

自建太复杂,根本搞不定?

HA/PITR/安全/监控,全整明白要多久?

没有专业 DBA,花样太多,玩不转也学不动

🧩

扩展装不上,想用没得用?

要个 pg_duckdb,云上功能阉割不提供?

自己编译?零散的源码与独立镜像难堪大用

💸

RDS 太贵,持续大出血?

比裸金属贵 5-20 倍,天价买来渣渣云服务

规模越大,出血越痛,还被云厂商牢牢锁死

Pigsty 为你解决所有这些问题,而且 开源免费

一套 Pigsty,所有问题迎刃而解

四大核心能力,让你像专家一样管理 PostgreSQL

🛡️ 高可用标杆架构

故障自愈,高枕无忧

  • 基于 Patroni + Etcd 自动故障切换,HAProxy 流量自动均衡
  • 预置 pgBackRest PITR 时间点恢复,删库跑路也能找回数据
  • 内置 SSL/TLS 加密与访问控制模型,SELinux 防火墙全搞定
告别半夜故障值班 OnCall,睡醒起来慢慢弄 了解架构详情
Pigsty HA Architecture

⚙️ 基础设施即代码

言出法随,一键部署

  • 用配置声明你想要的状态,Pigsty 帮你实现,无需操心复杂细节
  • 海量可选定制选项,生产开发测试共享一套架构,仅有配置不同
  • Ansible 幂等剧本,无需 K8s 与 Docker,裸机也能玩转云原生
一键复刻完整生产环境,单枪匹马管理海量集群 参阅配置示例
# pigsty.yml - 定义一个3节点HA集群
pg-test:
  hosts:
    10.10.10.11: { pg_role: primary }
    10.10.10.12: { pg_role: replica }
    10.10.10.13: { pg_role: replica }
  vars:
    pg_cluster: pg-test
    pg_version: 18
    pg_users:
      - { name: dbuser_app, password: DBUser.App }
    pg_databases:
      - { name: app, extensions: [ vector ]}

📊 可观测性全家桶

洞若观火,尽在掌握

  • 基于 Grafana + Victoria / Prometheus 的 SOTA 可观测性技术栈
  • 3000+ 监控指标,40+ 精调仪表盘,无需配置,开箱即用
  • 可独立部署使用,监控现有 RDS / PostgreSQL 实例
快速定位问题,数据驱动决策,告别空对空无效扯皮 体验在线演示
Pigsty Monitoring Dashboard

🧩 数据库扩展生态

海纳百川,开箱即用

  • 440+ PostgreSQL 扩展,覆盖 14 大 Linux 发行版,即装即用
  • 8 种 PG 内核:兼容 Oracle、MySQL、SQL Server、MongoDB …
  • 功能模块:MinIO、Redis、Ferret、Docker、Supabase 自建支持
灵活组合搭配,想要什么就装什么,完全自由,自主可控 浏览扩展目录
PostgreSQL Extension Ecosystem

440 扩展插件,十大内核分支

Pigsty 为您解锁 PostgreSQL RDS 的无限可能 扩展目录 内核分支

省下来的,都是利润

假设:4核16G,3节点 HA 集群,一年费用对比

AWS RDS / 阿里云
¥180,000
Multi-AZ + PITR + 备份
vs 省 90%
Pigsty 自建
¥18,000
裸金属服务器 + 开源软件

* 实际节省取决于规模和配置,但 5-10 倍的差距是真实的。规模越大,省的越多。

Pigsty 被各行各业的公司所信任

探探
Bilibili
Airwallex
Momenta
美图
PolarDB
Bitdeer
OCI
华峰
Linkfog
Motphys
影视飓风
探探
Bilibili
Airwallex
Momenta
美图
PolarDB
Bitdeer
OCI
华峰
Linkfog
Motphys
影视飓风
我们用 Pigsty 管理了上百套 PostgreSQL 集群,250 万 PG QPS
只用了 1.5 个 DBA,总 TCO 成本是公有云的 5% —— 探探
4443
GitHub Stars
2.5M+
QPS 验证
6+
年持续迭代
#1
中国 PG 开源生态影响力

加入社区

看看大家怎么说

Ruohang Feng
Ruohang Feng
Founder @ Pigsty

"Pigsty is a software written to solve our own problems. And it does it well. So we open-sourced it and hope it can help you too."

Vedran B.
Vedran B.
Junior DBA & Full-Stack Developer

"This is cool and long overdue: The official PostgreSQL extension manager (called pig) has been released and it seems supported by the official PostgreSQL org. So, no more tedious digging through outdated readmes, cryptic configure scripts, or random GitHub forks & patches just to install some required extension. We are all pigs now."

Terry Zheng
Terry Zheng
Senior Software Engineer

"Pigsty is a better local open source RDS for PostgreSQL alternative. I wonder if there anything similar for Redis and MySQL."

Darragh ORiordan
Darragh ORiordan
Principal Engineer & Cloud Architect

"If you ever have to set up a postgres instance for production outside of RDS/Managed, Pigsty is a brilliant implementation"

Grzegorz Głąb
Grzegorz Głąb
Spiritus Movens / Serendipitous Planner

"Great toolbox: Pigsty - 'PostgreSQL In Great STYle': Postgres, Infras, Graphics, Service, Toolbox, it's all Yours."

Paul Hewson
Paul Hewson
Data Scientist / Statistician

"This is neat, self hosted PostgreSQL as a service"

François-Guillaume Ribreau
François-Guillaume Ribreau
Hacker, Maker, Tech Advisor

"Looking for a self-hosted PostgreSQL RDS alternative? You won't believe what this project does"

Ruohang Feng
Ruohang Feng
Founder @ Pigsty

"Pigsty is a software written to solve our own problems. And it does it well. So we open-sourced it and hope it can help you too."

Vedran B.
Vedran B.
Junior DBA & Full-Stack Developer

"This is cool and long overdue: The official PostgreSQL extension manager (called pig) has been released and it seems supported by the official PostgreSQL org. So, no more tedious digging through outdated readmes, cryptic configure scripts, or random GitHub forks & patches just to install some required extension. We are all pigs now."

Terry Zheng
Terry Zheng
Senior Software Engineer

"Pigsty is a better local open source RDS for PostgreSQL alternative. I wonder if there anything similar for Redis and MySQL."

Darragh ORiordan
Darragh ORiordan
Principal Engineer & Cloud Architect

"If you ever have to set up a postgres instance for production outside of RDS/Managed, Pigsty is a brilliant implementation"

Grzegorz Głąb
Grzegorz Głąb
Spiritus Movens / Serendipitous Planner

"Great toolbox: Pigsty - 'PostgreSQL In Great STYle': Postgres, Infras, Graphics, Service, Toolbox, it's all Yours."

Paul Hewson
Paul Hewson
Data Scientist / Statistician

"This is neat, self hosted PostgreSQL as a service"

François-Guillaume Ribreau
François-Guillaume Ribreau
Hacker, Maker, Tech Advisor

"Looking for a self-hosted PostgreSQL RDS alternative? You won't believe what this project does"

Anirudha S.
Anirudha S.
Enterprise Architect

"Pigsty aims to harness the collective power of PostgreSQL ecosystem extensions and democratize access to production-grade database services and with GCP a great start ahead!"

Marcin Gwóźdź
Marcin Gwóźdź
Director of FerretDB

"You can easily now use FerretDB with Pigsty: the a battery-included, local-first, open-source RDS PG alternative."

Peter Zaitsev
Peter Zaitsev
Entrepreneur | Technologist

"Pigsty: PostgreSQL in Great STYle, Battery-Included Free RDS Alternative!"

Philippe Noël
Philippe Noël
Founder @ ParadeDB

"Proud for @ParadeDB to be included in Pigsty! Pigsty is truly one of the best ways to run Postgres and its whole ecosystem. Probably the more comprehensive list of extensions in Postgres"

Broken Mind
Broken Mind
Cognitive Sys Optimization Engineer

"man... this is so fun, the open source community always have the gold, is the postgres the best!! awesome work from the last released! a bunch of extensions to help community"

ɘɿuɔɐɿɈ
ɘɿuɔɐɿɈ
Architect

"I want to take a moment to express my immense gratitude to the dedicated developers, maintainers, and contributors of the Pigsty project - a remarkable repository."

Yurii Rashkovskii
Yurii Rashkovskii
Founder @ Omnigres

"Pigsty Is Postgres All Batteries Included. Did I say All? No, it's a little bit more than that."

Anirudha S.
Anirudha S.
Enterprise Architect

"Pigsty aims to harness the collective power of PostgreSQL ecosystem extensions and democratize access to production-grade database services and with GCP a great start ahead!"

Marcin Gwóźdź
Marcin Gwóźdź
Director of FerretDB

"You can easily now use FerretDB with Pigsty: the a battery-included, local-first, open-source RDS PG alternative."

Peter Zaitsev
Peter Zaitsev
Entrepreneur | Technologist

"Pigsty: PostgreSQL in Great STYle, Battery-Included Free RDS Alternative!"

Philippe Noël
Philippe Noël
Founder @ ParadeDB

"Proud for @ParadeDB to be included in Pigsty! Pigsty is truly one of the best ways to run Postgres and its whole ecosystem. Probably the more comprehensive list of extensions in Postgres"

Broken Mind
Broken Mind
Cognitive Sys Optimization Engineer

"man... this is so fun, the open source community always have the gold, is the postgres the best!! awesome work from the last released! a bunch of extensions to help community"

ɘɿuɔɐɿɈ
ɘɿuɔɐɿɈ
Architect

"I want to take a moment to express my immense gratitude to the dedicated developers, maintainers, and contributors of the Pigsty project - a remarkable repository."

Yurii Rashkovskii
Yurii Rashkovskii
Founder @ Omnigres

"Pigsty Is Postgres All Batteries Included. Did I say All? No, it's a little bit more than that."

Dexter Yang
Dexter Yang
Architect, Hacker

"Pigsty, which adopts the currently popular 'fair-code' model for IaaS / PaaS / BaaS / Serverless DB. Unlike M3O (an 'AWS alternative' project) that's geared more toward developers, pigsty is squarely aimed at dba / ops teams."

Vitaliy Kukharik
Vitaliy Kukharik
Founder & CTO @ Autobase

"If you haven't heard about Pigsty extension repository yet, take a look at this. A lot of extremely useful work has been done! Thanks Vonng for this contribution."

Grant Zhou
Grant Zhou
President at Highgo Software

"You can use Pigsty to serve IvorySQL - Oracle compatible PostgreSQL fork as a local-first RDS"

Digoal Zhou
Digoal Zhou
PostgreSQL Expert

"Pigsty is ideal for managing multiple PG or PolarDB databases, especially if you have extensive extension requirements. Highly recommended!"

Steven Lee
Steven Lee
Author of duckdb_fdw

"Thanks for including the duckdb_fdw in Pigsty. Hope to see more extensions in the future!"

Vignesh Ravichandran
Vignesh Ravichandran
Postgres Contributor

"IMHO, Pigsty is underrated. It deserves more visibility. Production grade @PostgreSQL but with full control !"

Bo Hu
Bo Hu
Co-founder of FeatBit

"Pigsty boosts our PostgreSQL expertise and ensures critical use cases for FeatBit's PostgreSQL solution are rock-solid."

Dexter Yang
Dexter Yang
Architect, Hacker

"Pigsty, which adopts the currently popular 'fair-code' model for IaaS / PaaS / BaaS / Serverless DB. Unlike M3O (an 'AWS alternative' project) that's geared more toward developers, pigsty is squarely aimed at dba / ops teams."

Vitaliy Kukharik
Vitaliy Kukharik
Founder & CTO @ Autobase

"If you haven't heard about Pigsty extension repository yet, take a look at this. A lot of extremely useful work has been done! Thanks Vonng for this contribution."

Grant Zhou
Grant Zhou
President at Highgo Software

"You can use Pigsty to serve IvorySQL - Oracle compatible PostgreSQL fork as a local-first RDS"

Digoal Zhou
Digoal Zhou
PostgreSQL Expert

"Pigsty is ideal for managing multiple PG or PolarDB databases, especially if you have extensive extension requirements. Highly recommended!"

Steven Lee
Steven Lee
Author of duckdb_fdw

"Thanks for including the duckdb_fdw in Pigsty. Hope to see more extensions in the future!"

Vignesh Ravichandran
Vignesh Ravichandran
Postgres Contributor

"IMHO, Pigsty is underrated. It deserves more visibility. Production grade @PostgreSQL but with full control !"

Bo Hu
Bo Hu
Co-founder of FeatBit

"Pigsty boosts our PostgreSQL expertise and ensures critical use cases for FeatBit's PostgreSQL solution are rock-solid."

轻松交付,立等可取

curl https://pigsty.cc/get | bash
./configure
./install.yml
支持系统: Linux x86_64 / Arm64 · EL 8 / 9 / 10 · Ubuntu 22 / 24 · Debian 12 / 13

准备好掌控你的数据库了吗?

$ curl -fsSL https://repo.pigsty.cc/get | bash