Re: Using RSYNC for replication? - Mailing list pgsql-general

From Ron Johnson
Subject Re: Using RSYNC for replication?
Date
Msg-id 1043770507.9899.168.camel@haggis
Whole thread Raw
In response to Using RSYNC for replication?  (Jason Hihn <jhihn1@umbc.edu>)
List pgsql-general
On Mon, 2003-01-27 at 22:56, Jason Hihn wrote:
> A sequence of events ocurred to me today that left me wondering if I can
> rsync the raw files as a form of replication. I'd like to keep
> postmaster running, but flush and lock everything, then perform the copy
>   via rsync so only the new data is propigated, all while postmaster is
> running.
>
> In general, data is only added to a few tables in the database, with
> updates occuring infrequently to the rest. Rarely are deletes ever done.
>    During the sync neither DB will change except as part of the rsync.
>
> I think this would be a quick, dirty, safe and efficient way to
> accomplish this without having to take down postmaster and send the
> whole shebang over.
>
> Are people using this? Will it work? Is it feasible? Thoughts?
>
> Many thanks in advance,
> -Jason

You could create a set of "modification log" tables that mirror the
"regular" tables, and are populated via triggers.

Then, when the main DB is quiesced, COPY out those mod log tables that
have rows in them, and then delete all from them.

Next, at your liesure, send over and apply these log table extracts.

Yes, this is not practical for a large number of tables, but, depending
on your h/w, can sustain even an extremely high-volume aplication.

--
+---------------------------------------------------------------+
| Ron Johnson, Jr.        mailto:ron.l.johnson@cox.net          |
| Jefferson, LA  USA      http://members.cox.net/ron.l.johnson  |
|                                                               |
| "Fear the Penguin!!"                                          |
+---------------------------------------------------------------+


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Ref to last INSERT on a table without OIDs?
Next
From: Tom Lane
Date:
Subject: Re: Status of tablespaces