0

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?

JimF
  • 139
  • 2
  • 13
  • 1
    Logical replication can handle network outages, but a long outage can inflate the `pg_wal` directory on the primary. With the little information I have, that's all I can say. – Laurenz Albe May 15 '20 at 13:44
  • Laurenz, thank you for the answer. I've spent some time looking and couldn't find a case study supporting the idea. I may have to publish my findings after I give it a try. – JimF May 15 '20 at 17:09

1 Answers1

0

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/

Stavros Koureas
  • 1,126
  • 12
  • 34