Postgres 12 logical replication to sometimes connected subscribers?

205 views Asked by At

I've been asked to setup a Postgres 12 system with 2 servers. One local and one downrange with very unreliable network connectivity. We need to replicate data between the two systems with a multi-publisher setup. Will either native logical replication or pglogical support this situation? If so, which would you recommend and why?

1

There are 1 answers

0
Stavros Koureas On

As @Laurenz Albe explained also in the comments, Logical Replication and PGLogical have the ability to know which records have been replicated to destination, so even an outage occur or a network disconnection, when connection is back, the replication will start from the point it left.

Keep in mind that during that time, all the transactions will be kept in log and in the end the wal file may be increase so much that it would fill up the disk space and make the sever to act in readmode only. Of course there are settings to prevent that but you are about to lose transactions and finally cause database inconsistencies.

Read more here:

https://postgresqlco.nf/doc/en/param/max_slot_wal_keep_size/