Skip to content

Planning Architecture and Nodes

How many nodes? Which modules need HA? How to plan based on available resources and requirements?
How many nodes? Which modules need HA? How to plan based on available resources and requirements?

Pigsty uses a modular architecture. You can combine modules like building blocks and express your intent through declarative configuration.

Common Patterns

Here are common deployment patterns for reference. Customize based on your requirements:

Pattern INFRA ETCD PGSQL MINIO Description
Single-node (meta) 1 1 1 Single-node deployment default
Slim deploy (slim) 1 1 Database only, no monitoring infra
Infra-only (infra) 1 Monitoring infrastructure only
Rich deploy (rich) 1 1 1 1 Single-node + object storage + local repo with all extensions
Multi-node Pattern INFRA ETCD PGSQL MINIO Description
Two-node (dual) 1 1 2 Semi-HA, tolerates specific node failure
Three-node (trio) 3 3 3 Standard HA, tolerates any one failure
Four-node (full) 1 1 1+3 Demo setup, single INFRA/ETCD
Production (simu) 2 3 n n 2 INFRA, 3 ETCD
Large-scale (custom) 3 5 n n 3 INFRA, 5 ETCD

Your architecture choice depends on reliability requirements and available resources. Serious production deployments require at least 3 nodes for HA configuration. With only 2 nodes, use Semi-HA configuration.

Expert Consulting: Architecture Planning

We offer Architecture Consulting Services to help plan your Pigsty configuration.


Trade-offs

  • Pigsty monitoring requires at least 1 INFRA node. Production typically uses 2; large-scale deployments use 3.
  • PostgreSQL HA requires at least 1 ETCD node. Production typically uses 3; large-scale uses 5. Even-member clusters work, but do not tolerate more failures than an odd cluster with one fewer member, so prefer odd sizes.
  • Silo object storage through the MINIO module requires at least 1 MINIO node. Production typically uses 4+ nodes in MNMD clusters.
  • Production PG clusters typically use at least two-node primary-replica configuration; serious deployments use 3 nodes; high read loads can have dozens of replicas.
  • For PostgreSQL, you can also use advanced configurations: offline instances, sync instances, standby clusters, delayed clusters, etc.

Single-Node Setup

The simplest configuration with everything on a single node. Installs four essential modules by default. Typically used for demos, devbox, or testing.

ID NODE PGSQL INFRA ETCD
1 node-1 pg-meta-1 infra-1 etcd-1

With an external S3/MinIO backup repository providing RTO/RPO guarantees, this configuration works for standard production environments.

Single-node variants:


Two-Node Setup

Two-node configuration enables database replication and Semi-HA capability with better data redundancy and limited failover support:

ID NODE PGSQL INFRA ETCD
1 node-1 pg-meta-1 (replica) infra-1 etcd-1
2 node-2 pg-meta-2 (primary)

Two-node HA auto-failover has limitations. This “Semi-HA” setup only auto-recovers from specific node failures:

  • If node-1 fails: No automatic failover—requires manual promotion of node-2
  • If node-2 fails: Automatic failover works—node-1 auto-promoted

Three-Node Setup

Three-node template provides true baseline HA configuration, tolerating any single node failure with automatic recovery.

ID NODE PGSQL INFRA ETCD
1 node-1 pg-meta-1 infra-1 etcd-1
2 node-2 pg-meta-2 infra-2 etcd-2
3 node-3 pg-meta-3 infra-3 etcd-3

Four-Node Setup

Pigsty Sandbox uses the standard four-node configuration.

ID NODE PGSQL INFRA ETCD
1 node-1 pg-meta-1 infra-1 etcd-1
2 node-2 pg-test-1
3 node-3 pg-test-2
4 node-4 pg-test-3

For demo purposes, INFRA / ETCD modules aren’t configured for HA. You can adjust further:

ID NODE PGSQL INFRA ETCD MINIO
1 node-1 pg-meta-1 infra-1 etcd-1 minio-1
2 node-2 pg-test-1 infra-2 etcd-2
3 node-3 pg-test-2 etcd-3
4 node-4 pg-test-3

More Nodes

With proper virtualization infrastructure or abundant resources, you can use more nodes for dedicated deployment of each module, achieving optimal reliability, observability, and performance.

ID NODE INFRA ETCD MINIO PGSQL
1 10.10.10.10 infra-1 pg-meta-1
2 10.10.10.11 infra-2 pg-meta-2
3 10.10.10.21 etcd-1
4 10.10.10.22 etcd-2
5 10.10.10.23 etcd-3
6 10.10.10.31 minio-1
7 10.10.10.32 minio-2
8 10.10.10.33 minio-3
9 10.10.10.34 minio-4
10 10.10.10.40 pg-src-1
11 10.10.10.41 pg-src-2
12 10.10.10.42 pg-src-3
13 10.10.10.50 pg-test-1
14 10.10.10.51 pg-test-2
15 10.10.10.52 pg-test-3
16 ……