HAProxy is a layer 4 TCP port traffic manager. It can do simple load balancing based on rules like âleast connectionsâ or âround-robinâ. Works well with MySQL. Cannot do query pattern matching; no rules for query processing; no cache.
MySQL Router is a mysql-specific router much like HAProxy and has the same cons. It is not widely used in the ecosytem due to performance issues.
ProxySQL is a layer 7 traffic manager/load balancer/connection multiplexer. it âspeaksâ mysql and can route queries based on the actual contents of the SQL itself. It has a rule engine for complex routing/splitting and has native query caching. proxysql also understands group replication, xtradb clustering, and typical async replication.
The rule of thumb is whatever you are comfortable with. My default is ProxySQL because it is highly performant (X0,000 connections) and has many features.
Sorry, I hope, my Question is not clear. Let me try to rephrase it.
Is there any relationship between Proxy module and Replication logic? Is there any inter-dependency between Proxy and Replication? For example, Async/Group replication may not work well with specific proxy module.
Based on the previous answer, I think, there is no dependency. If there is any, plz throw some light on it.
@midson Replication and Proxy are 2 completely different topics. You can do replication without any proxy. ProxySQL can be made aware of replication, and proxysql can monitor replication state, but it has nothing to do with replication itself.
I got the doubt after reading below text. (Sorry, took a while to recollect this place). And nothing mentioned about ProxySQL here.
Proxy solution used by the Operator for the database cluster depends on the replication type used in the cluster. [HAProxy] can be used with both replication types, while [MySQL Router] can be used with Group Replication
Also I need to know, why ProxySQL is supported in Percona Operator for MySQL based on Percona XtraDB Cluster" and NOT in âPercona Operator for MySQL based on Percona MySQL Serverâ
@midson I spoke with our MySQL product manager and he said proxysql was considered too complex for simple mysql replication. It makes sense to have it built-in for PXC because thatâs a cluster with simpler topology. You are certainly free to use Proxysql yourself inside its own container with the base percona mysql operator. Personally, if you are wanting a stable HA mysql, you should go with the PXC operator anyways. If you need just a single mysql server, use the mysql operator.