A Brief History of Logical Replication in Postgres

This blog is divided into two parts. In this section, we walk through how the Postgres logical replication feature has evolved over the years, what the recent improvements for logical replication are, and how the feature will likely change in the future. The second blog of the series will discuss the multi-master (active-active), multi-region, and highly available PostgreSQL cluster created by pgEdge that is built on top of logical replication and pgLogical.  

Postgres replication is the process of copying data between systems. PostgreSQL supports two main methods of replication: logical replication and physical replication. Physical replication copies the data exactly as it appears on the disk to each node in the cluster. Physical replication requires all nodes to use the same major version to accommodate on-disk changes between the major versions of PostgreSQL.

Plotting the Evolution of Logical Replication in PostgreSQL 16

PostgreSQL, a robust and open-source relational database system, is renowned for its native replication mechanisms, logical replication, and physical replication (also known as streaming replication). PostgreSQL 16 includes numerous improvements in logical replication designed to enhance performance, bolster data consistency, and advance compatibility.

In the context of PostgreSQL, logical replication employs a publisher/subscriber model to mirror changes between PostgreSQL servers. The primary node, where the database resides, is the publisher, while the stand-by node, which receives transaction copies, is the subscriber. Changes in the database are replicated from the publisher node to one or more subscriber node(s) identified by the subscription.