Introducing Galera Cluster
Galera Cluster is a synchronous replication solution for clusters of MySQL database servers. Database writes are immediately replicated across all nodes in the Galera cluster, and all database servers act as the master. With a few caveats and careful performance testing, a load-balanced Galera cluster can be used in place of a single MySQL database for critical business data that requires very high availability.
The example in this article uses stock MySQL, following these installation instructions to deploy three database servers (db1, db2, db3) on Ubuntu 14.04 images running on DigitalOcean. Installation and cluster bootstrapping should be performed with care, with the end goal of creating a stable cluster of three database servers where each replicates from its two peers. Galera Cluster also supports MariaDB and Percona XtrDB Cluster.
We start with a simple database table (test.data) containing an autoindex id, a value (string), and a count (integer) which is incremented each time the same value is inserted into the table: