Do You Need Five 9s?
Finding the right high availability strategy for your business
When it comes to database high availability, how many 9s do you really need? The minimum for most organizations is three 9s. Will that suffice for you, or do you need four? Or is five 9s—less than 1 second of downtime per day—a must?
Finding the right mix of reliability and infrastructure complexity is vital to make the best use of your resources. Let’s take a high-level look at three common approaches, spanning from 99.9% to 99.999% uptime.
Master-slave replication: 99.9% or 99.99%
Master-slave replication is one of the most common methods for avoiding service disruption after a server fails. It allows you to mirror the contents of one or more master servers to one or more slave servers. Here’s how it works, in a nutshell: All database changes are written into the binary log as binlog events. The slaves then read the binary log from each master to access the data for replication. A slave server keeps track of the master binlog location for the most recent event applied on the slave, allowing for smooth failover, where the slave resumes from where the master left off.
Failover can be handled manually or automatically. For non–mission-critical applications, which require only three 9s, a DBA or sysadmin can manually promote one of the slaves to master, but most organizations now choose automatic failover. Automating failover is faster and many database management systems provide tools to make it easy. Replication with automatic failover can grant you four 9s.
The MariaDB MaxScale database proxy supports automatic failover by guaranteeing that all your slaves have same information and are therefore equally equipped to take over for the master. Additionally, because sudden spikes in the number of connections or queries can lead to unplanned downtime, MaxScale includes load-balancing features such as read/write splitting, connection-rate limiting and result-set limiting.
Master-slave replication can be asynchronous or semi-synchronous. We won’t go into detail on those topics here, but they’re a main focus of our Best Practices for High Availability with MariaDB webinar; you can watch the recording anytime. That webinar also delves into multi-master synchronous replication with the MariaDB Cluster, which we’ll take a quick look at now.
MariaDB Cluster: 99.999%
The MariaDB Cluster uses Galera technology to enable multi-master clustering solutions. It is a synchronous multi-master cluster that keeps all your server nodes in sync. When you conduct a transaction on one node, that transaction’s data is immediately available on all the other nodes in the cluster. Because there’s no slave lag and no chance for lost transactions (as is sometimes possible with simple replication), this schema allows for very fast failover and five 9s of uptime.
There’s so much more!
Now that you know the basic options for high availability, you need to know the pros and cons of each approach. Our definitive guide to high availability with MariaDB TX covers that topic plus use cases, various topologies and HA tuning tips.