Distributed PG Databases advice (Continental wide)
Doug Easterbrook
doug at artsman.com
Sun May 31 17:14:47 UTC 2026
hi MIke:
you can do streaming replications of entire database clusters from one location to another.
the replication server is read only. but replication is near instantaneous.
so you can adjust your app to read/wrrite transactions to the main server and then have a second session to the read only server to do record searching and reading.
You can do logical replication to stream certain tables to another database. this might be used for tables, lookups and such … things that don’t change as much. And then update the main database in the central location. In this approach, you choose what data you want to be distributed
or you can do multi-master replication where you write locally and postgres is configured to send the changes around all your databases.. Each database is a master database and each is a replication.
or, you can keep one database … and accept some degree of latency as the price of having a central database. Then you can cache important data inside your application (eg, read certain tables or records in full and keep them in memory — then refresh them if periodically if they get stale).
we’ve done streaming replication and mitigated it with caching important tables locally… and then done a bunch of work to optimize the SQL when retrieving data for reporting. (i.e. we don’t read every record and summarize at the workstation for a report, we use sort/group by to get only the required data for a report .. something we should have done years ago … but then DML didn’t allow that and our migration to SQL addressed that belatedly, albeit years ago).
there are a bunch tool and how to’s out there that talk about:
- streaming replication
- multi-master tools
- logical replication
and really. think hard before you go about distributing your data regardless of database server. You end up trading a degree of simplicity (and more latency) for a degree of complexity.
there are also political ramifications to store data around the world. For instance, I would store data in other places before I put it in the US (privacy laws, GDPR etc).
Doug Easterbrook
> On May 31, 2026, at 1:20 AM, Mike Matthews - Omnis via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
>
> Good Morning All,
>
> We have moved some local server PostGes databases to Azure. This is using Azure Postgres as a service, not a Windows VM with Postgres running inside, which we have done in the past.
>
> Once I figured out the SSL part, adding the right parts to Omnis etc (I wish the Tech Doc would just say Add these files here, here & here), We can connect just fine. If your internet connection is a fibre one, the response is almost as fast as the local network version, which is awesome.
>
> This is just fine if the Azure datacenter is in the same country as you. There are stats provided for latency for Azure access from different continents / countries amazingly, and updated:
> https://learn.microsoft.com/en-us/azure/networking/azure-network-latency?tabs=APAC%2CAusNz#round-trip-latency-figures
>
> The latency becomes an issue when users are in a different country, as the latency then becomes a big issue. How do you overcome this? I want to provide R/W access to every user, as some suggestions include setting up R/O copies. I’m looking for a cluster/replication type of setup. We don’t expect to see clashes where two users might update the same record, and we have controls for that mainly, but it could potentially happen, but as replication should happen within 1-5 seconds, this should not be an issue.
>
> How do users setup PostGres to be distributed across different continents?
>
> I have read about PGEdge https://www.pgedge.com/solutions/benefit/multi-master
>
> Thanks
>
> Mike Matthews
>
> Lineal Software Solutions
> Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>
>
> omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>
>
> www.lineal.co.uk<http://www.lineal.co.uk/>
>
> www.sqlworks.co.uk<http://www.sqlworks.co/>
>
>
>
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list