= FreshConnection * https://github.com/tsukasaoishi/fresh_connection == Description FreshConnection supports of connect with Mysql slave servers via Load Balancers. Currently, I have only tested with Rails2.3.14. In the future, I plan to support Rails3. All connections will be disconnected every time at the end of the action. == How to use at Rails === Gemfile gem "fresh_connection", "=0.0.1" === config/database.yml production: adapter: mysql encoding: utf8 reconnect: true database: kaeru pool: 5 username: master password: master host: localhost socket: /var/run/mysqld/mysqld.sock slave: username: slave password: slave host: slave max_connection: 5 slave is config to connect to slave servers. max_connection is max connection number to connect to slave. Others will use the master setting. If you want to change, write in the slave. === config/environment.rb require 'fresh_connection' ActionController::Dispatcher.middleware.swap ActiveRecord::ConnectionAdapters::ConnectionManagement, FreshConnection::Rack::ConnectionManagement == Synopis Read query will be access to slave server. Article.where(:id => 1) If you want to access to master saver, use readonly(false). Article.where(:id => 1).readonly(false) In transaction, Always will be access to master server. Article.transaction do Article.where(:id => 1) end