Horizontal scaling

🌐 This document is available in both English and Ukrainian. Use the language toggle in the top right corner to switch between versions.

A horizontally scalable architecture implemented for the PostgreSQL database supports dynamically adding and removing nodes, which enables you to increase system performance if needed and save resources when the load decreases.

Within this architecture, Crunchy PGO manages PostgreSQL and handles read-only replicas by adding or removing them according to the configuration.

Additionally, PgPool-II is used to route all requests to the database to the appropriate nodes. PgPool-II is a powerful middleware that acts as a proxy between clients and PostgreSQL database nodes.

PgPool-II sends all write requests to the primary node, which manages the main copy of the database. In synchronous replication mode, all replicas receive requests and replicate data from the primary node. This ensures all nodes have the same data, and any changes made to the primary node appear on the replicas in real time.

For non-write queries, PgPool-II balances the load across all nodes. This helps distribute load across all nodes and improves the overall system performance and response time.