postgresql – database synchronization in a way without connection

We have a centralized web application, with its own database. And we need to distribute desktop applications with their own local database, with the same data.

enter the description of the image here

These desktop applications do not have access to the Internet, so they must be run with their own local database.
Initially, the applications will be installed with a dump from the centralized database.

Then, from time to time, users will have the opportunity to use a PC with an Internet connection and download the latest changes to the database. Then, these updates will be transferred through a flash drive to your own desktop computers. To make this request, you could ask them when their last update was. I think that in this way we could calculate the inserts / eliminations / differential updates between the local and remote databases.

The database has ~ 250 tables, but not all have to be synchronized.

Both the web server and the desktop applications use:

  • Postgres 9.5
  • sqlalchemy
  • marshmallow

In this scenario, I could give advice on how to achieve one-way off-line synchronization, taking into account the restrictions of external keys and that kind of thing.