Skip to content

Planning Architecture and Nodes

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

Pigsty uses a modular architecture. Select the modules for your requirements and define the deployment through declarative configuration.

Common Patterns

Use these common deployment patterns as a starting point. Adjust the configuration for your requirements:

PatternINFRAETCDPGSQLMINIODescription
Single-node (meta)111Single-node deployment default
Slim deploy (slim)11Database only, no monitoring infra
Infra-only (infra)1Monitoring infrastructure only
Rich deploy (rich)1111Single-node + object storage + local repo with all extensions
Multi-node PatternINFRAETCDPGSQLMINIODescription
Two-node (dual)112Semi-HA, tolerates specific node failure
Three-node (trio)3333Three-node HA, Silo EC:1
Four-node (full)111+3Demo setup, single INFRA/ETCD
Production simulation (simu)359420 nodes, including 2 additional proxies
Large-scale (custom)35nn3 INFRA, 5 ETCD

Select the architecture for your reliability requirements and available resources. Production deployments with full high availability require at least 3 nodes. With 2 nodes, use the Semi-HA configuration.

Architecture planning service

Architecture Consulting Services can help you plan the Pigsty configuration.

Trade-offs

  • Monitoring requires at least 1 INFRA node. Production typically uses 2 nodes; large deployments use 3.
  • PostgreSQL HA requires at least 1 ETCD node. Production typically uses 3 nodes; large deployments use 5. An even-member ETCD cluster tolerates no more failures than an odd-member cluster with one fewer member. Prefer an odd number of members.
  • Silo object storage requires at least 1 MINIO node. Production typically uses 4 or more nodes in an MNMD cluster.
  • Production PostgreSQL clusters typically have at least two nodes: a primary and a replica. More demanding deployments use 3 nodes. Deployments with high read loads can have dozens of replicas.
  • Advanced PostgreSQL configurations include offline instances, synchronous instances, standby clusters, and delayed clusters.

Single-Node Setup

The single-node configuration puts all components on one node. It installs four core modules by default. Use it for demonstrations, development, or testing.

IDNODEPGSQLINFRAETCD
1node-1pg-meta-1infra-1etcd-1

An external S3/MinIO backup repository can supply the required recovery time and recovery point objectives (RTO/RPO). With this protection, a single-node configuration can serve standard production environments.

These single-node variants are available:

Two-Node Setup

The two-node configuration enables database replication and Semi-HA. It improves data redundancy and supplies limited automatic failover:

IDNODEPGSQLINFRAETCD
1node-1pg-meta-1 (replica)infra-1etcd-1
2node-2pg-meta-2 (primary)

Automatic recovery depends on which node fails:

  • If node-1 fails, manually promote node-2. Automatic failover is unavailable.
  • If node-2 fails, node-1 is automatically promoted.

Three-Node Setup

The three-node template deploys INFRA, ETCD, PGSQL, and MINIO (Silo) on every node. It tolerates one node failure when the remaining two can communicate and replica state permits failover. Silo uses a three-node, single-drive-per-node EC:1 pool. An existing single-node object store cannot be expanded directly into this topology; create a new pool and migrate objects.

IDNODEPGSQLINFRAETCDMINIO
1node-1pg-meta-1infra-1etcd-1minio-1
2node-2pg-meta-2infra-2etcd-2minio-2
3node-3pg-meta-3infra-3etcd-3minio-3

Four-Node Setup

The Pigsty Sandbox uses the standard four-node configuration.

IDNODEPGSQLINFRAETCD
1node-1pg-meta-1infra-1etcd-1
2node-2pg-test-1
3node-3pg-test-2
4node-4pg-test-3

In the demonstration configuration, INFRA and ETCD do not have HA. You can extend the configuration as follows:

IDNODEPGSQLINFRAETCDMINIO
1node-1pg-meta-1infra-1etcd-1minio-1
2node-2pg-test-1infra-2etcd-2
3node-3pg-test-2etcd-3
4node-4pg-test-3

More Nodes

The ha/simu simulation template and vagrant/spec/simu.rb currently use 20 nodes, separating key services into groups:

Node GroupIP RangeCountMain Role
infra / pg-meta10.10.10.10 to 10.10.10.123INFRA and metadata database cluster
proxy10.10.10.18 to 10.10.10.192HAProxy / VIP access
minio10.10.10.21 to 10.10.10.244Silo, four data disks per node
etcd10.10.10.25 to 10.10.10.295ETCD, also used as Redis Sentinel test nodes
pg-src10.10.10.31 to 10.10.10.333Source PostgreSQL cluster
pg-dst10.10.10.41 to 10.10.10.433Destination PostgreSQL cluster

This template simulates functionality and production topology. Size real production deployments and choose service placement according to capacity, failure domains, and dependencies.

Was this page helpful?

Table reader