0
votes

We are currently using Amazon RDS with MySQL 5.5. I was reading about scaling using read-replicas (http://harish11g.blogspot.com/2013/08/Load-balancing-Amazon-RDS-MySQL-read-replica-slaves-using-HAProxy.html), but was unclear about something. Does using the HAProxy architecture require us to change our application logic to send SQL write requests to one agent and SQL read requests to another? I'm looking for a scaling solution that doesn't require us to change application logic, only potentially configuration files.

We are using Spring 3.1.4.RELEASE, JBoss 7.1.3.AS and Hibernate 4.1.0.Final.

1
Well, first I would think about putting a cache layer between your application and database for read loads. If you have highly cacheable requests, this may eliminate the need for scaling altogether.Mike Brant
Sadly this is not an option at this time. Do you know the answer to the question as it is posed?Dave

1 Answers

2
votes

HAProxy does not manage read/write splitting with MySQL. It is a very efficient and lightweight load balancing solution, but when used with MySQL, it has no protocol awareness like it does with http (where it can manipulate headers, route based on patterns, etc.)

HAProxy will load balance your read connections to a healthy replica, but that's all it will do for you on this setup... you still have to do read/write splitting in the application.