Re: proposal: multiple read-write masters in a cluster with wal-streaming synchronization

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Mark Dilger <markdilger(at)yahoo(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: multiple read-write masters in a cluster with wal-streaming synchronization
Date: 2014-01-02 09:17:45
Message-ID: 20140102091745.GF2683@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-12-31 13:51:08 -0800, Mark Dilger wrote:
> The BDR documentation http://wiki.postgresql.org/images/7/75/BDR_Presentation_PGCon2012.pdf
> says,
>
>     "Physical replication forces us to use just one
>      node: multi-master required for write scalability"
>
>     "Physical replication provides best read scalability"
>
> I am inclined to agree with the second statement, but
> I think my proposal invalidates the first statement, at
> least for a particular rigorous partitioning over which
> server owns which data.

I think you *massively* underestimate the amount of work implementing
this would require.
For one, you'd need to have a catalog that is written to on only one
server, you cannot have several nodes writing to the same table, even if
it's to disparate oid ranges. So you'd need to partition the whole
catalog by oid ranges - which would be a major efficiency loss for many,
many cases.

Not to speak of breaking pg_upgrade and noticeably increasing the size
of the catalog due to bigger oids and additional relations.

> So for me, multi-master with physical replication seems
> possible, and would presumably provide the best
> read scalability.

What you describe isn't really multi master though, as every row can
only be written to by a single node (the owner).

Also, why would this have a better read scalability? Whether a row is
written by streaming rep or not doesn't influence read speed.

> Or I can use logical replication such as BDR, but then the servers
> are spending more effort than with physical replication,
> so I get less bang for the buck when I purchase more
> servers to add to the cluster.

The efficiency difference really hasn't to be big if done right. If
you're so write-heavy that the difference is becoming a problem you
wouldn't implement a shared-everything architecture anyway.

> Am I missing something here?  Does BDR really provide
> an equivalent solution?

Not yet, but the plan is to get there.

> Second, it seems that BDR leaves to the client the responsibility
> for making schemas the same everywhere.  Perhaps this is just
> a limitation of the implementation so far, which will be resolved
> in the future?

Hopefully something that's going to get lifted.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-01-02 09:19:54 Re: [PATCH] Store Extension Options
Previous Message Andres Freund 2014-01-02 09:10:14 Re: What exactly is drop-index-concurrently-1.spec trying to test?