1

Thus far I have found two trigger driven MariaDB synchronization utilities - SymmetricDS and PervaSync. Quite apart from the fact that they are rather pricey (which may be ok) what I do not like is that they both require a Java capable server (Tomcat) to be installed. I run Nginx and have no real desire to have anything else there. Are there any equivalents that are written in PHP? Or perhaps an open source/MIT licensed option. My searches thus far have not revealed any alternatives. I'd be most grateful for any suggestions


What I would expect from the synchronization tool is listed below

  • Is able to periodically (say every 5-10 minutes) synchronize a set of N MariaDB databases (4 for starters but more in due course) that are located in different geographic reigons
  • The various DBs are subject to alterations (INSERTS, DELETES, UPDATES) as a result of user activity in their respective regions. However, there is a cast iron guarantee that operations in one region will never cause conflicts with those performed in any other region
  • The entire purpose behind the synchronization is to allow users to seamlessly access their data from another region if and when required
  • Speed is not an issue - updates at a rate of once every few minutes will do nicely
  • We run PHP on Nginx. Running a secondary server is not an option - and certainly not Tomcat et al.
  • The ideal solution would be one that runs as a native appliction (I am thinking a compiled package running on Ubuntu) or as a PHP script.
  • At the moment we are operating with an in-house synchronization solution that squirrels away changes before they are committed to the database. Those changes are periodically lifted by a "synchronizing server" which then handles with the task of getting all the other sibling servers into line. This is working. Nevertheless it is a home grown solution and outwith our area of expertise. That is why I am looking around for possible options.
  • @Izzy - there you go. A few more details for you. – DroidOS Jan 30 '15 at 21:10
  • Looks like MySQL Cluster (or the MariaDB equivalent – "Galera Cluster" AFAIK) might be an option for you. You can e.g. see here for an Ubuntu install (or here for Galera). – Izzy Jan 30 '15 at 23:15
  • Thanks - the principal reason for not considering Galera is that given the fact that it attempts real-time updates - i.e. synchronous replication - there is a latency determined by the slowest node in the cluseter. – DroidOS Jan 31 '15 at 4:14
  • I see. But IMHO that depends on configuration: How to Set Up Asynchronous Replication from Galera Cluster indicates it can be set up asynchronous as well. (Btw: that was the first hit on a Google search for "Galera asynchronous" ;) – Izzy Jan 31 '15 at 10:13
  • 1
    I currently do this via a PHP script run off a CRON job on a "synchronization" server. It polls the various MariaDB servers, picks DB changes and parcels them off to the other servers. On each of those servers, where I use PDO, I have written up a dbExec($sql,$omit,$priority) function which squirrels unomitted SQL statements to a database table. Priority is an internal thing - I prioritize sync ops for high priority users. This works - perfectly but is clearly a hackish solution by someone who does not really understand what he is doing (me :-/) – DroidOS Jan 31 '15 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.