Re: Looking for way to replicate master db to multiple mobile databases

Lists: pgsql-general
From: Bryan Montgomery <monty(at)english(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-23 17:11:31
Message-ID: ba6ead980909231011r28c145d6r331013d1fcbcf0bb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,
I'm looking for a way to replicate am master database to multiple (100+)
databases that are taken in to the field. Currently for each laptop we dump
and load the tables. However,there is only a small percentage of data that
changes on a frequent basis.

I've been looking around and come across pyerplica, londiste and bucardo -
the documentation on most of these is fairly sparse. It seems that Bucardo
may be the best bet - at least initially.

However, I thought I'd see if anyone is doing something similar and what
thoughts there might be out there as to a better way to accomplish this.

Thanks,
Bryan.


From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Bryan Montgomery <monty(at)english(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-23 20:58:43
Message-ID: dcc563d10909231358s15a817c4ybd6d347b83b75d04@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Wed, Sep 23, 2009 at 11:11 AM, Bryan Montgomery <monty(at)english(dot)net> wrote:
> Hi,
> I'm looking for a way to replicate am master database to multiple (100+)
> databases that are taken in to the field. Currently for each laptop we dump
> and load the tables. However,there is only a small percentage of data that
> changes on a frequent basis.
>
> I've been looking around and come across pyerplica, londiste and bucardo -
> the documentation on most of these is fairly sparse. It seems that Bucardo
> may be the best bet - at least initially.
>
> However, I thought I'd see if anyone is doing something similar and what
> thoughts there might be out there as to a better way to accomplish this.

The problem domain you're working on is a bit different from regular
replication. Most replication solutions are made to keep two machines
that talk to each other all the time in sync. Disconnect one machine
and maybe replication will resume properly, and maybe it wont.

So, do you need the slave databases to be updatable? Do you need the
changes to go back into the master? Do you need conflict resolution?
Depending on the full fleshed out requirements, you may be stuck
writing your own solution, or re-writing one somebody already wrote.


From: Bryan Montgomery <monty(at)english(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-23 22:00:03
Message-ID: ba6ead980909231500u530d99b5n37de42db697a4e6c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Thanks for the reply. This is a one way push to the slaves. In theory, there
shouldn't be any conflicts .... although I wouldn't swear to that. If
there's a conflict, the master db should win. At the moment we just drop the
tables, recreate the schema and reload the tables. However, some of the
large tables literally take hours across the network, for maybe a few dozen
changes.

On Wed, Sep 23, 2009 at 4:58 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>wrote:

> On Wed, Sep 23, 2009 at 11:11 AM, Bryan Montgomery <monty(at)english(dot)net>
> wrote:
> > Hi,
> > I'm looking for a way to replicate am master database to multiple (100+)
> > databases that are taken in to the field. Currently for each laptop we
> dump
> > and load the tables. However,there is only a small percentage of data
> that
> > changes on a frequent basis.
> >
> > I've been looking around and come across pyerplica, londiste and bucardo
> -
> > the documentation on most of these is fairly sparse. It seems that
> Bucardo
> > may be the best bet - at least initially.
> >
> > However, I thought I'd see if anyone is doing something similar and what
> > thoughts there might be out there as to a better way to accomplish this.
>
> The problem domain you're working on is a bit different from regular
> replication. Most replication solutions are made to keep two machines
> that talk to each other all the time in sync. Disconnect one machine
> and maybe replication will resume properly, and maybe it wont.
>
> So, do you need the slave databases to be updatable? Do you need the
> changes to go back into the master? Do you need conflict resolution?
> Depending on the full fleshed out requirements, you may be stuck
> writing your own solution, or re-writing one somebody already wrote.
>


From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-24 11:04:31
Message-ID: 20090924110431.GC22438@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Wed, Sep 23, 2009 at 06:00:03PM -0400, Bryan Montgomery wrote:
> Thanks for the reply. This is a one way push to the slaves. In theory, there
> shouldn't be any conflicts .... although I wouldn't swear to that. If
> there's a conflict, the master db should win. At the moment we just drop the
> tables, recreate the schema and reload the tables. However, some of the
> large tables literally take hours across the network, for maybe a few dozen
> changes.

Could you just replay WAL updates? I.e. have two copies of the database
on each device, one as the mirror of the "master" and one as the "live"
version. When you need to push the changes out, just push out the WAL
updates, dump the "live" version, copy the "master" into a new "live"
version and then replay the new WAL records.

Depends on how much disk space you have I guess.

--
Sam http://samason.me.uk/


From: Alexey Klyukin <alexk(at)commandprompt(dot)com>
To: Bryan Montgomery <monty(at)english(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-24 12:55:11
Message-ID: 12c44d160909240555k3c31d9c7n8fda2a2f5c15b1a5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

On Wed, Sep 23, 2009 at 8:11 PM, Bryan Montgomery <monty(at)english(dot)net> wrote:
> Hi,
> I'm looking for a way to replicate am master database to multiple (100+)
> databases that are taken in to the field. Currently for each laptop we dump
> and load the tables. However,there is only a small percentage of data that
> changes on a frequent basis.
>
> I've been looking around and come across pyerplica, londiste and bucardo -
> the documentation on most of these is fairly sparse. It seems that Bucardo
> may be the best bet - at least initially.

You might have a look at Mammoth Replicator (I'm a developer of it).
Although we haven't checked whether it works with hundreds of slaves,
in theory it should. The feature that can be useful to your setup is
'batched' updates, designed for slaves that are not constantly
connected to the master server. These slaves connect to the
replication server for some configurable period of time, get the new
data, and disconnect until the next attempt.

>
> However, I thought I'd see if anyone is doing something similar and what
> thoughts there might be out there as to a better way to accomplish this.
>
> Thanks,
> Bryan.

--
Alexey Klyukin wwww.commandprompt.com
The PostgreSQL Company - Command Prompt, Inc


From: Selena Deckelmann <selenamarie(at)gmail(dot)com>
To: Bryan Montgomery <monty(at)english(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-24 14:37:50
Message-ID: 2b5e566d0909240737p4c8a1786w6a827ecce6234945@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi!

On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery <monty(at)english(dot)net> wrote:
> Hi,
> I'm looking for a way to replicate am master database to multiple (100+)
> databases that are taken in to the field. Currently for each laptop we dump
> and load the tables. However,there is only a small percentage of data that
> changes on a frequent basis.
>
> I've been looking around and come across pyerplica, londiste and bucardo -
> the documentation on most of these is fairly sparse. It seems that Bucardo
> may be the best bet - at least initially.

Bucardo is a good choice for this usage model because it was
originally designed to work over a lossy network connections.

You could issue 'kicks' for each laptop sync when you know for sure
that a laptop has got an active network connection to your master.
It's also pretty efficient with updates, only copying the current row
(that's changed) a single time, rather than multiple times if there
have been multiple changes to that row since the last time a sync
occurred.

-selena

--
http://chesnok.com/daily - me
http://endpoint.com - work


From: Cédric Villemain <cedric(dot)villemain(at)dalibo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Selena Deckelmann <selenamarie(at)gmail(dot)com>, Bryan Montgomery <monty(at)english(dot)net>
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-24 15:09:26
Message-ID: 200909241709.26291.cedric.villemain@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Le jeudi 24 septembre 2009, Selena Deckelmann a écrit :
> Hi!
>
> On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery <monty(at)english(dot)net>
wrote:
> > Hi,
> > I'm looking for a way to replicate am master database to multiple (100+)
> > databases that are taken in to the field. Currently for each laptop we
> > dump and load the tables. However,there is only a small percentage of
> > data that changes on a frequent basis.
> >
> > I've been looking around and come across pyerplica, londiste and bucardo
> > - the documentation on most of these is fairly sparse. It seems that
> > Bucardo may be the best bet - at least initially.
>
> Bucardo is a good choice for this usage model because it was
> originally designed to work over a lossy network connections.

yes, but isn't bucardo designed to 2 nodes only ?

>
> You could issue 'kicks' for each laptop sync when you know for sure
> that a laptop has got an active network connection to your master.
> It's also pretty efficient with updates, only copying the current row
> (that's changed) a single time, rather than multiple times if there
> have been multiple changes to that row since the last time a sync
> occurred.
>
> -selena
>

--
----
Cédric Villemain
Administrateur de Base de Données
Cel: +33 (0)6 74 15 56 53
http://dalibo.com - http://dalibo.org


From: Joshua Tolley <eggyknap(at)gmail(dot)com>
To: Cédric Villemain <cedric(dot)villemain(at)dalibo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Selena Deckelmann <selenamarie(at)gmail(dot)com>, Bryan Montgomery <monty(at)english(dot)net>
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-24 15:27:33
Message-ID: 20090924152733.GC5554@eddie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Sep 24, 2009 at 05:09:26PM +0200, Cédric Villemain wrote:
> > Bucardo is a good choice for this usage model because it was
> > originally designed to work over a lossy network connections.
>
> yes, but isn't bucardo designed to 2 nodes only ?

Bucardo's multi-master replication works only between two hosts, unless
perhaps you can assure that only certain primary keys will be updated on
certain hosts, or do some other trickery. Syncing from one master to multiple
slaves is straightforward, if all you need is master->slave.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com


From: Selena Deckelmann <selenamarie(at)gmail(dot)com>
To: Cédric Villemain <cedric(dot)villemain(at)dalibo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Bryan Montgomery <monty(at)english(dot)net>
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-25 02:50:30
Message-ID: 2b5e566d0909241950v3db26631ucee1c97804100bac@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Sep 24, 2009 at 8:09 AM, Cédric Villemain
<cedric(dot)villemain(at)dalibo(dot)com> wrote:
> Le jeudi 24 septembre 2009, Selena Deckelmann a écrit :
>> Hi!
>>
>> On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery <monty(at)english(dot)net>
> wrote:
>> > Hi,
>> > I'm looking for a way to replicate am master database to multiple (100+)
>> > databases that are taken in to the field. Currently for each laptop we
>> > dump and load the tables. However,there is only a small percentage of
>> > data that changes on a frequent basis.
>> >
>> > I've been looking around and come across pyerplica, londiste and bucardo
>> > - the documentation on most of these is fairly sparse. It seems that
>> > Bucardo may be the best bet - at least initially.
>>
>> Bucardo is a good choice for this usage model because it was
>> originally designed to work over a lossy network connections.
>
> yes, but isn't bucardo designed to 2 nodes only ?

No, definitely not! You can replicate to any number of systems. And
you can group them in whatever groups you'd like. Multi-master (as
Joshua said) only works between two nodes, but master->slave can be
from a master, to any number of slaves.

--
http://chesnok.com/daily - me
http://endpoint.com - work


From: Grant Maxwell <grant(dot)maxwell(at)maxan(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org, Bryan Montgomery <monty(at)english(dot)net>
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-25 03:12:23
Message-ID: 17272525-012E-494F-80AD-0E3A12A99A64@maxan.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


On 25/09/2009, at 12:50 PM, Selena Deckelmann wrote:

> On Thu, Sep 24, 2009 at 8:09 AM, Cédric Villemain
> <cedric(dot)villemain(at)dalibo(dot)com> wrote:
>> Le jeudi 24 septembre 2009, Selena Deckelmann a écrit :
>>> Hi!
>>>
>>> On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery <monty(at)english(dot)net
>>> >
>> wrote:
>>>> Hi,
>>>> I'm looking for a way to replicate am master database to multiple
>>>> (100+)
>>>> databases that are taken in to the field. Currently for each
>>>> laptop we
>>>> dump and load the tables. However,there is only a small
>>>> percentage of
>>>> data that changes on a frequent basis.
>>>>
>>>> I've been looking around and come across pyerplica, londiste and
>>>> bucardo
>>>> - the documentation on most of these is fairly sparse. It seems
>>>> that
>>>> Bucardo may be the best bet - at least initially.
>>>
>>> Bucardo is a good choice for this usage model because it was
>>> originally designed to work over a lossy network connections.
>>
>> yes, but isn't bucardo designed to 2 nodes only ?
>
> No, definitely not! You can replicate to any number of systems. And
> you can group them in whatever groups you'd like. Multi-master (as
> Joshua said) only works between two nodes, but master->slave can be
> from a master, to any number of slaves.
>
>
I use bucardo extensively across multiple sites and with complex
replication requirements. It does a great job.
regards
Grant


From: Cédric Villemain <cedric(dot)villemain(at)dalibo(dot)com>
To: Selena Deckelmann <selenamarie(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Bryan Montgomery <monty(at)english(dot)net>
Subject: Re: Looking for way to replicate master db to multiple mobile databases
Date: 2009-09-25 08:34:56
Message-ID: 200909251035.03351.cedric.villemain@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Le vendredi 25 septembre 2009, Selena Deckelmann a écrit :
> On Thu, Sep 24, 2009 at 8:09 AM, Cédric Villemain
>
> <cedric(dot)villemain(at)dalibo(dot)com> wrote:
> > Le jeudi 24 septembre 2009, Selena Deckelmann a écrit :
> >> Hi!
> >>
> >> On Wed, Sep 23, 2009 at 10:11 AM, Bryan Montgomery <monty(at)english(dot)net>
> >
> > wrote:
> >> > Hi,
> >> > I'm looking for a way to replicate am master database to multiple
> >> > (100+) databases that are taken in to the field. Currently for each
> >> > laptop we dump and load the tables. However,there is only a small
> >> > percentage of data that changes on a frequent basis.
> >> >
> >> > I've been looking around and come across pyerplica, londiste and
> >> > bucardo - the documentation on most of these is fairly sparse. It
> >> > seems that Bucardo may be the best bet - at least initially.
> >>
> >> Bucardo is a good choice for this usage model because it was
> >> originally designed to work over a lossy network connections.
> >
> > yes, but isn't bucardo designed to 2 nodes only ?
>
> No, definitely not! You can replicate to any number of systems. And
> you can group them in whatever groups you'd like. Multi-master (as
> Joshua said) only works between two nodes, but master->slave can be
> from a master, to any number of slaves.
>

Ah! thank you for clarifying that.

----
Cédric Villemain
Administrateur de Base de Données
Cel: +33 (0)6 74 15 56 53
http://dalibo.com - http://dalibo.org