Query routing is one of the core features of ProxySQL.
Read/write split is perhaps one of the most common query routing
use, while the other most commonly used query routing
implementation is for sharding.
In this blog post I will show some example on how to implement
read/write split.
Read/write split using different ports
If you are using a proxy like HAProxy you can configure it to
listen onto two ports: one as an endpoint for writes, while the
second port as an endpoint for reads.
People has often asked how to configure ProxySQL using the same
approach, and routing queries based on incoming port.
Here is an example on how to implement query routing based on incoming port, running the follow on ProxySQL's Admin. I will assume you already have master and slaves configured in the right hostgroups: MySQL writer in hostgroup 10, and MySQL readers in hostgroup 20. A similar approach will apply if you are …
[Read more]