What is pglogical 2?
REL2_x_STABLEpglogical 2 is a PostgreSQL extension that provides logical streaming replication using a publish/subscribe model. It allows for selective replication of tables, rows, or columns, and supports use cases such as major version upgrades, full database replication, and data merging from multiple upstream servers.
Core Concepts
- Nodes: PostgreSQL database instances.
- Providers and Subscribers: The roles taken by Nodes in the replication stream.
- Replication Set: A collection of tables to be replicated.
Architectural Model
- Per-database level: Unlike physical streaming replication which works at the server level, pglogical operates on a per-database basis.
- One-to-Many: One Provider can feed multiple Subscribers without additional disk write overhead.
- Many-to-One: One Subscriber can merge changes from several origins and handle conflicts via configurable resolution.
- Cascading: Implemented via changeset forwarding.