How I can Syncronize a Database from SQL betwen 2 servers

May 6, 2016 1.6k views
DigitalOcean MySQL Server Optimization

I have an app and a website as Frontend that work on the same database ....
Lets say as Example Facebook app and facebook Website.

What I would like to do and I m already few days working on it , is :

1) have server A where all the query from the apps IOS and Android are on it
2) have server B where all the query form the website are on it
3) find a way that the same database DATABASE1 can sync live at any interaction

Like that i will have full resource of the servers for each different job , APPS or Website

i Read about “Master Slave Replication in MySQL” but seems that can make only a copy from server A to B and server B if change any data is not sync with A ,
my need is That serve A and B can sync live with their data .

Honestly I have no idea what kind of setup can handle this best.

I’m open to any suggestions (alternative setups) and/or links to any tutorials to set this up successfully.

1 Answer

You want database clustering, not replication. Look into galera.

  • Thanks a lot you open to me a new world !!

    I have just a question cuz my droplet are on Ubuntu 14.4 with SQL …
    Reading on galera and finding some info around they are talking about
    to set up Galera Cluster with MariaDB ....
    Do i need to install also MariaDB or i can only use the galera Cluster ?

    Thanks a lot for you answer !!

Have another answer? Share your knowledge.