High availability in PostgreSQL doesn't always require a globally distributed architecture. Sometimes you need reliable failover and replication within a single datacentre or region. pgEdge Enterprise Postgres handles this scenario with a production-ready PostgreSQL distribution that includes the tools you need for high availability out of the box.

What You Get

pgEdge Enterprise Postgres bundles PostgreSQL with components you'd otherwise install and configure separately. The distribution includes pgBouncer for connection pooling, pgBackRest for backup and restore, pgAudit for audit logging, and pgAdmin for database management. You also get PostGIS and pgVector if you need geographic or vector comparison capabilities.

High availability support is added in through the addition of open-source PostgreSQL extensions from pgEdge (all available to work with on GitHub), like spock, lolor, and snowflake sequences.

The package supports PostgreSQL versions 16, 17, and 18 running on Red Hat Enterprise Linux v9 and v10 (including Rocky, Alma, and Oracle Enterprise) on both x86 and ARM architectures. You can currently deploy it as a VM, and we'll be adding container and managed cloud editions soon (keep an eye on our social channels for updates along the way).

High Availability Through Physical and Logical Replication

pgEdge Enterprise Postgres supports physical replication with automated failover for traditional high availability setups. This works for the standard scenario where you need a primary database with standby replicas ready to take over if the primary fails.

For more advanced scenarios, Spock comes bundled out-of-the-box to enable logical multi-master replication. Unlike physical replication that copies entire database clusters at the block level, Spock uses PostgreSQL's logical decoding to replicate individual table changes between nodes. This enables active-active deployments where multiple nodes can accept writes simultaneously.

Spock: Multi-Master Replication for High Availability

Spock provides multi-master replication for PostgreSQL 15 and later. The extension comes pre-integrated with pgEdge Enterprise Postgres, built against a patched 100% standard PostgreSQL installation that integrates necessary hooks directly into the database engine.

Core Capabilities

Spock replicates data between nodes using logical decoding. You can configure provider and subscriber nodes, add tables to replication sets, and create subscriptions that keep data synchronised across multiple PostgreSQL instances. The extension supports replicating tables from the same schemas across nodes.

The extension tracks commit timestamps for conflict resolution. When multiple nodes update the same row simultaneously, Spock uses these timestamps to determine which change takes precedence. This is important for high availability because you can continue processing transactions on any available node without waiting for failover procedures.

Beyond Table Data

Spock integrates with additional extensions included in pgEdge Enterprise Postgres:

LOLOR (Large Object Logical Replication) extends Spock to replicate PostgreSQL large objects. Standard logical replication doesn't handle large objects, but LOLOR adds this capability so you can replicate binary data stored using PostgreSQL's large object facility.

Snowflake Sequences handles sequence replication across nodes. In a multi-master setup, you need sequences that won't generate conflicting values across different nodes. This extension provides sequences that work correctly in distributed scenarios where multiple nodes generate IDs simultaneously.

Schema Requirements

Spock requires tables to have identical structures across all nodes. Tables must have the same names, schemas, column definitions, and primary keys. Check constraints and not null constraints need to be the same or more permissive on the subscriber than on the provider.

This strictness exists because logical replication applies changes based on row identity through the primary key. The extension needs matching schemas to reliably identify and update rows across nodes.

High Availability Without Downtime

With Spock configured across multiple nodes, you can route traffic to any node in your cluster. If one node fails, your application continues writing to the remaining nodes without downtime. You don't wait for a failover election or for a standby to get promoted to primary.

This differs from physical replication where only the primary accepts writes. With Spock, every node can accept writes, giving you true active-active capability within your datacentre or region.

Connection Pooling and Workload Management

pgBouncer handles connection pooling to manage database connections efficiently. This is important for high availability because connection storms during failover events can overwhelm a database. With connection pooling in place, you can limit and manage connections to prevent resource exhaustion when traffic shifts between nodes.

The bundled pgBouncer configuration works with the rest of the stack, so you don't need to figure out how to integrate a separate connection pooler with your replication setup.

Backup and Recovery

pgBackRest provides advanced backup and restore capabilities. In a high availability setup, you need reliable backups that work with your replication architecture. pgBackRest handles full and incremental backups, parallel backup and restore operations, and can work across multiple repositories.

Having integrated backup tooling means your backup strategy accounts for your replication setup from the start, rather than bolting on backup solutions that might not understand your multi-node configuration.

The Open Source Approach

pgEdge Enterprise Postgres runs on 100% standard PostgreSQL (bar some small patches which do not affect compatibility) with no proprietary forks. The distribution is fully open source, licenced under the permissive PostgreSQL Licence. You can use any extensions or tools from the PostgreSQL ecosystem that you'd like.

Need support for PostgreSQL and the included tools in your deployments? pgEdge offers 24x7x365 support subscriptions with access to PostgreSQL experts. Forward Deployed Engineer services are available for organisations that need dedicated assistance with architecture reviews, performance tuning, and ongoing guidance.

When to Use pgEdge Enterprise Postgres

Consider using pgEdge Enterprise Postgres when you need high availability within a single geographic region or datacentre, when you want to avoid managing multiple PostgreSQL installations and extensions separately, or when you need the option to scale to multi-master replication without changing your entire infrastructure.

If you value having a tested, integrated stack over assembling individual components yourself, this package is designed for you. The logical replication capabilities through Spock add flexibility that physical replication can't provide, particularly for scenarios where you need multiple writable nodes or want to minimise downtime during maintenance windows.

Read more about how to get started in the official pgEdge Enterprise Postgres docs, or check out the pgEdge GitHub page to browse our code repositories. Have any questions along the way? You can join our official Discord community channel - we're here to help!