I think you can depend on Percona XtraDB Cluster Feature 2: Multi-Master replication
than MySQL regular replication
They promise the following:
By means of Multi-Master, I mean the ability to write to any node in your cluster and do not worry about the fact that you end up with a situation of lack of synchronization, since this happens regularly with regular MySQL replication if you inadvertently write to the wrong server.
Using a cluster, you can write any node, and the cluster guarantees consistent records. That is, the recording is either performed on all nodes, or not performed at all.
Two important implications of the Muti-master architecture.
First: we can have several applications running in parallel. This gives us true parallel replication. A slave can have many parallel threads, and you can set it to the wsrep_slave_threads variable
Secondly: there may be a short period of time when the subordinate is disconnected from the master. This is because the master can apply the event faster than the subordinate. And if you are reading from a slave, you can read data that has not yet changed. You can see it from the diagram. However, you can change this behavior using the wsrep_causal_reads = ON variable. In this case, the read on the slave will wait until the event is applied (this, however, will increase the response time of the read. This gap between the slave and the master is the reason why this replication is called " virtually synchronous replication
", and not real " synchronous replication
"
The COMMIT behavior described is also of second serious importance. If you perform write transactions on two different nodes, the cluster will use an optimistic locking model. This means that the transaction will not check for possible lock conflicts during individual requests, but rather at the COMMIT stage. And you can get an ERROR response to COMMIT. I emphasize this as it is one of the inconsistencies with regular InnoDB that you may experience. In InnoDB, usually DEADLOCK and LOCK TIMEOUT errors occur in response to a specific request, but not to COMMIT. Well, if you follow good practice, you still check the error code after asking for βCOMMITβ, but I have seen many applications that do not.
So, if you plan to use Multi-Master capabilities of XtraDB Cluster, and run write transactions on several nodes, you may need to make sure you handle response on "COMMIT" query.
You can find it here along with picturesque text.