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?
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.
Some drawbacks of Galera include:
- Storage engine support: limited to InnoDB/XtraDB (plus experimental support for MyISAM)
- OS support: only Linux/Unix-like Oses
There are also some limitations which should be noted, but can perhaps be worked around:
- By default (Total Order Isolation) DDL operations block the entire cluster until they complete
- Every table must have an explicit primary key, either single or multi-column
- Locking: some types of explicit locking are unsupported.
EDIT: Note also that some argue that tightly coupled database clusters, such as Galera, should not have geo-distributed nodes because of the problems stemming from the inherent unreliability of the network layer. Instead, asynchronous solutions must be used in these cases. See: How Not to do MySQL High Availability: Geographic Node Distribution with Galera-Based Replication Misuse. Nevertheless, the Galera blog states that (2015):
The case for building geo-distributed database clusters is strong. The Galera approach to replication and the specific features in the product make it practical to build Galera clusters that span multiple data centers and multiple users have such clusters already in production.