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)333Standard HA, tolerates any one failure
Four-node (full)111+3Demo setup, single INFRA/ETCD
Production (simu)23nn2 INFRA, 3 ETCD
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 supplies the minimum full HA configuration. It tolerates the failure of any one node and recovers automatically.

IDNODEPGSQLINFRAETCD
1node-1pg-meta-1infra-1etcd-1
2node-2pg-meta-2infra-2etcd-2
3node-3pg-meta-3infra-3etcd-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

If your virtualization environment or hardware resources permit it, use more nodes to deploy modules separately. Dedicated nodes can improve reliability, monitoring, and performance.

IDNODEINFRAETCDMINIOPGSQL
110.10.10.10infra-1pg-meta-1
210.10.10.11infra-2pg-meta-2
310.10.10.21etcd-1
410.10.10.22etcd-2
510.10.10.23etcd-3
610.10.10.31minio-1
710.10.10.32minio-2
810.10.10.33minio-3
910.10.10.34minio-4
1010.10.10.40pg-src-1
1110.10.10.41pg-src-2
1210.10.10.42pg-src-3
1310.10.10.50pg-test-1
1410.10.10.51pg-test-2
1510.10.10.52pg-test-3
16……

Was this page helpful?