Different architectures for MySql database replication
We are building a production setup which has two application servers and two mysql database servers. For HA capabilities I want to set up replication between th开发者_如何学Ce 2 database servers.
Some of the questions I want to address is:
1. What are the pros and cons of having a Master-Slave set up vs a Master-Master set up? Under what conditions do you pick one over the other? 2. In case of failure, which set up is a) Easy to perform failover and restore, b) More reliable (no data loss)?I understand that Mysql provides binary replication, but I will have to use 3rd party tools like MMM (Multi-Master replication manager), I case of Master-Master set up, and Virtual IP's to handle failover.
Most of the docs I found on dev.mysql.com were related to setting up replication and does not really talk about the pros and cons on how to make a design decision between Master-Slave vs Master-Master setup.
Thank you.
I currently have a bunch of slaves set up with binary replication with one master and many slaves. It was a little easier to set up (pro), but requires more intervention if the master goes down. Master-master will rebuild itself if set up properly. Master-slave means the dba has to create a dump, move it back to the master, rebuild and restart MySql. Kind of a pain in the neck.
Basically Master-Master is way more robust if implemented properly. Implement it wrong and you can be in hot water. In small environments, the overhead of doing a manual rebuild on a master-slave can be small enough to not even warrant the more complicated master-master setup.
精彩评论