Re: Multi-master replication - Mailing list pgsql-general

From Vijaykumar Jain
Subject Re: Multi-master replication
Date
Msg-id CAM+6J96XsfV67x-UF0odEwjOUPhfGXR_e8u3OVgB6+4UJQCeYw@mail.gmail.com
Whole thread Raw
In response to RE: Multi-master replication  (Zahir Lalani <ZahirLalani@oliver.agency>)
List pgsql-general


On Fri, Aug 13, 2021, 5:05 PM Zahir Lalani <ZahirLalani@oliver.agency> wrote:
Confidential

Thx Laura

So here is the dilemma - everything in the cloud world tends toward horizontal scaling. We do that with PG using single master and multiple slaves. But we are write heavy and of course the load on the master is quite high. It does seem that multi-master has risks (everyone seems to talk about conflict resolution!) so I wonder whether the sensible route is simply to scale vertically on the master?


  


There are claims from other databases that they offer multi master (cockroachdb, yugabyte, etc) out of the box, but there is little clarity on what would one has to compromise with.

You can always try sharding, postgres fdw can help you with that setup. In my implementation,  we agreed on write locally, read globally. That way writes could scale without compromise, but reads would be scatter gather (fdw support for parallel scan in pg14 is promising)

Then, there is citusdb that can help you shard seamlessly and rebalance too.






As you read more, multi master is not so simple, from what I read. 
I think there needs to be a good amount of thoughts for long term growth of apps, is sharding does not scale well.

In out case, apps were broken down from monoliths to small microservi es to deal with growth issues, and now it works well as single db as growth is not exponential ( also small dbs, less tuning, defaults work) but then one has to upgrade all the dbs periodically to catch up on releases.

As this is a postgresql list, I should not be posting mongo, but never the less a good read.

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Multi-master replication
Next
From: Laura Smith
Date:
Subject: RE: Multi-master replication