Hey all,
Are any of you folks running rails apps on a MySQL Master/Slave
configurations?
If so, do you do splits of reads/writes, or any type of load balancing
from rails?
I’ve developed several applications in the past with PHP and other
languages where I did some software load balancing. For example, my
previous application would parse the query and figure out if it was a
read or a write. Then it would send off the query to the appropriate db
server for it to execute (ie, a select to a MySQL slave, and a write to
a MySQL Master). It’s pretty basic, but provided pretty decent
scalability from the DB side of the application.
From what I’ve seen, I don’t think Rails can do this, unless you
specifically tell the model to connect to the slave when doing Finds,
and connect to the master when doing the update/delete/creates. But
this approach forces the developer to remember to connect to the db.
Anyone have any solutions for this? Possibly a 3rd party
application/load balancer?