Galera Cluster – Drawbacks Compared to Master/Slave Replication

galeramariadbMySQLreplicationxtradb-cluster

What are the drawbacks of using Galera Cluster instead of regular Master/Slave Replication? Galera's 0 slave lag time, Synchronous replication and no Single point of failure seem very appealing then why isn't Galera cluster as common?

Best Answer

Because like any other optimization, it doesn't fit every workload.

Galera can get overwhelmed by a high rate of transactions, or when transactions update many rows. It can also make your applications experience delays on COMMIT as the cluster is synced up.

Galera doesn't update other nodes synchronously, either. It just transmits worksets synchronously. In this way, it's a bit like standard replication in semi-synchronous mode. Therefore there's still a small chance of reading stale data from another cluster node. There's an option you can set to force SELECT to wait until the queue of worksets has updated the database, but this means you have delays on SELECT. And even a chance of getting a deadlock on SELECT, which seems counter-intuitive.

Galera is brilliant, but not a one-size-fits-all technology. There are still good reasons to use asynchronous replication.