Logical replication - AWS Prescriptive Guidance

Logical replication

Logical replication is row-level replication. You can set up logical replication between primary and secondary databases. Logical replication supports INSERT, UPDATE, DELETE, and TRUNCATE operations, but it doesn't support DDL operations such as CREATE, ALTER, and DROP.

Architecture

The following diagram shows the architecture for setting up HADR for your on-premises PostgreSQL database on Amazon EC2 by using logical replication.

Logical replication architecture

In both physical and logical replication, you don't have the automatic failover option that you have in Amazon RDS and Amazon Aurora. However, you can use Patroni and etcd for automatic failover management.

Limitations

We recommend that you consider the following limitations of using logical replication before starting your migration:

  1. The schema/DDL isn't replicated.

  2. Tables must have a primary key or unique key.

  3. Sequences aren't replicated.