I have a very straight forward master/slave replication setup with MySQL. ActiveRecord is configured to hit the master hostname as would be expected in database.yml. My question is, is it currently possible to set an option for ActiveRecord to do all reads from a slave and leave writes to the master? I’m using Ruby on Rails/ActiveRecord 3.1.3. I haven’t found any options to perform the following, just a single host entry field in database.yml. Is this currently possible?
I have a very straight forward master/slave replication setup with MySQL. ActiveRecord is configured
Share
Yes this is possible, but you need to use a gem for it; it’s not built into Rails itself.
I use seamless database pool currently and it works great. Octopus is another alternative.