Welcome to WebmasterWorld Guest from 54.198.77.172

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
posts:8
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
posts:7564
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.

Mack.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 17, 2002
posts:1182
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
posts:2162
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