filmo has asked for the wisdom of the Perl Monks concerning the following question:
What I'd like to do is mirror that database to our development environment without having to dump the database from the server and import it to the development environment. Instead, I'd like only that days changes somehow reflected in the development database. Here are the catches.
1) The mySQL database on the live server can only be accessed by the localhost, so I can't simply log in remotely.
2)The local development platform isn't up all the time, or even most of the time, so I can't have the remote Perl scripts simply access the development database as a seperate call on-the-fly
3)I'd like it to update in batches. i.e. have the live database generate a set of the changes as they occur (all the SQL commands) and then send that set of commands to the development server when it is available to perform the mirror.
My first inclination is to have it so that every call to the database via DBI is recorded to a file. For example
Later that file could be either e-mailed to the development platform or retrieved via FTP when the development platform is available for such activities. The retrieved file would be executed to the development mySQL database, and in theory, a mirror would be created. Thus, the development mySQL database should be up-to-date as of it's last retrieval.UPDATE sales SET qty = 12, price = 10 WHERE trans_id = 13 INSERT customers SET cust_name = 'Bob', address = '1234 Main Str.' ....etc. SELECT commands would not be included as they don't modify the databas +e
I'd be interested in anybody's ideas or suggestions as to how to implement such a system. (or if it's already been done and I'm reinventing the wheel ;)
I'm also starting to get my fingers wet with XML, so if somebody has a nifty XML fix for this problem I'd be interested to learn it.
--
Filmo the Klown
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mirroring mySQL database
by blakem (Monsignor) on Dec 06, 2001 at 07:25 UTC | |
by filmo (Scribe) on Dec 06, 2001 at 14:07 UTC | |
|
Re: mirroring mySQL database
by VSarkiss (Monsignor) on Dec 06, 2001 at 09:08 UTC | |
by belg4mit (Prior) on Dec 06, 2001 at 09:21 UTC | |
|
Re: mirroring mySQL database
by Zaxo (Archbishop) on Dec 06, 2001 at 07:38 UTC | |
|
Re: mirroring mySQL database
by gmax (Abbot) on Dec 06, 2001 at 15:22 UTC | |
by gmax (Abbot) on Dec 06, 2001 at 16:20 UTC | |
|
Re: mirroring mySQL database
by gwhite (Friar) on Dec 06, 2001 at 17:38 UTC |