Reliable Infra: Rock-Solid and Secure

Towering peaks, bedrock solid, standing firm at any summit!

Reliability Feature 1

High-Availability: Reliable PostgreSQL RDS

Pigsty delivers PG HA solutions which follows the industry best practice

Adjustable RTO and RPO, balancing trade-offs for specific scenarios.

  • Primary failover metrics: RTO ≈ 30 seconds (adjustable)
  • async commit mode: RPO < 1MB, crit mode: RPO = 0 (adjustable)
  • Replica failure / switchover: RTO ≈ 0 seconds
ServicePortDescription
primary5433Production read-write, connects to primary connection pool
replica5434Production read-only, connects to replica connection pool
default5436Administration, ETL writes, direct access to primary
offline5438OLAP, ETL, individual users, interactive queries

Self-Healing: Adaptive service failover

Self-healing arch with transparent topology, multi-writer experience

Flexible service access, automatically traffic routing, DevOps sleep well

  • Industry HA best practices: Patroni, Etcd, HAProxy, VIP Manager
  • 4 default services: primary, replica, offline, default, with read-write splitting
  • Route Read/Write traffic based on health checks, without human intervention
  • Flexible access methods: IP, Connection Pools, L2 VIP, L4 LB, SD, etc.
pg-pitr                               # Recover to WAL archive endpoint
pg-pitr -i # Recover to most recent backup point
pg-pitr --time=2022-12-30 14:44:44+08 # Recover to specific time point
pg-pitr --name=my-restore-point # Recover to named restore point
pg-pitr --lsn=0/7C82CB8 -X # Recover immediately before LSN
pg-pitr --xid=1234567 -X -P # Recover before specified XID
pg-pitr --backup=latest # Recover to latest backup set
pg-pitr --backup=20221108-105325 # Recover to specific backup set

PITR Protection: Pre-configured Backup & Archives

Pre-configures physical backups and enables WAL archiving by default

Local fs or remote S3/MinIO, mature disaster recovery solutions on demand

  • Industry backup best practices: pgBackRest + MinIO / Local Disk / S3
  • Protection against software defects and human errors (Accidental deletion)
  • One-command backup and restore, flexible backup strategies with crontab
  • In-place concurrent incremental PITR, fast recovery with quick retry options
Reliability Feature 4

Infra Closure: No external dependencies

A complete infra closure for PostgreSQL RDS, requiring no external deps.

Local repo snapshoting all packages - run locally until the end of time.

  • Observability infrastructure: Prometheus / Grafana
  • Load balancing and reverse proxy: Nginx / HAProxy
  • Configuration and object storage: Etcd / MinIO
  • Critical services DNS and NTP: DNSMasq / Chronyd
Role NameDescription
dbrole_readonlyRole: Global read-only access
dbrole_readwriteRole: Global read-write access
dbrole_adminRole: Admin/object creation
dbrole_offlineRole: Limited read-only access
postgresSystem superuser
replicatorSystem replication user
dbuser_dbaPostgreSQL admin user
dbuser_monitorPostgreSQL monitoring user

Access Control: Built-in best-practice model

Default ACL with read/write/admin/analytics/monitoring/DBA separation

Secure enough and ready for using without any further configuration

  • Default roles: readonly / readwrite / admin / offline
  • Default users: DBSU / DBA / replication / monitoring
  • Default HBA rule sets with simple configuration options
  • Managed pgbouncer db/user credentials, sync with postgres
Reliability Feature 6

Confidentiality: Guaranteed data security

Self-signed CA, SSL encryption, password for backups and endpoints

As long as your passwords & key are secure, your data remains safe.

  • Local CA-issued certificates with SSL/TLS enabled globally by default
  • SCRAM-SHA-256 verification, AES-encrypted backup data
  • Precise allow/deny list default policies to prevent unauthorized access
  • All externally exposed web services are uniformly managed through Nginx
Reliability Feature 7

Data Integrity: Thorough verification

Data checksums for silent corruption. Replicas and delayed standby instances.

Audit extensions and centralized logging, with transparency and efficiency.

  • CRIT configuration template: optimized for data integrity
  • Data checksums enabled to prevent silent data corruption
  • WatchDog: STONITH to prevent cluster split-brain
  • Audit Log: centrally collected, tamper-proof
Tantan Logo

Production Case

PG Clusters

100+

CPU Cores

25,000

Deduplicated Data

200TB

Overall Availability

> 99.999%

Stable operation in production for 6 years, overall availability > 99.999%

Battle-Tested: Availability Results

Running robustly in many large organizations, maintain 99.999%+ availability.

Ultimate business continuity: rolling upgrades, switchovers, and online migrations

  • No single points of failure: Redundant HA designs for all critical components
  • Zero-downtime migration based on logical replication blue-green deployment
  • Emergency plans: standard SOPs for various failure scenarios
  • Benchmark case: 25,000 vCPU x six years x 99.999% availability

PIGSTY