Skip navigation links

MySQL Forums :: Synchronization :: Sync data between multiple database


Advanced Search

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
Sync data between multiple database 68937 Shane McCusker 05/11/2007 08:15AM
Re: Sync data between multiple database 46380 Baron "Xaprb" Schwartz 05/13/2007 07:29AM
Re: Sync data between multiple database 31797 Shane McCusker 05/16/2007 05:20AM
Re: Sync data between multiple database 21186 Baron "Xaprb" Schwartz 05/16/2007 06:08AM
Re: Sync data between multiple database 15811 Shane McCusker 05/16/2007 02:34PM
Re: Sync data between multiple database 14989 lakshmi Gurusamy 07/04/2007 05:25AM
Re: Sync data between multiple database 16069 Jimson Reyes 07/21/2007 04:36PM
Re: Sync data between multiple database 13962 Alice Qiao 12/05/2008 07:19PM
Re: Sync data between multiple database 10972 Robert Caelara 01/20/2009 01:20PM
Re: Sync data between multiple database 12535 Julian Brooks 09/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.