Thread: replicating a table in several databases

replicating a table in several databases

From
Gerardo Herzig
Date:
Hi all. Im facing a situation where i have to replicate a table from
database A in databases B,C,F and so on.

The first (and only) thing i have in mind is using triggers with dblink
for comunications with the other DB's.

I dont even like the idea of replicating tables across databases, but itis kind of an order :(

Since dblink is not transactional, it seems error prone over time, so
the tables will be inconsistent sooner or later, right?

Do any have some less error-prone idea for this?

Thanks!

Gerardo


Re: replicating a table in several databases

From
Chris Browne
Date:
gherzig@fmed.uba.ar (Gerardo Herzig) writes:
> Hi all. Im facing a situation where i have to replicate a table from
> database A in databases B,C,F and so on.
>
> The first (and only) thing i have in mind is using triggers with dblink
> for comunications with the other DB's.
>
> I dont even like the idea of replicating tables across databases, but it
>  is kind of an order :(
>
> Since dblink is not transactional, it seems error prone over time, so
> the tables will be inconsistent sooner or later, right?
>
> Do any have some less error-prone idea for this?

Two answers tend to come up: a) Slony-I (which I work on; URL below) b) Londiste (originated by "Skype folks"; see also
"SkypeTools")
 

Slony-I has more documentation; Londiste is reputed to be a bit easier
to configure (though being somewhat documentation-light may still
leave the bar set pretty high).
-- 
let name="cbbrowne" and tld="linuxdatabases.info" in name ^ "@" ^ tld;;
http://slony.info/
"My nostalgia for Icon makes me forget about any of the bad things.  I
don't have much nostalgia for Perl, so its faults I remember."
-- Scott Gilbert comp.lang.python


Re: replicating a table in several databases

From
"Scott Marlowe"
Date:
On Fri, Oct 10, 2008 at 8:59 AM, Chris Browne <cbbrowne@acm.org> wrote:
> gherzig@fmed.uba.ar (Gerardo Herzig) writes:
>> Hi all. Im facing a situation where i have to replicate a table from
>> database A in databases B,C,F and so on.
>>
>> The first (and only) thing i have in mind is using triggers with dblink
>> for comunications with the other DB's.
>>
>> I dont even like the idea of replicating tables across databases, but it
>>  is kind of an order :(
>>
>> Since dblink is not transactional, it seems error prone over time, so
>> the tables will be inconsistent sooner or later, right?
>>
>> Do any have some less error-prone idea for this?
>
> Two answers tend to come up:
>  a) Slony-I (which I work on; URL below)
>  b) Londiste (originated by "Skype folks"; see also "Skype Tools")
>
> Slony-I has more documentation; Londiste is reputed to be a bit easier
> to configure (though being somewhat documentation-light may still
> leave the bar set pretty high).

Given the the OP specifically mentions replicating a single table from
one to multiple databases, I'd tend to recommend slony.  It's quite
versatile at strange replication configurations.  I didn't think
setting it up was all that hard, once you understood the basics of how
it works.  I love that I can switch out a database server at work in
seconds to minutes if I need to, with a single fairly simple bash
script.


Re: replicating a table in several databases

From
"zouguanghui"
Date:
Hi,everybody.I am a new member.

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of Scott Marlowe
Sent: Wednesday, October 15, 2008 8:14 AM
To: Chris Browne
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] replicating a table in several databases

On Fri, Oct 10, 2008 at 8:59 AM, Chris Browne <cbbrowne@acm.org> wrote:
> gherzig@fmed.uba.ar (Gerardo Herzig) writes:
>> Hi all. Im facing a situation where i have to replicate a table from
>> database A in databases B,C,F and so on.
>>
>> The first (and only) thing i have in mind is using triggers with dblink
>> for comunications with the other DB's.
>>
>> I dont even like the idea of replicating tables across databases, but it
>>  is kind of an order :(
>>
>> Since dblink is not transactional, it seems error prone over time, so
>> the tables will be inconsistent sooner or later, right?
>>
>> Do any have some less error-prone idea for this?
>
> Two answers tend to come up:
>  a) Slony-I (which I work on; URL below)
>  b) Londiste (originated by "Skype folks"; see also "Skype Tools")
>
> Slony-I has more documentation; Londiste is reputed to be a bit easier
> to configure (though being somewhat documentation-light may still
> leave the bar set pretty high).

Given the the OP specifically mentions replicating a single table from
one to multiple databases, I'd tend to recommend slony.  It's quite
versatile at strange replication configurations.  I didn't think
setting it up was all that hard, once you understood the basics of how
it works.  I love that I can switch out a database server at work in
seconds to minutes if I need to, with a single fairly simple bash
script.

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