Galera Cluster for MySQL
Features
MySQL/Galera is synchronous multi-master cluster for MySQL/InnoDB database, having features like:
- Synchronous replication
- Active-active multi-master topology
- Read and write to any cluster node
- Automatic membership control, failed nodes drop from the cluster
- Automatic node joining
- True parallel replication, on row level
- Direct client connections, native MySQL look & feel
Benefits
These features yield un-seen benefits for a DBMS clustering solution:
- No slave lag
- No lost transactions
- Both read and write scalability
- Smaller client latencies
Technology
MySQL/Galera cluster uses Galera library for the replication implementation. To interface with Galera replication, we have enhanced MySQL server to support replication API definition in the wsrep API project.
The implementation of the replication API in MySQL server , happens in open source project: MySQL-wsrep.
Use Cases
Galera replication works for a wide variety of use cases, here are some common use cases we have identified in the open source community:
| Read Master | Traditional MySQL master-slave topology, but with Galera all "slave" nodes are capable masters at all times, it is just the application who treats them as slaves. Galera replication can guarantee 0 slave lag for such installations and due to parallel slave applying, much better throughput for the cluster. |
| Write Scalability | Distributing writes across the cluster will harness the CPU power in slave nodes for better use to process client write transactions. Due to the row based replication method, only changes made during a client transaction will be replicated and applying such a transaction in slave applier is much faster than the processing of the original transaction. Therefore the cluster can distribute the heavy client transaction processing across many master nodes and this yields in better write transaction throughput overall. |
| WAN Clustering | Synchronous replication works fine over the WAN network. There will be a delay, which is proportional to the network round trip time (RTT), but it only affects the commit operation. |
| Disaster Recover | Disaster recovery is a sub-class of WAN replication. Here one data center is passive and only receives replication events, but does not process any client transactions. Such a remote data center will be up to date at all times and no data loss can happen. During recovery, the spare site is just nominated as primary and application can continue as normal with a minimal fail over delay. |
| Latency Eraser | With WAN replication topology, cluster nodes can be located close to cilents. Therefore all read & write operations will be super fast with the local node connection. The RTT related delay will be experienced only at commit time, and even then it can be generally accepted by end user, usually the kill-joy for end user experiences is the slow browsing response time, and read operations are as fast as they possibly can be. |
Performance
We have tested MySQL/Galera with several DBMS performance benchmarks. Here are results from recent benchmarkings: benchmark results
Release History
MySQL/Galera project has following major release history:
| Release | Date | Content |
|---|---|---|
| 2.0 Release | Q1/2012 | Incremental State Transfer |
| 1.0 Release | Q3/2011 | MySQL 5.5 Support |
| 0.8 Release | Q2/2011 | Optimized snapshot transfer |
| 0.7 Release | December/2009 | DB snapshot transfer implementation to support fail over, Open Source Release |
| 0.6 Release | Apr/2009 | Full SQL support, including DDL |
| Demo-2 Release | Mar 2009 | Advanced feature set for performance testing with real applications. |
| Demo-1 Release | Jan 2009 | Stable release for evaluating the performance with real applications. |
