MySQL Forums
Forum List  »  Synchronization

Re: Sync data between multiple database
Posted by: Baron "Xaprb" Schwartz
Date: May 13, 2007 07:29AM

Hi Shane,

I assume you will have some central database that is the Source Of Truth. It then becomes a matter of syncing each user back to the central database, and then syncing everyone *from* the database just before they take their laptops offline again. (If you don't have a central database, you have a backup and consistency problem, and you also have to sync from laptop to laptop, which makes work grow exponentially with the number of laptops).

Do people change the same records while disconnected? If so, you will have to do something more complex than what I'm about to suggest, and I don't know how that will work.

Option one is to enable binary logs on each laptop and then replay these on the master database when reconnected. You can use

mysqlbinlog logfile > mysql --host=masterdbserver

This should be straightforward. It will apply all changes from the offline laptops to the master.

Option two is to sync only changed and inserted records from the laptops to the master with MySQL Table Sync (http://sourceforge.net/projects/mysqltoolkit). Use the --onlydo option for this.

Then you have to get the changes back from the central database to the laptops. If you are using MyISAM tables, rsync might be the best option; otherwise you can use MySQL Table Sync again.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Sync data between multiple database
47996
May 13, 2007 07:29AM
14599
December 05, 2008 07:19PM
13069
September 26, 2007 07:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.