From: Bruno Wolff III <bruno@wolff.to>
To: Paul Breen <pbreen@computerpark.co.uk>
Cc: Bradley Kieser <brad@kieser.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Real time replication of PG DBs accross two servers -
Date: Wed, 14 Apr 2004 09:57:53 -0500
Message-ID: <20040414145753.GA30859@wolff.to> (raw)
In-Reply-To: <23864.10.0.0.170.1081950297.squirrel@mailserver.computerpark.local>
References: <407B85CF.4010404@kieser.net>
<23864.10.0.0.170.1081950297.squirrel@mailserver.computerpark.local>
On Wed, Apr 14, 2004 at 14:44:57 +0100,
Paul Breen <pbreen@computerpark.co.uk> wrote:
>
> The way we approached it was to do the replication ourselves at the
> application level. This isn't as hard as it sounds: you just open 2 db
> connections (1 to the master, 1 to the slave), start transactions on both
> connections, then write your data. If an error occurs on either
> connection, you rollback on both connections. This means you can still
> have writes that fail (for whatever reason) but both dbs are _consistent_.
This is guarenteed to work in general. When there are concurrent transactions,
one transaction may succeed on commit and the other fail. If you are using
sequences you could also end up with different values in each database.
That may or may not be a problem depending on how you use them.
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-admin@postgresql.org
Cc: bruno@wolff.to, pbreen@computerpark.co.uk, brad@kieser.net
Subject: Re: Real time replication of PG DBs accross two servers -
In-Reply-To: <20040414145753.GA30859@wolff.to>
References: <407B85CF.4010404@kieser.net> <23864.10.0.0.170.1081950297.squirrel@mailserver.computerpark.local> <20040414145753.GA30859@wolff.to>
* 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