Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL dual master

For my current project we are thinking of setting up a dual master replication topology for a geographically separated setup; one db on the us east coast and the other db in japan. I am curious if anyone has tried this and what there experience has been.

Also, I am curious what my other options are for solving this problem; we are considering message queues.

Thanks!

like image 665
Manish V Avatar asked Apr 29 '09 18:04

Manish V


People also ask

Does MySQL support multi-master?

Multi-master replication for MySQL is easy to setup, is similar to master-slave replication and provides a host of features and options not available with the regular master-slave setup.

Does MySQL support master master replication?

MySQL Master Master replication is a development of master-slave replication that addresses its major flaws. This method of replication requires two or more master nodes that can handle both read and write requests. Additionally, each of your masters can have several slave nodes.

How MySQL master master replication works?

The MySQL replication feature allows a server - the master - to send all changes to another server - the slave - and the slave tries to apply all changes to keep up-to-date with the master.

Is bidirectional replication setup available in MySQL?

You can use replication to copy data from a source MySQL database server to one or more replica MySQL database servers.


2 Answers

Just a note on the technical aspects of your plan: You have to know that MySQL does not officially support multi-master replication (only MySQL Cluster provides support for synchronous replication).

But there is at least one "hack" that makes multi-master-replication possible even with a normal MySQL replication setup. Please see Patrick Galbraith's "MySQL Multi-Master Replication" for a possible solution. I don't have any experience with this setup, so I don't dare to judge on how feasible this approach would be.

like image 114
Stefan Gehrig Avatar answered Oct 20 '22 00:10

Stefan Gehrig


There are several things to consider when replicating databases geographically. If you are doing this for performance reasons, be sure your replication model supports your data being "eventually consistent" as it can take time to bring the replication current in both, or many, locations. If your throughput or response times between locations is not good, active replication may not be the best option.

like image 36
Chris Ballance Avatar answered Oct 19 '22 22:10

Chris Ballance