patternsqlMinor
Using Replication for Scale-Out
Viewed 0 times
replicationforusingscaleout
Problem
Having read Using Replication for Scale-Out, how can I route different queries to different servers, for example,
SELECTI want to route to slaves and NON-SELECT to master. I assume as loadbalancer I can use haproxy, but I didn't find it's possible to distict between queries on the level of haproxy? In addition, let's say someone have reached master directly, how can master identify that this is SELECT query and show be sent to slave, or to loadbalancer.Solution
There is a project called MySQL Proxy that is attempting to handle read/write splitting in the proxy layer, but it is not production-ready. You can read more about the issues on this page, paying attention to the known issues section.
For now, as others have noted, you have to handle the routing through your application.
For now, as others have noted, you have to handle the routing through your application.
Context
StackExchange Database Administrators Q#11443, answer score: 3
Revisions (0)
No revisions yet.