ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-rails
ruby-rails
[Rails] [ANN] Mysql Replication Adapter
by Bryan Duxbury other posts by this author
Aug 13 2007 2:04PM messages near this date
[Rails] Re: Setting Primary Key (`id` field) with fixtures | [Rails] New release of SCGI
I thought some of you might be interested in a new gemified Rails
database adapter I put together to make it easier to use a single write
master and multiple read-only slave Mysql databases. I've called it
(cleverly) MysqlReplicationAdapter.

You can install it via:
gem install mysql_replication_adapter

And after configuration, you make use of it by:
MyModel.find(:all, :use_slave =>  true)

which will cause the database adapter to select a random slave database
to run the query against. There's more information up on the Rapleaf
Engineering Blog at http://blog.rapleaf.com/dev/?p=5. Check it out and
let me know if it's useful to you as well!

-Bryan
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Ta
lk" group.
To post to this group, send email to rubyonrails-talk@[...].com
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@[...].com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved