Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How can I syncronise multiple mysql database, local to remote and viceversa?

Posted on 2008-10-15
Medium Priority
Last Modified: 2012-08-14
I have developed a web app that runs locally via localhost, the record entered gets stored locally in the mysql database. My problem is that this application now is to be installed in multiple office locations and in each office location we need to be able to see the consolidated data from all the locations . I initially thought of connecting all the app to a consolidated  remote database and update the records to this db instead of the local mysql. But the problem is that this app has to run even when there is no internet connection, i.e when there is no net connection the records need to be stored locally and when there is internet it needs to syncronise with the consolidated db, this has to happen for at all office locations. Please suggest a solution or a tool.
Question by:shankcool
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 19

Accepted Solution

grant300 earned 500 total points
ID: 22722744
This, unfortunately, is an architectural issue.  The deployment scheme needs to be taken into account before tools are chosen and certainly before all the code was written.

Since you posted this in the Sybase area, I will go ahead an suggest you use Sybase SQL Anywhere (AKA iAnywhere, AKA Adaptive Server Anywhere, AKA ASA).

Sybase ASA has replication features specifically designed to support this kind of scenario.  It is robust, easy to use, and very cost effective.  True, it is not free but then, you are going to burn weeks or months trying to get some homebrewed solution to work.

No, replication is not the easiest way to make this all work; your gut instinct to use a centralized database is actually the right way to go.  Quite frankly, if an office is that critical, chances are loss of the internet is a bigger problem than just your app and a backup should probably be in place anyway.

That said, your unreliably connected remote offices can use ASA replication to get what you want to work.  You do definitely need a centralized consolidated server in the middle of all this as you will never succeed with an "everybody replicates to everybody" scheme.

There are issues in a scheme like this.  First and foremost is reconciling master data and IDs.  For instance, if you enter a new customers a mutliple sites, you have to have some way of assigning IDs so that there are no duplicates when they come to gether.  Like wise, if you edit the same customer at two different sites, who wins?  And of course, what happens when the same customer is entered at site A and site B?  Even if you have a mechanism to prevent duplicate IDs, you now have two versions of the same master data.

Not knowing what your application is, it is a little hard to be specific but I think it is safe to say that even switching to the best tool there is for this kind of thing, you are facing a non-trival task to fix up your database design and application code to make this a bullet-proof architecture.  If you try to short-cut things, you will forever be chained to this beast fixing data problems.

My own approach to this would be to take this in a couple of phases.  Phase 1 would be to switch to ASA.  Phase 2 would be to deploy this with one centralized database.  You can get to this point fairly quickly and with minimal expense.  You then have an opportunity to evaluate both the reliability and backup options for the Internet connections as well as time to really scope out what the database and application changes required are.  If your employer/client still insist on the distributed database architecture, then you are positioned to go forward.  If they decide they can live with the centralized database, you are already there and humming along nicely.


Author Closing Comment

ID: 31506255
Thanks Bill, perfect answer , i was thinking of using sybase mobilink with sql anywhere locally and consolidated mysql remotely, your solution further boosts my approach.. thanks again for the wondelful help.
LVL 19

Expert Comment

ID: 22731840
Glad I could help.

It sound as if you are headed in the right direction.  The only thing I would add is that keeping MySQL in the mix will only complicate things.  If you shift to ASA, go all the way.  It will greatly simplify your life and perhaps provide options not available in a mixed environment.


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question