[Rails-core] master/slave

Ryan Carver ryan at fivesevensix.com
Wed Nov 23 21:57:07 GMT 2005


Hi all,

We're thinking of moving mysql to master/slave. What I'd like to do  
is configure a reader and writer db in database.yml, then  
AR::Base#create and AR::Base#update would use the writer connection.  
Initially we'd just do 1 reader db. A more complex solution might  
configure more and have each fcgi choose one at random at startup.

If internally AR had the concept of reader_connection and  
writer_connection, it would be easy to build plugins around this.

Seems like this would be pretty easy to do, but are there  
complications I'm ignoring? Has anyone already done this? Good? Bad?

  - Ryan



More information about the Rails-core mailing list