I am developing a web application using php and mysql. This application runs on three different locations.

  1. On internet
  2. Head office
  3. Branch office

Application runs on local server on head office and branch office. Internet connection is not available on every time. Customers placing orders through these three locations. My problem is, I want to synchronize the data among these three databases and keep these three databases up to date. Is there any way to do this?


I'm using SymmetricDS to synchronize databases. It is capable of synchronizing or replicating data between nodes (servers/databases), only pushing or pulling the data you define. It is a software based on Java, it has a steep learning curve, but it really does the job.

SymmetricDS can be set up to push changes from one node to the two other nodes, thus making sure that all three nodes contains the same data. You need to make sure that primary keys are unique keys, and not auto incremented values assigned by the database as this most likely will be an issue across the three different databases you'd like to synchronize.

The software installs triggers on the database, and captures changes when INSERT, UPDATE or DELETE (and other) operations are carried out. These data changes are then invoked on the other nodes. The software needs to run on each location, but does not need an internet connection that is available at all times.

I did worry in the beginning that triggers on all my tables would slow down performance, but this has not been a problem at all. I can't say that we've discovered any issues with performance after the triggers were installed.

Have a look at http://symmetricds.org/ for more details.

| improve this answer | |
  • Thanks sbrattla for suggesting tool. I wrote a some custom php scripts to solve my issue. I used some idea from SymmetricDS for solving this. – iamsumesh Nov 20 '11 at 18:53
  • My above post describes how it works, but you need to go to the software's website to learn the details of it. As mentioned it has a steep learning curve, but it works very well omce you get the hang of it. – sbrattla Dec 27 '12 at 9:03
  • what algorithm you use to generate the unique keys? Like if I have a student registration table, what do you suggest is best technique for generating unique key? – codelearner Oct 10 at 4:03
  • We're using UUIDs, which is quite safe in terms of primary key collision. However, it has its drawbacks though. Google will tell you all about that. – sbrattla Oct 10 at 14:15

Try Schema and Data Comparison tools in dbForge Studio for MySQL.

We also have stand-alone tools:

| improve this answer | |

Your Answer

