Creating a Replica Using Logical Replication

In this section, you’ll go back to the roots of this chapter and muck around with the PostgreSQL configuration. Instead of configuring physical replication, you’ll set up “logical” replication. Fortunately, you’ll re-use much of what you did before, so it will be less work.

What is logical replication? Logical replication is different in that it’s a configurable type of replication. With logical replication, you can choose specific databases, specific tables, and even specific DML operations within those tables to replicate. For example, you’ll configure replication to send only INSERT operations.

Logical replication has a big trade-off, though. Only DML operations (as of PostgreSQL 16) are replicated. ...

Get High Performance PostgreSQL for Rails now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.