Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Database synchronisation

keeping databases in sync

12:19 am on Oct 13, 2005 (gmt 0)

New User

10+ Year Member

joined:Apr 13, 2005
votes: 0

Not sure if this is the right forum for this question. A friend of mine is interested in keeping databases in sync. One database is on a remote server and the other is on his Windows PC. He needs to automatically update the database on his PC whenever the remote server database is updated. Is there any software or script to keep two databases like this in sync?
5:01 am on Oct 13, 2005 (gmt 0)

Moderator from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
votes: 4

If the DB in question is Mysql then mysql replication may be a viable solution.

The principle is you set the remote server as master, you then set up the local system as a slave. The master creates binnary files that record changes. The system is then able to see differences between the master and slave and will replicate any changes.


9:39 am on Oct 13, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 17, 2002
votes: 5

How often does the database change? How big is the database?

Replication is fine but it does have it's draw backs.

What you may want to consider is a simple backup / dump script which you can run, say every 24 hrs.

1. Server DB runs a backup script via cron job overnight and zips it.
2. Each morning windows PC downloars the zip file
3. Windows database is dropped and reloaded with the backup data.

It all depends on the size and frequency as to which method is the most practical.

6:14 pm on Oct 13, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 13, 2002
votes: 0

To kep it in sync I'd use merge replication. Its low overhead because it only replicates the changes, even works over standard ADSL.

But if you really want them in sync, Why bother with the local db at all? just connnect to the single db