Friday, January 27, 2012

MySQL replication

MySQL replication is easy to setup but very basic comparing to the Oracle replication. But my biggest complaint is that it allows user to setup Master-to-Master replication. Because MySQL replication is asynchronous, The ACID property of modern relational database is down to the drain with the MySQL Master-to-Master replication. The correct way for MySQL Master-to-Master is MySQL cluster setup.

This example shows the problem with MySQL Master-to-Master replication. Master A executes "update table a_table set col1 = 1 where id =1;" and master B executes "update table a_table set col1 = 2 where id =1;" at about the same time, there are three possible outcomes:
1. master A: a_table col1=2 where id = 1 and master B: a_table col1=1 where id = 1, the two masters are out of sync
2. for both masters: a_table col1=1 where id = 1
3. for both masters: a_table col1=2 where id = 1
There is no way to predict what outcome of one the three with MySQL multimaster replication.

No comments:

Post a Comment