pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Travers <chris@travelamericas.com>
To: William Yu <wyu@talisys.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Postgresql replication
Date: Fri, 26 Aug 2005 18:26:22 -0700
Message-ID: <430FC13E.2000302@travelamericas.com> (raw)
In-Reply-To: <deo7ap$kip$1@news.hub.org>
References: <60fyszpby5.fsf@dba2.int.libertyrms.com>
	<20050824173106.76233.qmail@web53210.mail.yahoo.com>
	<deivg4$ura$1@news.hub.org>
	<dekdak$1v8e$1@news.hub.org>
	<430E5116.5000108@travelamericas.com>
	<demg28$2k1m$1@news.hub.org>
	<430F50D3.9090709@travelamericas.com>
	<deo7ap$kip$1@news.hub.org>

William Yu wrote:

> Chris Travers wrote:
>
>> I guess I am thinking along different lines than you.  I was thinking 
>> that the simplest solution would be to have master/slave replication 
>> for *approved* transactions only and no replication for initial 
>> commits prior to approval.  This makes the assumption that a single 
>> transaction will be committed on a single server, and that a single 
>> transaction will not be split over multiple servers.  In this way, 
>> you can commit a pending transaction to any single server, and when 
>> it is approved, it gets replicated via the master.  See below for more.
>
>
> This works if you don't care that multiple servers commit transactions 
> that force a budget or bank account to be exceeded.
>
Ok. then lets look at possibility B.  (Async Multimaster Replication is 
out).

>
>> Thinking about this....  The big issue is that you only want to 
>> replicate the deltas, not the entire account.  I am still thinking 
>> master/slave, but something where the deltas are replicated in the 
>> background or where the user, in checking his account, is actually 
>> querying the home server.  This second issue could be done via dblink 
>> or DBI-Link and would simply require that a master table linking the 
>> accounts with home servers be replicated (this should, I think, be 
>> fairly low-overhead).
>
>
> Except what you know have is your system fails if any server fail or 
> is inaccessible.
>
Ok.  If you have a system where each location is authoritative for its 
customers and the server transparently queries that server where needed 
(via a view). then when any server becomes inaccessible then the 
customers whose accounts are on that server become inaccessible.  This 
may not be accessible.  But if this is the case, then you could treat 
this as a partitioned table, where each partition is authoritative on 
one location (see a previous post on how to do this) and then use Slony 
to replicate.  Again this does not get around your objection above 
namely that it is possible to do duplicate transactions at multiple 
locations.  For this you would need an explicit call to the 
authoritative server.  I see no other way around that.  This might allow 
people to view tentative balances from other branches if the home (or 
its connection) server is down, but they would not be able to withdraw 
funds.

But if you do this, you have a different problem.  Namely that 
replication will be occuring over your slower than desired links.  As 
the number of branches grow, so will the bandwidth demands on every 
branch.  This may not therefore be scalable.

Unfortunately there is no free lunch here.  And I think that at some 
point you are going to have to choose between:

1)  Efficiency of network throughput
2)  Tolerance to attempts at repeat transactions before replication 
(emptying an account multiple times)
3)  Availability of a transaction.

You can pick any two.  I think that this is the way it will work with 
any other database system as well.

Best Wishes,
Chris Travers
Metatron Technology Consulting

> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>
>




view thread (91+ messages)  latest in thread

Message-ID: <430FC13E.2000302@travelamericas.com>
Permalink:  ../430FC13E.2000302@travelamericas.com/
Also on:    postgresql.org/message-id/430FC13E.2000302@travelamericas.com

 · 

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: chris@travelamericas.com, wyu@talisys.com
  Subject: Re: Postgresql replication
  In-Reply-To: <430FC13E.2000302@travelamericas.com>
  References: <60fyszpby5.fsf@dba2.int.libertyrms.com> <20050824173106.76233.qmail@web53210.mail.yahoo.com> <deivg4$ura$1@news.hub.org> <dekdak$1v8e$1@news.hub.org> <430E5116.5000108@travelamericas.com> <demg28$2k1m$1@news.hub.org> <430F50D3.9090709@travelamericas.com> <deo7ap$kip$1@news.hub.org> <430FC13E.2000302@travelamericas.com>

* 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