Logical replication allows us to stream logical data changes between two nodes. By logical, we mean streaming changes to data without referring to specific physical attributes such as block number and row ID.
The main benefits of logical replication are as follows:
- Performance is roughly two times as better than that of the best trigger-based mechanisms
- Selective replication is supported, so we don't need to replicate the entire database (only available with pglogical at present)
- Replication can occur between different major releases, which can allow a zero-downtime upgrade
PostgreSQL 9.4 onwards provides a feature called logical decoding. This allows you to stream a set of changes out of a master server. This allows a master to become a sending node in logical replication. The receiving node requires a logical replication plugin to allow replication...