pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Multi Master Replication
27+ messages / 17 participants
[nested] [flat]

* Multi Master Replication
@ 2013-12-18 09:31 itishree sukla <itishree.sukla@gmail.com>
  2013-12-18 20:16 ` Re: Multi Master Replication John R Pierce <pierce@hogranch.com>
  2013-12-19 07:52 ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
  2013-12-20 04:01 ` Re: Multi Master Replication John R Pierce <pierce@hogranch.com>
  2013-12-23 21:40 ` Re: Multi Master Replication pax <pax.deckard@gmail.com>
  0 siblings, 4 replies; 27+ messages in thread

From: itishree sukla @ 2013-12-18 09:31 UTC (permalink / raw)
  To: pgsql-general

Hi all,

I need suggestion about setting up multi master replication between two
postgresql server place two different geographical area. As i know using
some third party tool like Bucardo,RubyRep it can be achievable, not sue
which is the good one to use. If any one  can provide me some online
documentation links, it will help me as well.


Thanks in advance.

Regards,
Itishree

^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
@ 2013-12-18 20:16 ` John R Pierce <pierce@hogranch.com>
  2013-12-18 23:12   ` Re: Multi Master Replication Scott Marlowe <scott.marlowe@gmail.com>
  3 siblings, 1 reply; 27+ messages in thread

From: John R Pierce @ 2013-12-18 20:16 UTC (permalink / raw)
  To: pgsql-general

On 12/18/2013 1:31 AM, itishree sukla wrote:
> I need suggestion about setting up multi master replication between 
> two postgresql server place two different geographical area. As i know 
> using some third party tool like Bucardo,RubyRep it can be achievable, 
> not sue which is the good one to use. If any one  can provide me some 
> online documentation links, it will help me as well.

that sort of replication is very problematic.   its virtually impossible 
to maintain ACID (Atomicity, Consistency, Isolation, Durability) and 
maintain any semblance of performance.

question for you, what do you expect to happen if the communications 
link between the servers is interrupted, and updates continue to be sent 
to both servers?

-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-18 20:16 ` Re: Multi Master Replication John R Pierce <pierce@hogranch.com>
@ 2013-12-18 23:12   ` Scott Marlowe <scott.marlowe@gmail.com>
  2013-12-19 05:25     ` Re: Multi Master Replication Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 27+ messages in thread

From: Scott Marlowe @ 2013-12-18 23:12 UTC (permalink / raw)
  To: John R Pierce <pierce@hogranch.com>; +Cc: pgsql-general

On Wed, Dec 18, 2013 at 1:16 PM, John R Pierce <pierce@hogranch.com> wrote:
> On 12/18/2013 1:31 AM, itishree sukla wrote:
>>
>> I need suggestion about setting up multi master replication between two
>> postgresql server place two different geographical area. As i know using
>> some third party tool like Bucardo,RubyRep it can be achievable, not sue
>> which is the good one to use. If any one  can provide me some online
>> documentation links, it will help me as well.
>
>
> that sort of replication is very problematic.   its virtually impossible to
> maintain ACID (Atomicity, Consistency, Isolation, Durability) and maintain
> any semblance of performance.
>
> question for you, what do you expect to happen if the communications link
> between the servers is interrupted, and updates continue to be sent to both
> servers?

When people start talking multi-master replication my first response
is to ask what problem you're trying to solve. Sometimes MM Rep IS the
answer. But quite often it's not the best one for your problem. So to
OP I'd ask what problem they're trying to solve.

-- 
To understand recursion, one must first understand recursion.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-18 20:16 ` Re: Multi Master Replication John R Pierce <pierce@hogranch.com>
  2013-12-18 23:12   ` Re: Multi Master Replication Scott Marlowe <scott.marlowe@gmail.com>
@ 2013-12-19 05:25     ` Michael Paquier <michael.paquier@gmail.com>
  2013-12-19 06:05       ` Re: Multi Master Replication Scott Marlowe <scott.marlowe@gmail.com>
  0 siblings, 1 reply; 27+ messages in thread

From: Michael Paquier @ 2013-12-19 05:25 UTC (permalink / raw)
  To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: John R Pierce <pierce@hogranch.com>; pgsql-general

On Thu, Dec 19, 2013 at 7:12 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Wed, Dec 18, 2013 at 1:16 PM, John R Pierce <pierce@hogranch.com> wrote:
>> that sort of replication is very problematic.   its virtually impossible to
>> maintain ACID (Atomicity, Consistency, Isolation, Durability) and maintain
>> any semblance of performance.
Yep, there's usually a trade-off between performance and data
consistency. OLTP applications can benefit from MM with a
shared-nothing architecture, more than data warehouse type of things
that need to transfer a lot of data for join operations, or SQL
operations that use non-pushable clauses (for example stable/volatile
functions).

>> question for you, what do you expect to happen if the communications link
>> between the servers is interrupted, and updates continue to be sent to both
>> servers?
Split-brain is another problem, hard to solve. Even harder if you have
several types nodes in your cluster dedicated to provide some piece
building the MM system.

> When people start talking multi-master replication my first response
> is to ask what problem you're trying to solve. Sometimes MM Rep IS the
> answer. But quite often it's not the best one for your problem. So to
> OP I'd ask what problem they're trying to solve.
Yes that's actually the right approach, multi-master replication is
often cited as a marketing term for a fantastic technology that can
solve a lot of problems, which could be solved with a couple of
Postgres servers using a single-master, multiple-slave approach, or by
simply design a system that can do data sharding among a set of
Postgres servers to achieve some kind of write scalability.

Regards,
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-18 20:16 ` Re: Multi Master Replication John R Pierce <pierce@hogranch.com>
  2013-12-18 23:12   ` Re: Multi Master Replication Scott Marlowe <scott.marlowe@gmail.com>
  2013-12-19 05:25     ` Re: Multi Master Replication Michael Paquier <michael.paquier@gmail.com>
@ 2013-12-19 06:05       ` Scott Marlowe <scott.marlowe@gmail.com>
  2013-12-19 07:41         ` Re: Multi Master Replication Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 27+ messages in thread

From: Scott Marlowe @ 2013-12-19 06:05 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: John R Pierce <pierce@hogranch.com>; pgsql-general

On Wed, Dec 18, 2013 at 10:25 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

> On Thu, Dec 19, 2013 at 7:12 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:

>> When people start talking multi-master replication my first response
>> is to ask what problem you're trying to solve. Sometimes MM Rep IS the
>> answer. But quite often it's not the best one for your problem. So to
>> OP I'd ask what problem they're trying to solve.

> Yes that's actually the right approach, multi-master replication is
> often cited as a marketing term for a fantastic technology that can
> solve a lot of problems, which could be solved with a couple of
> Postgres servers using a single-master, multiple-slave approach, or by
> simply design a system that can do data sharding among a set of
> Postgres servers to achieve some kind of write scalability.

Sharding with plproxy is pretty easy and can scale hugely.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-18 20:16 ` Re: Multi Master Replication John R Pierce <pierce@hogranch.com>
  2013-12-18 23:12   ` Re: Multi Master Replication Scott Marlowe <scott.marlowe@gmail.com>
  2013-12-19 05:25     ` Re: Multi Master Replication Michael Paquier <michael.paquier@gmail.com>
  2013-12-19 06:05       ` Re: Multi Master Replication Scott Marlowe <scott.marlowe@gmail.com>
@ 2013-12-19 07:41         ` Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 0 replies; 27+ messages in thread

From: Michael Paquier @ 2013-12-19 07:41 UTC (permalink / raw)
  To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: John R Pierce <pierce@hogranch.com>; pgsql-general

On Thu, Dec 19, 2013 at 2:05 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> Sharding with plproxy is pretty easy and can scale hugely.
Yeah indeed, the writable postgres_fdw could also be used as a
solution, if designed carefully.
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
@ 2013-12-19 07:52 ` Chris Travers <chris.travers@gmail.com>
  2013-12-19 14:52   ` Re: Multi Master Replication Wolfgang Keller <feliphil@gmx.net>
  3 siblings, 1 reply; 27+ messages in thread

From: Chris Travers @ 2013-12-19 07:52 UTC (permalink / raw)
  To: itishree sukla <itishree.sukla@gmail.com>; +Cc: pgsql-general

On Wed, Dec 18, 2013 at 1:31 AM, itishree sukla <itishree.sukla@gmail.com>wrote:

> Hi all,
>
> I need suggestion about setting up multi master replication between two
> postgresql server place two different geographical area. As i know using
> some third party tool like Bucardo,RubyRep it can be achievable, not sue
> which is the good one to use. If any one  can provide me some online
> documentation links, it will help me as well.
>

First suggestion:  don't.  Multi-master replication almost never is a win.
 I tell customers this and they don't like to hear it but it is true.

Second suggestion:  If you absolutely must, go with Bucardo.  Rubyrep might
work but it is db-agnostic and this raises additional complexity concerns.

The major reasons why I argue against multi-master replication are:

1.  With async replication you have the problem of conflict resolution.  In
some (rare) cases this is avoidable, but in most cases it is not.  You have
to deal with the fact that two different people in two different locations
may update the same row, and you have to decide how to handle this.  Once
you have a conflict, every option you have to resolve the conflict results
in data loss.   There are rare cases where this is the right solution.

2.  With sync replication, you have coordination problems and therefore it
is never (at least IME) a win compared to master-slave replication since
all writes must occur in the same order in the set, or you need global
sequences, or such.  So I would say that something like PGPool for
multi-master replication is just to be avoided generally (however for load
balancing in master/slave it can be a win).  You will never get better read
or write throughput, or a more robust system than you will with
master/slave replication in a synchronous environment.  Keep it simple.

As others have mentioned your best bet here is pl/proxy.  I would go a
little further however and suggest that you can separate storage dbs from
proxy db's and thus create the appearance of multi-master over a
master-slave setup.  If you are going to go this route however, I don't
know whether Postgres-XC would be worth looking into.

The key here though is that design effort is important.  If you carefully
design your federated storage, then you should be good.  However this leads
to lots of problems and you need to think them through.

-- 
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor
lock-in.
http://www.efficito.com/learn_more.shtml

^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-19 07:52 ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
@ 2013-12-19 14:52   ` Wolfgang Keller <feliphil@gmx.net>
  2013-12-19 15:18     ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
  0 siblings, 1 reply; 27+ messages in thread

From: Wolfgang Keller @ 2013-12-19 14:52 UTC (permalink / raw)
  To: pgsql-general

> 2.  With sync replication, you have coordination problems and
> therefore it is never (at least IME) a win compared to master-slave
> replication since all writes must occur in the same order in the set,
> or you need global sequences, or such.  

*snip*

>  You will never get better read or write throughput,

Better read throughput is trivial to achieve even with other solutions
than multi-master replication. 

And for better write throughput, the developers of Postgres-XC
(supported by NTT, among others) beg to differ:

http://postgresxc.wikia.com/wiki/Postgres-XC_Wiki
http://postgres-xc.sourceforge.net/

As does Bettina Kemme (of Postgres-R fame). 

Sincerely,

Wolfgang


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-19 07:52 ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
  2013-12-19 14:52   ` Re: Multi Master Replication Wolfgang Keller <feliphil@gmx.net>
@ 2013-12-19 15:18     ` Chris Travers <chris.travers@gmail.com>
  2013-12-20 00:48       ` Re: Multi Master Replication Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 27+ messages in thread

From: Chris Travers @ 2013-12-19 15:18 UTC (permalink / raw)
  To: Wolfgang Keller <feliphil@gmx.net>; +Cc: pgsql-general

On Thu, Dec 19, 2013 at 6:52 AM, Wolfgang Keller <feliphil@gmx.net> wrote:

> > 2.  With sync replication, you have coordination problems and
> > therefore it is never (at least IME) a win compared to master-slave
> > replication since all writes must occur in the same order in the set,
> > or you need global sequences, or such.
>
> *snip*
>
> >  You will never get better read or write throughput,
>
> Better read throughput is trivial to achieve even with other solutions
> than multi-master replication.
>
> And for better write throughput, the developers of Postgres-XC
> (supported by NTT, among others) beg to differ:
>
> http://postgresxc.wikia.com/wiki/Postgres-XC_Wiki
> http://postgres-xc.sourceforge.net/


I am not quite sure what the point is.   I am not sure you will get the
same write extensibility if you list every table as replicated instead of
partitioned.  What Postgres-XC gives you ideally is a no-storage and
multi-master coordination layer on top of master-slave data nodes.  Some
things may need to be replicated multi-master between data nodes but that's
not a win write throughput-wise.

I am btw a reasonable fan of Postgres-XC within its problem domain, but it
is not a synchronous multi-master replication solution as far as write
scaling goes.

My point still holds, which is that synchronous multi-master replication
will never beat master-slave in write throughput.  My understanding of
Postgres-XC is that you'd mark tables as replicated (instead of
partitioned) when they are going to be joined against by different nodes
and infrequently updated (and hence the write overhead is less of a problem
than the cross-node join overhead).

Am I way off-base with my understanding here?  At any rate it isn't
Postgres-XC (which is something very different than a typical "replication"
setup, and I would describe it more as an advanced sharding solution).

Best Wishes,
Chris Travers

>
>
> As does Bettina Kemme (of Postgres-R fame).
>
> Sincerely,
>
> Wolfgang
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



-- 
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor
lock-in.
http://www.efficito.com/learn_more.shtml

^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-19 07:52 ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
  2013-12-19 14:52   ` Re: Multi Master Replication Wolfgang Keller <feliphil@gmx.net>
  2013-12-19 15:18     ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
@ 2013-12-20 00:48       ` Michael Paquier <michael.paquier@gmail.com>
  2013-12-20 03:37         ` Re: Multi Master Replication Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 27+ messages in thread

From: Michael Paquier @ 2013-12-20 00:48 UTC (permalink / raw)
  To: Chris Travers <chris.travers@gmail.com>; +Cc: Wolfgang Keller <feliphil@gmx.net>; pgsql-general

On Thu, Dec 19, 2013 at 11:18 PM, Chris Travers <chris.travers@gmail.com> wrote:
>
>
>
> On Thu, Dec 19, 2013 at 6:52 AM, Wolfgang Keller <feliphil@gmx.net> wrote:
>>
>> > 2.  With sync replication, you have coordination problems and
>> > therefore it is never (at least IME) a win compared to master-slave
>> > replication since all writes must occur in the same order in the set,
>> > or you need global sequences, or such.
> I am not quite sure what the point is.   I am not sure you will get the same
> write extensibility if you list every table as replicated instead of
> partitioned.  What Postgres-XC gives you ideally is a no-storage and
> multi-master coordination layer on top of master-slave data nodes.  Some
> things may need to be replicated multi-master between data nodes but that's
> not a win write throughput-wise.
You'd kill the write scalability of the application by marking all the
tables as replicated. The communication between nodes uses SQL
strings, so a DML on a replicated table needs to occur on all the
nodes, and on top of that you need 2PC for a transaction commit if
more than 2 nodes are involved in write operations in this
transaction.

> I am btw a reasonable fan of Postgres-XC within its problem domain, but it
> is not a synchronous multi-master replication solution as far as write
> scaling goes.
OLTP applications that have a schema tunable for replication/partition
to maximize join pushdown might be a good definition of the
application range that could benefit from XC.

> My point still holds, which is that synchronous multi-master replication
> will never beat master-slave in write throughput.  My understanding of
> Postgres-XC is that you'd mark tables as replicated (instead of partitioned)
> when they are going to be joined against by different nodes and infrequently
> updated (and hence the write overhead is less of a problem than the
> cross-node join overhead).
Yep, exactly. Those tables are actually master tables and the point is
to maximize the number of join clause push down to minimize the amount
of data exchanged between the nodes because of the shared-nothing
infrastructure. The type of tables that should be marked as
partitioned is the once that keep growing and need to scale of the
type "user" tables. This is actually how DBT-1 has been tuned when
doing scaling testing with it: partition user and adress tables,
replicate stock and item tables.

Regards,
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-19 07:52 ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
  2013-12-19 14:52   ` Re: Multi Master Replication Wolfgang Keller <feliphil@gmx.net>
  2013-12-19 15:18     ` Re: Multi Master Replication Chris Travers <chris.travers@gmail.com>
  2013-12-20 00:48       ` Re: Multi Master Replication Michael Paquier <michael.paquier@gmail.com>
@ 2013-12-20 03:37         ` Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 0 replies; 27+ messages in thread

From: Michael Paquier @ 2013-12-20 03:37 UTC (permalink / raw)
  To: Chris Travers <chris.travers@gmail.com>; +Cc: Wolfgang Keller <feliphil@gmx.net>; pgsql-general

On Fri, Dec 20, 2013 at 8:48 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Thu, Dec 19, 2013 at 11:18 PM, Chris Travers <chris.travers@gmail.com> wrote:
>>
>>
>>
>> On Thu, Dec 19, 2013 at 6:52 AM, Wolfgang Keller <feliphil@gmx.net> wrote:
>>>
>>> > 2.  With sync replication, you have coordination problems and
>>> > therefore it is never (at least IME) a win compared to master-slave
>>> > replication since all writes must occur in the same order in the set,
>>> > or you need global sequences, or such.
>> I am not quite sure what the point is.   I am not sure you will get the same
>> write extensibility if you list every table as replicated instead of
>> partitioned.  What Postgres-XC gives you ideally is a no-storage and
>> multi-master coordination layer on top of master-slave data nodes.  Some
>> things may need to be replicated multi-master between data nodes but that's
>> not a win write throughput-wise.
> You'd kill the write scalability of the application by marking all the
> tables as replicated. The communication between nodes uses SQL
> strings, so a DML on a replicated table needs to occur on all the
> nodes, and on top of that you need 2PC for a transaction commit if
> more than 2 nodes are involved in write operations in this
> transaction.
>
>> I am btw a reasonable fan of Postgres-XC within its problem domain, but it
>> is not a synchronous multi-master replication solution as far as write
>> scaling goes.
> OLTP applications that have a schema tunable for replication/partition
> to maximize join pushdown might be a good definition of the
> application range that could benefit from XC.
>
>> My point still holds, which is that synchronous multi-master replication
>> will never beat master-slave in write throughput.  My understanding of
>> Postgres-XC is that you'd mark tables as replicated (instead of partitioned)
>> when they are going to be joined against by different nodes and infrequently
>> updated (and hence the write overhead is less of a problem than the
>> cross-node join overhead).
> Yep, exactly. Those tables are actually master tables and the point is
> to maximize the number of join clause push down to minimize the amount
> of data exchanged between the nodes because of the shared-nothing
> infrastructure. The type of tables that should be marked as
> partitioned is the once that keep growing and need to scale of the
> type "user" tables. This is actually how DBT-1 has been tuned when
> doing scaling testing with it: partition user and adress tables,
> replicate stock and item tables.
I actually wrote something stupid here, stock is partitioned and it
makes sense as it faces lot of updates:
http://images.wikia.com/postgresxc/images/6/66/PG-XC_Architecture.pdf (page 23)
Thanks to Chris for pointing that out.
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
@ 2013-12-20 04:01 ` John R Pierce <pierce@hogranch.com>
  3 siblings, 0 replies; 27+ messages in thread

From: John R Pierce @ 2013-12-20 04:01 UTC (permalink / raw)
  To: pgsql-general

14 replies so far, and the OP hasn't chimed in with any feedback as to 
what their presumed requirements are based on.


*meh*




-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
@ 2013-12-23 21:40 ` pax <pax.deckard@gmail.com>
  2013-12-23 22:06   ` Re: Multi Master Replication Anand Kumar, Karthik <Karthik.AnandKumar@classmates.com>
  3 siblings, 1 reply; 27+ messages in thread

From: pax @ 2013-12-23 21:40 UTC (permalink / raw)
  To: pgsql-general

Sometime ago i was looking for something like this and because at this time
XC was a little baby i tried installing bucardo but i gave up when stucked
fighting with perl modules. So, after testing some other solutions i decided
to make my own, just "touching" the trigger part of the pyreplica project
and building a daemon in a binary compiled program (no script) for a better
performance. It's working well by now, with some tables and few nodes (12
nodes deployed across long distances), but i was lucky then because the
database and the systems were still in design and development phases.
There are many things you have to keep in mind, as all people is warning
you. I tell you, it can be done, but you MUST redesign your existing
database preparing for multimaster paradigm where the key is avoid node
level concurrency, and your client database apps to THINK what to do when
nodes are down, but if you are not ready to prepare your database (design)
or you have not access to the source code of your client database apps then
you have problems.
I suggest you read this
http://www.dbspecialists.com/files/presentations/mm_replication.html and
this
http://scale-out-blog.blogspot.com/2012/04/if-you-must-deploy-multi-master.html.
Finally, i can mention another posible solution that i never tried but maybe
can help you, SymmetricDS.
Good luck.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Multi-Master-Replication-tp5783855p5784468.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi Master Replication
  2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
  2013-12-23 21:40 ` Re: Multi Master Replication pax <pax.deckard@gmail.com>
@ 2013-12-23 22:06   ` Anand Kumar, Karthik <Karthik.AnandKumar@classmates.com>
  0 siblings, 0 replies; 27+ messages in thread

From: Anand Kumar, Karthik @ 2013-12-23 22:06 UTC (permalink / raw)
  To: pax <pax.deckard@gmail.com>; pgsql-general

We use symmetricDS pretty extensively, across oracle and postgres
databases. It has its flaws and its strengths. It shines when there's
multiple database platforms involved, when the volume of transactions is
not too high, and supports multi master. Its optimized for wan topologies,
so its great if you have small amounts of data over longer distances, not
as great when there's several gigabytes needing transfer within the same
datacenter. It also has inbuilt insert vs update conflict resolution.

On the flip side, as the volume of writes increases, it can quickly lead
to significant database bloat and high CPU usage. Its also not as fast as
some other tools (like slony, or ora2pg) for initial loads of tables.

It exposes all of its switches and knobs (and there are a *lot* of
tunables), which make it both very flexible, but also prone to breakage if
you fiddle with it too much. Its in active development and we've found the
community forums to be pretty helpful when we run into undocumented bugs.

Let me know if you need help with it.

Thanks,
Karthik



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Multi-master replication
@ 2015-12-14 15:55 Dmitry Mordovin <d.mordovin@dwide.com>
  2015-12-14 16:38 ` Re: Multi-master replication Merlin Moncure <mmoncure@gmail.com>
  2015-12-14 17:31 ` Re: Multi-master replication Simon Riggs <simon@2ndQuadrant.com>
  0 siblings, 2 replies; 27+ messages in thread

From: Dmitry Mordovin @ 2015-12-14 15:55 UTC (permalink / raw)
  To: pgsql-general

Hello All!

As I heard, PostgreSQL 9.5 has built in Bi-Direction replication (or 
need install BDR module?).

I wants to play with multi-master, asynchronous replication on two 
servers PostgreSQL 9.5 beta 2.

In official docs very small information about how to configure servers.

Could anyone direct me in right way?

BR, Dmitry


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2015-12-14 15:55 Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
@ 2015-12-14 16:38 ` Merlin Moncure <mmoncure@gmail.com>
  2015-12-14 16:44   ` Re: Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
  1 sibling, 1 reply; 27+ messages in thread

From: Merlin Moncure @ 2015-12-14 16:38 UTC (permalink / raw)
  To: Dmitry Mordovin <d.mordovin@dwide.com>; Andres Freund <andres@2ndquadrant.com>; +Cc: pgsql-general

On Mon, Dec 14, 2015 at 9:55 AM, Dmitry Mordovin <d.mordovin@dwide.com> wrote:
> Hello All!
>
> As I heard, PostgreSQL 9.5 has built in Bi-Direction replication (or need
> install BDR module?).

Huh -- that may be so.  But if it is, it contradicts the BDR
documentation: http://bdr-project.org/docs/stable/install-requirements.html

Maybe Andres might know the answer?

> I wants to play with multi-master, asynchronous replication on two servers
> PostgreSQL 9.5 beta 2.
>
> In official docs very small information about how to configure servers.
>
> Could anyone direct me in right way?

Have you looked here?
https://wiki.postgresql.org/wiki/BDR_Quick_Start

merlin


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2015-12-14 15:55 Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
  2015-12-14 16:38 ` Re: Multi-master replication Merlin Moncure <mmoncure@gmail.com>
@ 2015-12-14 16:44   ` Dmitry Mordovin <d.mordovin@dwide.com>
  2015-12-14 16:51     ` Re: Multi-master replication Mario Soto Cordones <marioa.soto.cordones@gmail.com>
  0 siblings, 1 reply; 27+ messages in thread

From: Dmitry Mordovin @ 2015-12-14 16:44 UTC (permalink / raw)
  To: Merlin Moncure <mmoncure@gmail.com>; Andres Freund <andres@2ndquadrant.com>; +Cc: pgsql-general

Thank you Merlin,

I see this doc too. But I confused, in 9.5 BDR placed to native code and 
becomes built in feature.

So, need I install external BDR or try to config built in version ?

Or I didn't understood clearly.

BR, Dmitry




On 12/14/2015 08:38 PM, Merlin Moncure wrote:
> On Mon, Dec 14, 2015 at 9:55 AM, Dmitry Mordovin <d.mordovin@dwide.com> wrote:
>> Hello All!
>>
>> As I heard, PostgreSQL 9.5 has built in Bi-Direction replication (or need
>> install BDR module?).
> Huh -- that may be so.  But if it is, it contradicts the BDR
> documentation: http://bdr-project.org/docs/stable/install-requirements.html
>
> Maybe Andres might know the answer?
>
>> I wants to play with multi-master, asynchronous replication on two servers
>> PostgreSQL 9.5 beta 2.
>>
>> In official docs very small information about how to configure servers.
>>
>> Could anyone direct me in right way?
> Have you looked here?
> https://wiki.postgresql.org/wiki/BDR_Quick_Start
>
> merlin



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2015-12-14 15:55 Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
  2015-12-14 16:38 ` Re: Multi-master replication Merlin Moncure <mmoncure@gmail.com>
  2015-12-14 16:44   ` Re: Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
@ 2015-12-14 16:51     ` Mario Soto Cordones <marioa.soto.cordones@gmail.com>
  0 siblings, 0 replies; 27+ messages in thread

From: Mario Soto Cordones @ 2015-12-14 16:51 UTC (permalink / raw)
  To: 'Dmitry Mordovin' <d.mordovin@dwide.com>; 'Merlin Moncure' <mmoncure@gmail.com>; 'Andres Freund' <andres@2ndquadrant.com>; +Cc: pgsql-general

Hi,

I have understood that at 9.5 BDR is not implemented yet , but you have to download and install it from 2ndQuadrant , ie , a modified version of postgresql

Mario Soto

-----Mensaje original-----
De: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] En nombre de Dmitry Mordovin
Enviado el: lunes, 14 de diciembre de 2015 13:45
Para: Merlin Moncure <mmoncure@gmail.com>; Andres Freund <andres@2ndquadrant.com>
CC: PostgreSQL General <pgsql-general@postgresql.org>
Asunto: Re: [GENERAL] Multi-master replication

Thank you Merlin,

I see this doc too. But I confused, in 9.5 BDR placed to native code and becomes built in feature.

So, need I install external BDR or try to config built in version ?

Or I didn't understood clearly.

BR, Dmitry




On 12/14/2015 08:38 PM, Merlin Moncure wrote:
> On Mon, Dec 14, 2015 at 9:55 AM, Dmitry Mordovin <d.mordovin@dwide.com> wrote:
>> Hello All!
>>
>> As I heard, PostgreSQL 9.5 has built in Bi-Direction replication (or 
>> need install BDR module?).
> Huh -- that may be so.  But if it is, it contradicts the BDR
> documentation: 
> http://bdr-project.org/docs/stable/install-requirements.html
>
> Maybe Andres might know the answer?
>
>> I wants to play with multi-master, asynchronous replication on two 
>> servers PostgreSQL 9.5 beta 2.
>>
>> In official docs very small information about how to configure servers.
>>
>> Could anyone direct me in right way?
> Have you looked here?
> https://wiki.postgresql.org/wiki/BDR_Quick_Start
>
> merlin



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2015-12-14 15:55 Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
@ 2015-12-14 17:31 ` Simon Riggs <simon@2ndQuadrant.com>
  2015-12-14 17:36   ` Re: Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
  1 sibling, 1 reply; 27+ messages in thread

From: Simon Riggs @ 2015-12-14 17:31 UTC (permalink / raw)
  To: Dmitry Mordovin <d.mordovin@dwide.com>; +Cc: pgsql-general

On 14 December 2015 at 15:55, Dmitry Mordovin <d.mordovin@dwide.com> wrote:

> Hello All!
>
> As I heard, PostgreSQL 9.5 has built in Bi-Direction replication (or need
> install BDR module?).
>

PostgreSQL 9.5 does not yet have the full code required for Bi-Directional
replication. How did you hear that? Was that word of mouth, or is that
written down anywhere so we can correct it?


> I wants to play with multi-master, asynchronous replication on two servers
> PostgreSQL 9.5 beta 2.
>

BDR does exist as production quality software.
http://bdr-project.org/docs/stable/index.html
BDR 0.93 is compatible with PostgreSQL 9.4.
Binary versions are available.

Later versions of BDR will be compatible with later versions of PostgreSQL,
until the features are fully merged. The full project has taken 4 years so
far and we expect it to take another 2 years at least.

I'll write a blog about this because there is clearly some confusion around
this.

In official docs very small information about how to configure servers.
>
> Could anyone direct me in right way?
>

If anyone would like to contribute better documentation, they are very
welcome to do so.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/;
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2015-12-14 15:55 Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
  2015-12-14 17:31 ` Re: Multi-master replication Simon Riggs <simon@2ndQuadrant.com>
@ 2015-12-14 17:36   ` Dmitry Mordovin <d.mordovin@dwide.com>
  0 siblings, 0 replies; 27+ messages in thread

From: Dmitry Mordovin @ 2015-12-14 17:36 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndQuadrant.com>; +Cc: pgsql-general

Just word of month,

Thank you Simon for detailed explanation current status of BDR and 
PostgreSQL.

BR, Dmitry


On 12/14/2015 09:31 PM, Simon Riggs wrote:
> On 14 December 2015 at 15:55, Dmitry Mordovin <d.mordovin@dwide.com 
> <mailto:d.mordovin@dwide.com>> wrote:
>
>     Hello All!
>
>     As I heard, PostgreSQL 9.5 has built in Bi-Direction replication
>     (or need install BDR module?).
>
>
> PostgreSQL 9.5 does not yet have the full code required for 
> Bi-Directional replication. How did you hear that? Was that word of 
> mouth, or is that written down anywhere so we can correct it?
>
>     I wants to play with multi-master, asynchronous replication on two
>     servers PostgreSQL 9.5 beta 2.
>
>
> BDR does exist as production quality software. 
> http://bdr-project.org/docs/stable/index.html
> BDR 0.93 is compatible with PostgreSQL 9.4.
> Binary versions are available.
>
> Later versions of BDR will be compatible with later versions of 
> PostgreSQL, until the features are fully merged. The full project has 
> taken 4 years so far and we expect it to take another 2 years at least.
>
> I'll write a blog about this because there is clearly some confusion 
> around this.
>
>     In official docs very small information about how to configure
>     servers.
>
>     Could anyone direct me in right way?
>
>
> If anyone would like to contribute better documentation, they are very 
> welcome to do so.
>
> -- 
> Simon Riggs http://www.2ndQuadrant.com/ <http://www.2ndquadrant.com/;
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Multi-master replication
@ 2021-08-13 08:00 Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 09:46 ` Re: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  0 siblings, 1 reply; 27+ messages in thread

From: Zahir Lalani @ 2021-08-13 08:00 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Confidential

Hello all

Does anyone on the list have production experience of using PG in a multi-master setup - if so using which tools?

Thx

Zahir

^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2021-08-13 08:00 Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
@ 2021-08-13 09:46 ` Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  2021-08-13 11:35   ` RE: Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
  0 siblings, 1 reply; 27+ messages in thread

From: Laura Smith @ 2021-08-13 09:46 UTC (permalink / raw)
  To: Zahir Lalani <ZahirLalani@oliver.agency>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, August 13th, 2021 at 9:00 AM, Zahir Lalani <ZahirLalani@oliver.agency> wrote:

> Confidential
>
> Hello all
>
> Does anyone on the list have production experience of using PG in a multi-master setup – if so using which tools?
>
> Thx
>
> Zahir



I have sometimes considered it, but it always struck me that given there is no first-class support for it, multi-master in postgres is just an opportunity for so many foot-guns to enable to things to go terribly, terribly wrong.

Maybe you need to look at something like CockroachDB which has a degree of Postgres syntax compatability (https://www.cockroachlabs.com/blog/why-postgres/).   N.B. Not speaking from experience here, CockroachDB is something I've wanted to play with for a long time but never had the time !







^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* RE: Multi-master replication
  2021-08-13 08:00 Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 09:46 ` Re: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
@ 2021-08-13 11:35   ` Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 12:18     ` Re: Multi-master replication Bruce Momjian <bruce@momjian.us>
  2021-08-13 12:19     ` Re: Multi-master replication Vijaykumar Jain <vijaykumarjain.github@gmail.com>
  2021-08-13 14:07     ` RE: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  0 siblings, 3 replies; 27+ messages in thread

From: Zahir Lalani @ 2021-08-13 11:35 UTC (permalink / raw)
  To: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

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?

We are looking at pg_pool II to manage the current config - which I suppose will help with the connection pooling etc. But even it lends caution to the multi-master route for write heavy applications.

Z

> -----Original Message-----
> From: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
> Sent: 13 August 2021 10:47
> To: Zahir Lalani <ZahirLalani@oliver.agency>
> Cc: pgsql-general@lists.postgresql.org
> Subject: Re: Multi-master replication
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Friday, August 13th, 2021 at 9:00 AM, Zahir Lalani
> <ZahirLalani@oliver.agency> wrote:
>
> > Confidential
> >
> > Hello all
> >
> > Does anyone on the list have production experience of using PG in a multi-
> master setup – if so using which tools?
> >
> > Thx
> >
> > Zahir
>
>
>
> I have sometimes considered it, but it always struck me that given there is no
> first-class support for it, multi-master in postgres is just an opportunity for so
> many foot-guns to enable to things to go terribly, terribly wrong.
>
> Maybe you need to look at something like CockroachDB which has a degree of
> Postgres syntax compatability (https://www.cockroachlabs.com/blog/why-
> postgres/).   N.B. Not speaking from experience here, CockroachDB is
> something I've wanted to play with for a long time but never had the time !
>



^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2021-08-13 08:00 Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 09:46 ` Re: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  2021-08-13 11:35   ` RE: Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
@ 2021-08-13 12:18     ` Bruce Momjian <bruce@momjian.us>
  2 siblings, 0 replies; 27+ messages in thread

From: Bruce Momjian @ 2021-08-13 12:18 UTC (permalink / raw)
  To: Zahir Lalani <ZahirLalani@oliver.agency>; +Cc: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On Fri, Aug 13, 2021 at 11:35:29AM +0000, Zahir Lalani 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?
> 
> We are looking at pg_pool II to manage the current config - which I suppose will help with the connection pooling etc. But even it lends caution to the multi-master route for write heavy applications.

You might want to read this:

	https://momjian.us/main/blogs/pgblog/2018.html#December_24_2018

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.






^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* Re: Multi-master replication
  2021-08-13 08:00 Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 09:46 ` Re: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  2021-08-13 11:35   ` RE: Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
@ 2021-08-13 12:19     ` Vijaykumar Jain <vijaykumarjain.github@gmail.com>
  2 siblings, 0 replies; 27+ messages in thread

From: Vijaykumar Jain @ 2021-08-13 12:19 UTC (permalink / raw)
  To: Zahir Lalani <ZahirLalani@oliver.agency>; +Cc: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>; pgsql-general <pgsql-general@lists.postgresql.org>

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?
>
>
>


http://bdr-project.org/docs/stable/conflicts.html

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.

https://www.citusdata.com/


https://about.gitlab.com/handbook/engineering/development/enablement/database/doc/fdw-sharding.html


https://blog.timescale.com/blog/building-a-distributed-time-series-database-on-postgresql/

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.
https://www.mongodb.com/developer/article/active-active-application-architectures/

^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* RE: Multi-master replication
  2021-08-13 08:00 Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 09:46 ` Re: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  2021-08-13 11:35   ` RE: Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
@ 2021-08-13 14:07     ` Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  2021-08-14 03:27       ` RE: Multi-master replication Brent Wood <pcreso@yahoo.com>
  2 siblings, 1 reply; 27+ messages in thread

From: Laura Smith @ 2021-08-13 14:07 UTC (permalink / raw)
  To: Zahir Lalani <ZahirLalani@oliver.agency>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, August 13th, 2021 at 12:35 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?
>


Scaling on the master remains a popular choice these days even in the trendy world of cloud and horizontal scaling.  See, for example Let's Encrypt - admittedly a MySQL/InnoDB infrastructure, but still master/replica - https://letsencrypt.org/2021/01/21/next-gen-database-servers.html

I suppose (depending on the nature of your data), you could perhaps use sharding, so multiple master/slaves with data (and hence load) spread across.  Most likely you would need something like Redis at the frontend to push clients in to the right shard.

Conflict resolution (whether due to split brain or otherwise) is a big worry of mine with multi-master setups.  The Googles and Facebook's of this world seem to be solving the problem on the basis of having super precise time sync setup on their database servers and use high-resolution timestamps to act as tie-break arbitrator.  But of course that comes with significant expense as it needs PTP infrastructure.





^ permalink  raw  reply  [nested|flat] 27+ messages in thread

* RE: Multi-master replication
  2021-08-13 08:00 Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 09:46 ` Re: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
  2021-08-13 11:35   ` RE: Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
  2021-08-13 14:07     ` RE: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
@ 2021-08-14 03:27       ` Brent Wood <pcreso@yahoo.com>
  0 siblings, 0 replies; 27+ messages in thread

From: Brent Wood @ 2021-08-14 03:27 UTC (permalink / raw)
  To: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>; Zahir Lalani <ZahirLalani@oliver.agency>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

BDS
Only using the free v1.0...

Sent from Yahoo Mail on Android 
 
  On Sat, 14 Aug 2021 at 2:07, Laura Smith<n5d9xq3ti233xiyif2vp@protonmail.ch> wrote:   ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, August 13th, 2021 at 12:35 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?
>


Scaling on the master remains a popular choice these days even in the trendy world of cloud and horizontal scaling.  See, for example Let's Encrypt - admittedly a MySQL/InnoDB infrastructure, but still master/replica - https://letsencrypt.org/2021/01/21/next-gen-database-servers.html

I suppose (depending on the nature of your data), you could perhaps use sharding, so multiple master/slaves with data (and hence load) spread across.  Most likely you would need something like Redis at the frontend to push clients in to the right shard.

Conflict resolution (whether due to split brain or otherwise) is a big worry of mine with multi-master setups.  The Googles and Facebook's of this world seem to be solving the problem on the basis of having super precise time sync setup on their database servers and use high-resolution timestamps to act as tie-break arbitrator.  But of course that comes with significant expense as it needs PTP infrastructure.


  

^ permalink  raw  reply  [nested|flat] 27+ messages in thread


end of thread, other threads:[~2021-08-14 03:27 UTC | newest]

Thread overview: 27+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-12-18 09:31 Multi Master Replication itishree sukla <itishree.sukla@gmail.com>
2013-12-18 20:16 ` John R Pierce <pierce@hogranch.com>
2013-12-18 23:12   ` Scott Marlowe <scott.marlowe@gmail.com>
2013-12-19 05:25     ` Michael Paquier <michael.paquier@gmail.com>
2013-12-19 06:05       ` Scott Marlowe <scott.marlowe@gmail.com>
2013-12-19 07:41         ` Michael Paquier <michael.paquier@gmail.com>
2013-12-19 07:52 ` Chris Travers <chris.travers@gmail.com>
2013-12-19 14:52   ` Wolfgang Keller <feliphil@gmx.net>
2013-12-19 15:18     ` Chris Travers <chris.travers@gmail.com>
2013-12-20 00:48       ` Michael Paquier <michael.paquier@gmail.com>
2013-12-20 03:37         ` Michael Paquier <michael.paquier@gmail.com>
2013-12-20 04:01 ` John R Pierce <pierce@hogranch.com>
2013-12-23 21:40 ` pax <pax.deckard@gmail.com>
2013-12-23 22:06   ` Anand Kumar, Karthik <Karthik.AnandKumar@classmates.com>
2015-12-14 15:55 Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
2015-12-14 16:38 ` Re: Multi-master replication Merlin Moncure <mmoncure@gmail.com>
2015-12-14 16:44   ` Re: Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
2015-12-14 16:51     ` Re: Multi-master replication Mario Soto Cordones <marioa.soto.cordones@gmail.com>
2015-12-14 17:31 ` Re: Multi-master replication Simon Riggs <simon@2ndQuadrant.com>
2015-12-14 17:36   ` Re: Multi-master replication Dmitry Mordovin <d.mordovin@dwide.com>
2021-08-13 08:00 Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
2021-08-13 09:46 ` Re: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
2021-08-13 11:35   ` RE: Multi-master replication Zahir Lalani <ZahirLalani@oliver.agency>
2021-08-13 12:18     ` Re: Multi-master replication Bruce Momjian <bruce@momjian.us>
2021-08-13 12:19     ` Re: Multi-master replication Vijaykumar Jain <vijaykumarjain.github@gmail.com>
2021-08-13 14:07     ` RE: Multi-master replication Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
2021-08-14 03:27       ` RE: Multi-master replication Brent Wood <pcreso@yahoo.com>

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