4 ms·
How does pglogical differ from PostgreSQL's built-in streaming or log-shipping replication?
by continuations 10y ago
How does pglogical differ from PostgreSQL's built-in streaming or log-shipping replication?
- pinaraf 10y agoPostgreSQL streaming : send disk diffs over network, raw binary, absolutely unusable if you don't have the same postgresql version on the other side Logical : send data diffs over network. Could be used for replication, but also audit or sending to different databases...
- martinmarques 10y agopglogical works over the logical decoding code introduced in 9.4, so instead of sending over binary changes of the data files (SR just sends a change that says change these bytes on page X -- well, not super exact, but it gives you a picture of whats done), while logical decoding will read the WAL log, decode the changes so you can apply them else were by some plugin (pglogical would serve as a plugin in this case). I think the best way to show how it would work (and this is not what pglogical does as it would be inefficient) is by writing a plugin that feeds the logical decoded changes from the WAL and builds SQL statements from them UPDATE, INSERT, DELETE, etc. You could easily apply those on any other PostgreSQL server, or maybe even some other SQL server. Very handy for online upgrades.