pajout has asked for the wisdom of the Perl Monks concerning the following question:

I'v walked through CPAN and used SuperSearch here, but with no solution. Supposing two postgreSQL databases in production state (on two different machines) with almost identical schema, I need to synchronize data in some tables, specially, enumerations with detail tables. I have the detail knowledge of bussiness logic, so I precisely know, which tables need to synchronize in master-slave mode, which columns are primary keys, which columns are alternate keys, which columns must be ignored in sync process etc.
So I am seeking some perl module or script, which could help me to only declare my sync-rules into some configuration file and execute every week, checking potential collisions, doing very descriptive log.
I can define my requirements more exactly, but, I can learn other ideas reading your comments before writing my own synchronizing module :o)
  • Comment on Seeking for the db data synchronization module

Replies are listed 'Best First'.
Re: Seeking for the db data synchronization module
by herveus (Prior) on Jan 11, 2006 at 14:10 UTC
    Howdy!

    Data::Sync leapt to mind as a possible tool you should explore.

    yours,
    Michael
Re: Seeking for the db data synchronization module
by john_oshea (Priest) on Jan 11, 2006 at 14:24 UTC

    It doesn't (as far as I'm aware) check for collisions, and (again, as far as I'm aware) its granularity is at the table level, not individual columns, but you may want to look at Slony-I anyway. It's a PostgreSQL-specific 'single master, multiple slaves' replication solution and may get you at least some of the way to what you're after.

    There also DBD::Recall, but it's not been updated in a while, and the documentation states:

    DBD::Recall is a hack that attempts to accomplish something (fault-tolerance through replication) at the perl DBD driver level that would be better implemented by database servers. It works, but it is not pretty.

    Hope that helps

Re: Seeking for the db data synchronization module
by beachbum (Beadle) on Jan 11, 2006 at 15:32 UTC