A database proxy is a wonderful tool that is able to provide significant functionality across various use cases. For example, a seamless master role switch to another node for maintenance; transparency with read and write connections; or providing automatic, intelligent database load balancing.
In the MySQL world, these proxies provide a single entry point into MySQL databases for the calling client applications. Or put differently, the proxy is a middle layer sitting between a MySQL database and an application. The application connects to a proxy, which then forwards connections into the database.
Good proxies make MySQL database clusters appear like single databases by hiding the “behind-the-scenes-plumbing” from the application. One example of this allows a master failover to occur which “hides” the promotion of the new master from the client. These types of proxies can make a MySQL cluster appear as a simple MySQL database to applications even in complex topologies and can also provide read scaling optimizations at the same time.
This is of particular importance nowadays where high availability is a must and data is distributed across multiple instances, or remotely across multiple datacenters.
There are a number of MySQL database proxy alternatives available for users to evaluate and choose from including:
- HAProxy: this is probably the best known database proxy for MySQL and has been popular with users for many years. “HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for very high traffic web sites and powers quite a number of the world’s most visited ones.” You can read more here: http://www.haproxy.org/#desc
- ProxySQL: this is still a relatively new player in the MySQL proxy field, but has made great strides over the past few years, thanks to René Cannaò’s (its creator) efforts. It’s been quickly adopted within the MySQL community. ProxySQL is a high performance database proxy for MySQL with a GPL licence. You can read more here: https://www.proxysql.com
- And there are more of course, such as MaxScale, NGINX and MySQL Router
ProxySQL has published a handy comparison of various proxies on their website that users can check out.
What most people don’t know or realise (including myself until I joined Continuent) is that there is another MySQL proxy in town … namely, Tungsten Proxy, known by Continuent customers as Tungsten Connector. It is in fact a MySQL proxy; and at Continuent, we like to refer to it as an ‘Intelligent Proxy for MySQL’.
While the Tungsten Connector proxy may be news to you, it really is not a new kid on the block. It has been an important part of the Continuent Tungsten Clustering solution since 2006 … But more on that in upcoming blogs!
Tungsten Proxy – The Intelligent MySQL Proxy – in a nutshell
- Provides intelligent traffic routing to valid MySQL master(s), locally and globally
- Scales read queries via query inspection and other methods
- Application and active users do not disconnect during MySQL master failover events
- Combined with another intelligent layer of Tungsten Clustering called Tungsten Manager, it provides automatic, rapid master failover for MySQL High Availability and automated cross-site level failover for Disaster Recovery
We’ll be talking about database proxies for MySQL more regularly in 2020, starting with a new introductory webinar on the topic. This will include some initial insights into Tungsten Proxy in addition to a step-by-step introduction to what database proxies (for MySQL) are and do.
Stay tuned – we look forward to more MySQL proxy discussions during 2020!