pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: nikolai@lusan.id.au
To: pgsql-general@lists.postgresql.org
Subject: Re: Advice for geographically dispersed multi master
Date: Thu, 03 Oct 2019 13:20:20 +0200
Message-ID: <76252c7d079e9d6a72b3bf1cc09098c98df070c4.camel@cybertec.at> (raw)
In-Reply-To: <cfccf95fb15bd9f8fcc286b174f0b650cc30e1c6.camel@lusan.id.au>
References: <cfccf95fb15bd9f8fcc286b174f0b650cc30e1c6.camel@lusan.id.au>

On Thu, 2019-10-03 at 19:05 +1000, Nikolai Lusan wrote:
> So I am looking to move my current setup of 3 separate, individual,
> postgres 11 servers into a multi master cluster.
> 
> I have read the various replication and clustering documentation for
> postgresql 11, and it looks like what I want is "Synchronous 
> Multimaster Replication". The organisation I am doing this for does 
> not have the money to throw at a commercial solution like BRD

Don't do it then.

As far as I know, there are only closed source solutions for this.

95% of all requests for multi-master replication come from people
who know little about databases and just want "a couple of databases
that all hold the same data and magically reconcile with each other".

Any multi-master solution will require the application to be
written with special awareness of a multi-master database.

For example, there will have to be special considerations with
auto-generated primary keys, and you will have to avoid certain
operations altogether.

Imagine this situation:

      DB 1                            DB 2

 DELETE FROM tab                UPDATE tab
 WHERE id = 42                  SET id = 1 WHERE id = 42

If these statements are executed at the same time on two
databases and then replicated, DB 2 will end up with one row
more in the table than DB 1.


Try to find a solution with a single master database.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (3+ messages)

Message-ID: <76252c7d079e9d6a72b3bf1cc09098c98df070c4.camel@cybertec.at>
Permalink:  ../76252c7d079e9d6a72b3bf1cc09098c98df070c4.camel@cybertec.at/
Also on:    postgresql.org/message-id/76252c7d079e9d6a72b3bf1cc09098c98df070c4.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, nikolai@lusan.id.au
  Subject: Re: Advice for geographically dispersed multi master
  In-Reply-To: <76252c7d079e9d6a72b3bf1cc09098c98df070c4.camel@cybertec.at>
  References: <cfccf95fb15bd9f8fcc286b174f0b650cc30e1c6.camel@lusan.id.au> <76252c7d079e9d6a72b3bf1cc09098c98df070c4.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox