Thread: Replication

Replication

From
Jürgen Purtz
Date:
Hi all,<br /><br /> replication is a complex topic, so I tried to get a systematic view on it. Among others I found 4
mutuallyindependent (?) concepts:<br /><ul><li>Log-Shipping vs. Streaming (LS vs. S)<br /><li>Physical Format vs.
LogicalDecoded Format (PFo vs. LFo)<br /><li>Synchronous vs. asynchronous transfer (STr vs ASTr)<br /><li>hot standby
vs.warm standby<br /></ul> 'Mutually independent' implies that there are 2 power 4 = 16 possible combinations. But I
believe,there are some limitations. <br /><br /> First, hot and warm standby (at the standby site) are possible in all
cases.Second, for me the following 5 out of 8 seems to be possible:<br /><br /> LS - PFo - ASTr  (Asynchronous
Log-shippingin Physical Format)<br /> S - PFo - STr      (Synchronous Streaming in Physical Format)<br /> S - PFo -
ASTr (Asynchronous Streaming in Physical Format)<br /> S - LFo - STr    (Synchronous Streaming in Logical Format)<br />
S- LFo - ASTr  (Asynchronous Streaming in Logical Format)<br /><br /> My questions are:<br /><ol><li>Do you agree to
thissystematization into 4 categories?<li>Do you agree, that only this 5 out of 8 possibilities
exist?</ol><p>Regards<br/> Jürgen Purtz<br /><br /> 

Re: Replication

From
Steve Midgley
Date:
On Wed, Feb 3, 2016 at 10:46 AM, Jürgen Purtz <juergen@purtz.de> wrote:
Hi all,

replication is a complex topic, so I tried to get a systematic view on it. Among others I found 4 mutually independent (?) concepts:
  • Log-Shipping vs. Streaming (LS vs. S)
  • Physical Format vs. Logical Decoded Format (PFo vs. LFo)
  • Synchronous vs. asynchronous transfer (STr vs ASTr)
  • hot standby vs. warm standby
My questions are:
  1. Do you agree to this systematization into 4 categories?
  2. Do you agree, that only this 5 out of 8 possibilities exist?
I think you're actually asking what replication strategies Postgres supports out of the box, and of those which are viable combinations? If so, someone else will have to say whether your categories are comprehensive.

If you are asking about what replication strategies are possible more broadly (and implementable with Postgres) the list gets bigger. I've messed around with MVCC (multi-version concurrency control) and there are several implementations out there - I looked at PouchDB in javascript and it seemed plausible to implement on top of specifically organized Postgres DBs. This could enable a master-master federated data replication network with no central authority. Record collisions are unhappy possibilities, and locking anything becomes impossible in a meaningful way. Notable also that getting good test case coverage is pretty hard.

But if you are trying to find strategies to replicate your data, in some cases that's an interesting approach..

Steve