back to home

pgsty / pigsty

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

4,895 stars
338 forks
19 issues
ShellJinjaPLpgSQL

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing pgsty/pigsty in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/pgsty/pigsty)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

PIGSTY - Self-Host Postgres like a Pro Enterprise-Grade Open-Source **PostgreSQL** Distribution with HA, PITR, IaC, Monitor, and 460 PG extensions. > "**P**ostgreSQL **I**n **G**reat **STY**le": **P**ostgres, **I**nfras, **G**raphics, **S**ervice, **T**oolbox, it's all **Y**ours. Website | ORG | PGEXT.CLOUD | AI INFRA | Public Demo | Blog | Discuss | Support | 中文 Pigsty scales from **laptop** to **datacenter**. Enterprise-grade. Developer-friendly. **Get Started** with the latest **v4.2.1**: Features • **Extensible**: **461+** **PG Extensions** & **12** **PG Kernels** available, Packed for **14 Linux Platforms**, Battery-Included. • **Reliable**: Self-healing **HA** clusters with pre-configured **PITR** and built-in **ACL**, **CA & SSL** secure best practice. • **Observable**: SOTA monitoring for **PG** / **Infra** / **Node** based on the **Victoria** & **Grafana** stack: **Demo** & **Gallery**. • **Scalable**: Auto-routed & pooled customizable database **Services** **Access** with **haproxy**, **pgbouncer**, and **VIP**. • **Maintainable**: **One-Cmd Deploy**, **Admin SOP**, **Auto-Tune**, **Local Repo**, **IaC** and **Vagrant** / **Terraform** support. • **Composable**: Bonus **Modules** such as **Redis**, **MinIO**, **Etcd**, **Docker**, **DuckDB**, **FerretDB**, **Supabase**, **& More**. • **Controllable**: Self-sufficient **Infra Closure**, Cloud Neutral FOSS. Run on **bare Linux** without **Docker & K8S**. • **Affordable**: Self-Hosting like a **Pro**, without the cost of **RDS**. Empowering Cloud-Exit for Ultra **Cost Saving!** You can even use many exotic **PG Kernel Forks** as in-place replacement and wrap it as a full RDS service: | Kernel | Key Feature | Description | |:------------------------------------------------------------:|:--------------------------------:|:--------------------------------------------------| | PostgreSQL | **Battery-Included** | Original PGDG PostgreSQL with 460+ extensions | | Supabase | **Backend as Service** | BaaS over PostgreSQL, Firebase alternative | | Citus | **Horizontal Scaling** | Distributive PostgreSQL via native extension | | Babelfish | **SQL Server Simulation** | Microsoft SQL Server wire-compatibility | | IvorySQL | **Oracle Simulation** | Oracle Grammar and PL/SQL compatible | | OpenHalo | **MySQL Simulation** | MySQL wire-protocol compatibility | | FerretDB | **MongoDB Simulation** | MongoDB wire-protocol compatibility | | Percona | **Transparent Data Encryption** | Percona Distribution with pg_tde | | OrioleDB | **OLTP Optimization Engine** | No bloat, No XID Wraparound, S3 Storage | | PolarDB | **Aurora flavor RAC** | RAC, China domestic compliance | | AgensGraph | **Graph-Native Database** | Transactional graph database based on PostgreSQL | | pgEdge | **Multi-Master Distributive** | Geo-Distributive multi-writer Postgres | | Cloudberry | **MPP Data Warehouse** | Greenplum 7 Apache OSS Fork | And gather the synergistic superpowers of all **460+ PostgreSQL Extensions** all together: Get Started **Prepare** a fresh / node runs any **compatible** **Linux** OS Distros, then **Install** **Pigsty** with: Then **configure** and run the ** ** playbook with an **admin user** (**nopass** & ): Finally, you will get a pigsty **singleton node ready**, with **WebUI** on port and **Postgres** on port . For dev/testing purposes, you can also run Pigsty inside **Docker** containers: -------- > **Single-Node Setup** | **Production Deploy** | **Offline Install** | **Minimal Install** | **Docker Install** | **Run Supabase** Install with the pig cli Then you can launch pigsty with sub command: Install with get script > HINT: To install a specific version, pass the version string as the first parameter: > > Clone src with git You can also download the pigsty source with , remember to check out a specific version tag, the branch is for development. Architecture Pigsty uses a **modular** design: you can **use one or all**, with best-of-breed products integrated as a platform. Self-healing PostgreSQL HA cluster powered by Patroni, Pgbouncer, PgBackrest & HAProxy Nginx, Local Repo, DNSMasq, and the entire Victoria & Grafana observability stack. Init node name, repo, pkg, NTP, ssh, admin, tune, expose services, collect logs & metrics. Etcd cluster is used as a reliable distributed configuration store by PostgreSQL HA agents. You can compose them freely in a declarative manner. & will suffice for host monitoring. and are used for HA PG clusters; installing them on multiple nodes automatically forms HA clusters. The default playbook will deploy , , & on the current node. This gives you an out-of-the-box PostgreSQL singleton instance ( ) with everything ready. The node can be used as an admin controller to deploy & monitor more nodes & clusters. For example, you can install these **6** **OPTIONAL** extra modules for advanced use cases: S3-compatible object storage service; used as an optional central backup server for . Deploy Redis servers in standalone master-replica, sentinel, and native cluster mode. Native support for FerretDB — adding MongoDB wire protocol compatibility to Postgres! Launch optional docker daemons to run other stateless parts besides Pigsty RDS. JuiceFS can mount S3/MinIO, and even PostgreSQL as a filesystem shared by multi users. Vibe coding environment with VS Code Server, JupyterLab, Node.js, and Claude Code. Of course, you can deploy different kinds of HA **PostgreSQL** clusters on multiple nodes, as much as you want. ---------------- PostgreSQL RDS To deploy an **additional** 3-node HA Postgres cluster . Add the cluster **definition** to the [**config inventory**](https://pigsty.io/docs/concept/iac/invent _...truncated for preview_