Lately, the terms active-active and active-passive have been making the rounds on the internet, applying to everything from storage processes to cluster architectures to firewalls.  In this post, we'll talk about pgEdge active-active replication, and how it can reduce latency and improve high availability in distributed Postgres database applications.

Active-active replication and active-passive replication use different strategies to replicate data between on-prem hosts or in the cloud. Wherever your database lives, it needs to ensure reliability, fault tolerance, and quick disaster recovery. Your replication strategy needs to take into account how your systems interact, handle networking, and how close to the edge your data can be.

Active-Active Replication

In an active-active replication environment, each node can replicate data to other nodes in the cluster. The nodes are synchronized to maximize data distribution across the network, placing information nearest to those users that need to read or modify it. Each node can be configured to act as a:

  • read-only node, serving up content without allowing the data to be modified and replicated to other nodes.

  • read-write node, replicating content to other nodes and satisfying user queries.

Active-Passive Replication

In an active-passive replication environment, a single node writes data to the database.  This can lead to overburdening the active node while the passive nodes stand by, waiting to take over if necessary. With the addition of third-party load balancing, the passive node can satisfy user read queries, but it is still dependent on the active node to ensure that the content remains fresh.  Network slowdowns can place a heavy burden on the active node; in the event of a node failure, replacing the active node with a passive node can slow the system to a stop.

Active-active high availability graphic

Achieving High Availability and Low Latency with Active-Active Replication

Active-active replication is your best solution when network latency and high-availability are important. Keeping copies of the database closer to where users are located and employing load balancing improves performance for query-only users, while distributing write transactions across multiple servers makes it a responsive solution for critical applications. If one node fails, other nodes continue serving and writing data across the network without interruption.

Active-active replication is also key when meeting data residency requirements. Multiple active nodes can act to improve performance in each business region while still preserving the data isolation (via selective replication) across borders required by regulations.

While active-active replication is more complex to configure than active-passive replication, the benefits far outweigh the burden for enterprise-level software.  pgEdge Distributed PostgreSQL simplifies deployment and configuration so you can focus on your application and your business.  pgEdge also scales to meet your needs; adding a new node, database, or cluster to your replication scenario is straightforward with pgEdge.  pgEdge is available through either pgEdge Cloud, a fully managed cloud service, or pgEdge Platform, self-hosted and self-managed software.  Visit pgedges.com to learn more.