I have been reading lots of docs, blogs,articles.. talking about Mysql Replication and i dont know how to solve it.
We need a failover and redundant solution to our basic data base. So the idea is to buy a new server to have some geographical failover solution.
The initial idea was to store one master database into server A and another master replica into server B, making a master-master replication. But whe want synchronous replication in order to ensure data consistency.
So we test the Mysql Cluster, but im so confused because Mysql official docs says that only should work on local networks. And the other problem is the comunications security.
We have 1.40 ms latency between the two servers.
What should be the best option?? i mean there is no safe option for synchronous redundant data bases between diffenret data centers?
How big companies solve it? or it’s imposible to have geographical redundancy + failover solution + data consistency
Thx All
Master-slave scenario is already a very good solution to protect against a server failure .
If you want the slave to be used for querying in order to spread load, either you accept that the slave can have its data behind master, or you put an additional layer between your app and the database servers.
A few years ago I started to play with Mysql-Proxy. As its name indicates, it acts as a proxy, and amongst other cool things, it can do query balancing over multiple nodes while checking them for availability.
I would add, as a conclusion, that if your link between the 2 DCs is reliable and has a +/- 1.4ms lag, in practise your slave will keep updated and the delay won’t be noticeable by users.
Of course, all this doesn’t apply if your application does things that you didn’t mention (purchase transactions, or if you are a bank;) )
(added as an answer as it was too long for a comment)