navy navy - 8 months ago 105
MySQL Question

HAProxy/MySQL Proxy/ Mysql Router Master-slave replication; read-wirte splitting strategy

We have MySQL MASTER-SLAVE Replication (1 Master and 1 Slave) setup and everything is working fine.

Currently all load (reads/writes) are going to MASTER server.
Now we want all writes to be redirected to only Master server and reads to be distributed between Master and Slave servers.

We are looking for a bit of clarification on the best strategy for that from below.

  1. HAProxy

  2. MySQL Proxy

  3. MySQL ROuter


After researching, I came to the conclusion that here we need to use Ha-Proxy with Hybrid approach.

Eg: All right operations goes to 3306 port Ha-Proxy and read goes to 3307 port.

The logic to decide port must be implemented on programming side rather than Ha-Proxy side.