Galera cluster consists of at least 3 MariaDB nodes with synchronous data replication. We use this solution for customers who demand high availability as well as great performance. However, Galera has several limitations, that you need to respect for a trouble-free experience.
The most important rule is to only do writes against one node. On the other hand, read requests should be spread across all nodes. This way, you will prevent frequest deadlocks due to contradicting write operations and you will maximize the throughput for read operations. Therefore, the optimal solution is to use 2 database connections - one for writes and another for reads. If it is not feasible to implement this in your application, then we recommend using MaxScale query load balancer. Naturally, it requires more processing power than simple TCP traffic balancing.
A frequent issue that we run into, is excessive amount of write operations. Because writes are replicated on all nodes, they do not scale with their number. Rather, due to overhead, write performance is lower than in single node scenario.
Another limitation is writeset size. You should not change more than a couple hundreds of MBs in a single write operation. Replication of such queries to other nodes is extremely demanding. And if you exceed the recommendations, it might even crash the cluster and cause a service outage.