pgsty

pgsty/pigsty

Shell Apache-2.0 DevOps

Enterprise-Grade OSS PostgreSQL Distribution with HA, PITR, IaC, Monitor, 12 kernel forks and 500+ PG extensions. Best-of-breed products integrated as a platform. Self-host Postgres like a Pro!

5.2k stars
360 forks
active
GitHub +12 / week

5.2k

Stars

360

Forks

24

Open issues

19

Contributors

v4.3.0 03 May 2026

AI Analysis

Pigsty is an enterprise-grade PostgreSQL distribution that bundles HA clustering, point-in-time recovery, infrastructure-as-code tooling, comprehensive monitoring, and 531 PostgreSQL extensions into a self-hosted platform. It serves infrastructure teams and database administrators who need production-ready PostgreSQL deployments at scale—from laptop development to datacenter operations—and is not designed for those seeking a managed cloud database service or a lightweight single-node PostgreS...

DevOps Application Discovery value: 5/10
Documentation 8/10
Activity 10/10
Community 8/10
Code quality 6/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

postgres-distribution infrastructure-as-code ha-clustering monitoring-stack devops-platform
Actively maintained Well documented Niche/specialized use case Popular Production ready
Deep Analysis · Based on README and public signals
2w ago

Pigsty bundles HA PostgreSQL, 510 extensions, and full observability into a single self-hosted distribution

Pigsty is an open-source PostgreSQL distribution that automates the full lifecycle of self-hosted Postgres clusters: deployment, high availability, point-in-time recovery, connection pooling, monitoring (Grafana/VictoriaMetrics stack), and access control. It targets teams and organizations seeking to run production-grade PostgreSQL on bare Linux without relying on managed cloud RDS services. Its distinguishing feature is the breadth of pre-packaged components — 510 extensions, 12 PostgreSQL kernel forks, and integrations with Redis, MinIO, Etcd, and more — delivered via Infrastructure-as-Code patterns. The primary audience appears to be platform/infrastructure engineers and cost-conscious organizations considering cloud exit.

Origin

Created in June 2020 by Ruohang Feng (vonng), initially as a personal toolset for PostgreSQL operations. Evolved over ~6 years into a structured distribution, reaching v4.3.0 by mid-2026, with a Chinese-market-facing mirror (pigsty.cc) suggesting significant adoption in China.

Growth

Growth appears steady rather than viral — ~5,185 stars over 6 years, with 12 stars in the last 7 days (low weekly velocity). The 'cloud exit' and cost-saving narrative likely resonated during periods of cloud cost scrutiny. The Chinese-language presence and pigsty.cc mirror suggest a meaningful portion of the user base is in China, where self-hosted Postgres on bare metal is more common. The jump to 510 extensions and 12 kernel forks signals deliberate scope expansion to broaden appeal.

In production

A public demo instance (demo.pigsty.io) is maintained, suggesting the project is self-hosted in production. A paid support tier (pigsty.io/price) exists, implying at least some commercial adoption. The Chinese mirror and dual-language documentation suggest real user communities in China. However, no third-party production case studies, enterprise logos, or verifiable deployment counts are visible in the README excerpt. Adoption at scale is plausible but not independently verified from available metadata.

Code analysis
Architecture

Appears to be primarily Ansible-based IaC (Shell + YAML playbooks) orchestrating a suite of pre-packaged binaries across 14 Linux platforms. Likely uses Patroni for HA, pgBouncer for pooling, HAProxy for load balancing, VictoriaMetrics + Grafana for monitoring, and etcd for distributed consensus. The 'local repo' concept suggests it ships its own offline package repository. Extension and kernel fork support likely involves pre-built RPM/DEB packages.

Tests

Not documented in README

Maintenance

Last push was 2026-05-11, approximately 6 weeks before the evaluation date — active but not daily. The project is at v4.3.0 with a clear versioning scheme. The public demo (demo.pigsty.io) and DeepWiki badge suggest maintained public infrastructure. Active development over 6 years with no apparent abandonment signals.

Honest verdict

ADOPT IF: you are an infrastructure/platform engineer self-hosting PostgreSQL on bare Linux or VMs, want a batteries-included HA+monitoring+IaC stack, and are comfortable managing Ansible-based deployments. Especially well-suited for cloud-exit scenarios or organizations in China. AVOID IF: your infrastructure is Kubernetes-native, you need a vendor-supported product with SLA guarantees, or your team lacks Linux/Postgres operational expertise to operate what Pigsty deploys. MONITOR IF: you are evaluating Postgres self-hosting options and want to track how the extension ecosystem and kernel fork support matures over the next 12 months.

Independent dimensions

Mainstream potential

4/10

Technical importance

8/10

Adoption evidence

4/10

Risks
  • Single maintainer or small core team risk: the project appears heavily driven by one author (vonng); bus-factor concentration could affect long-term sustainability.
  • Operational complexity: assembling Patroni, pgBouncer, HAProxy, VictoriaMetrics, Grafana, etcd, and 500+ extensions into one platform creates a large surface area for version conflicts and upgrade friction.
  • Documentation and support primarily in Chinese for a portion of the audience, which may limit adoption in English-first organizations.
  • The 'cloud exit' positioning ties growth to a market narrative that may shift as cloud pricing evolves or managed Postgres alternatives improve.
  • No publicly documented enterprise production deployments in the README excerpt; real-world scale and failure modes cannot be independently assessed from available data.
Prediction

Pigsty is likely to remain a well-maintained, niche-but-solid choice for self-hosted Postgres on bare metal, growing steadily in the China market and among cloud-exit-motivated teams globally. Mainstream dominance in the broader Postgres tooling market appears unlikely given K8s-native alternatives and managed cloud competition.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Shell
29.6%
Jinja
23.8%
PLpgSQL
20.4%
HCL
9.5%
Python
7.1%
Makefile
5.8%
Ruby
1.8%
Perl
1.1%

Information

Language
Shell
License
Apache-2.0
Last updated
23h ago
Created
74mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

CrunchyData

CrunchyData/postgres-operator

PGO is a Kubernetes operator for PostgreSQL that automates cluster management,...

4.4k Go DevOps
pgdogdev

pgdogdev/pgdog

PgDog is a PostgreSQL proxy written in Rust that provides connection pooling,...

5.2k Rust DevOps
postgres

postgres/postgres

PostgreSQL is an advanced open-source object-relational database management...

21.4k C Data
le0pard

le0pard/pgtune

PgTune is a web-based tool for tuning PostgreSQL configuration parameters based...

2.7k JavaScript DevOps
dataegret

dataegret/pg-utils

pg-utils is a collection of SQL diagnostic and monitoring utilities for...

1.2k Shell DevOps
vs. alternatives
CrunchyData Postgres Operator

Kubernetes-native HA Postgres operator; Pigsty explicitly targets bare Linux without K8s/Docker, making them complementary rather than direct substitutes. Pigsty covers more of the ops stack but requires VM/bare-metal environments.

Patroni (standalone)

Patroni handles HA clustering but requires users to assemble monitoring, pooling, and deployment tooling themselves. Pigsty appears to wrap Patroni and add the full surrounding platform, trading flexibility for out-of-box completeness.

Supabase (self-hosted)

Supabase targets developer-facing BaaS features (auth, REST API, realtime). Pigsty targets infrastructure/ops teams with deeper Postgres internals, HA, and enterprise controls. Different buyer profiles.

AWS RDS / Aurora PostgreSQL

Pigsty explicitly positions itself as a cloud-exit alternative to RDS, with cost comparisons on its website. RDS offers less operational burden; Pigsty offers more control, extension flexibility, and lower per-unit cost at the price of self-managed complexity.

Timescale / CloudNativePG

CloudNativePG is K8s-native like Crunchy; Timescale focuses on time-series extensions. Pigsty covers more generalist use cases with broader extension support but is not designed for Kubernetes-first environments.