VSHN Managed MariaDB HA Proxy solutions
Problem
We want to provide a HA Galera service to our customers. In order to be able to properly use Galera, we need a proxy solution in front of Galera forwards the queries to the "correct" galera node. There are multiple products on the market that can act as a proxy for galera. They all come with different feature sets and price tags.
Solutions
The following section contains the solutions that are the most widely used on the market. We list them here with the features that they support:
Requirement | MariaDB Maxscale | ProxySQL | HAProxy |
---|---|---|---|
Proxy SQL traffic |
✅ (Layer 4 Proxy) |
✅ (Layer 4 Proxy) |
✅ (Layer 3 Proxy) |
Load-Balancing |
✅ (query based) |
✅ (query based) |
✅ (tcp based) |
SQL Aware |
✅ |
✅ |
❌ |
High Availabilty |
✅ |
✅ |
✅ |
Failover |
✅ |
✅ |
✅ |
Metrics |
✅ |
✅ |
✅ |
Query Routing |
✅ |
✅ |
❌ |
Read-Write Splitting |
✅ |
✅ |
❌ |
Helm Chart |
❌ (we have one ourselves) |
✅ |
✅ |
License |
BSL |
GPL 3 |
GPL/LGPL |
Pricing |
Only available with MariaDB Enterprise |
Free (Paid support available) |
Free (Paid Enterprise version available) |
Analysis - MariaDB Maxscale
This is the official proxy solution by MariaDB itself. It is by far the feature richest solution. However, this comes at a hefty price. Maxscale comes bundled with MariaDB Enterprise and is not available as a standalone solution. MariaDB doesn’t publish any pricing lists, however research showed that MariaDB Enterprice for three nodes is in the lower 5 figures per year.
- Advantages
-
-
Written and maintained by the MariaDB company
-
Layer 4 (SQL aware proxy)
-
Huge amount of features (including Read-write splitting)
-
Easy to configure
-
Support from MariaDB through Enterprise subscription
-
- Disadvantages
-
-
BSL
-
Only available through Enterprise subscription
-
Licensing tracking required
-
Slight performance impact due to being a Layer 4 proxy
-
No official helm chart
-
Analysis - ProxySQL
|https://proxysql.com/[ProxySQL]
ProxySQL is a lightweight SQL proxy published under the GPL 3.0. The software itself is free to use. The company offers support plans if desired. ProxySQL is not as feature rich Maxscale, but it still has a quite big feature list. Most notably the read-write splitting.
- Advantages
-
-
OpenSource GPL 3
-
Layer 4 (SQL aware proxy)
-
Read-write splitting
-
Galera Support
-
Slight performance impact due to being a Layer 4 proxy
-
Helm chart availble
-
- Disadvantages
-
-
A bit more complex to configure than maxscale
-
We don’t have experience with this tool yet
-
Analysis - HAProxy
|https://www.haproxy.org/[HAProxy]
HAProxy is an open source multi purpose proxy and loadbalancer. It is known for it’s high performance and ability to handle huge amounts of requests. However, HAProxy is only able to proxy and loadbalance traffic on either HTTP/S or TCP level. It doesn’t understand SQL and hence can’t load balance traffic depending on the query.
- Advantages
-
-
OpenSource GPL/LGPL
-
High performance
-
We know HAProxy well
-
Helm chart
-
Easy to configure
-
- Disadvantages
-
-
Layer 4 (TCP Proxy)
-
No Loadbalancing based on query
-
Rationale
Maxscale is only available as a bundle with MariaDB Enterprise, which is too expensive for our use case and would make the whole product very hard to sell.
Athough we have quite some experience with HAProxy and is performing very well, it unfortunately lacks any support for SQL query based routing / load balancing. This is a huge draw back and limits the usages of a galera cluster considerably as we won’t the Galera nodes only during failover scenarios, but not for load balancing in general.
ProxySQL is also a rather lightweight solution build for high performance. However, it can’t keep up with the performance of the Layer 3 HAProxy solution[1].
Furthermore, ProxySQL is fully open source and published under GPL 3.