ZeroBehind, Galera Cluster or MaxScale: which fits two servers?
High availability for MariaDB has good, mature answers. Most of them are built for three or more servers in one fast network and a team that operates them. This page is for the other case: two servers, one of them possibly far away, and nobody whose job is the database.
The short version
| Built for | Asks of you | |
|---|---|---|
| Galera Cluster | Several writable nodes with synchronous replication | At least three nodes, a fast and stable network between them, applications that cope with its rules |
| MaxScale | A proxy in front of the servers that routes queries and can fail over automatically | A place to run the proxy, its own configuration and monitoring, a look at its license terms |
| Replication by hand | One master and one replica, set up with SQL commands | Knowing the commands, a way through the network, your own monitoring, and a tested procedure for the day roles change |
| ZeroBehind | One master and one replica, set up, watched and switched for you, also across NAT | One agent per server; a person who confirms a takeover; applications pointed to the new master after a switch |
When Galera is the right answer
You need more than one node that accepts writes, or you need a failed node to cost no data at all. Galera replicates synchronously: a transaction is committed when the cluster has agreed on it. The price is that every write waits for the other nodes, so the nodes should be close to each other, and a sensible cluster has at least three of them so that a majority survives a failure.
With two servers, one of them at the end of an ordinary internet link, that price is paid on every write.
When MaxScale is the right answer
You want the applications to keep one address while the servers behind it change, with read and write splitting and automatic failover. That is what a database proxy is for, and ZeroBehind does not do it. The proxy is one more component to run, to keep available itself, and to license.
When replication by hand is enough
Setting up a replica with SQL commands is well documented and costs nothing. The work starts afterwards: knowing whether it still runs, noticing that a job wrote on the replica, and the day of the switch, when the steps have to be right the first time and in the right order.
Where ZeroBehind fits
- Two servers, with standard MariaDB on both and the data in standard format.
- One of them may sit behind a router; the agents bring their own encrypted tunnel.
- A dashboard that counts the gap in transactions instead of seconds of lag.
- A planned role switch and a takeover that refuse to create two masters.
- The website's files copied next to the databases, if you want them.
It is the tool for one master and one standby that somebody has to be able to trust without being a database administrator. If you need several writable nodes or an address that moves by itself, one of the tools above is the better choice, and we will say so when you ask.
Want to see it on your servers?
Tell us what you run. We answer with what is covered and what is not.
Talk to us