# \[ANN\] Mysql Replication Adapter

**URL:** <https://www.ruby-forum.com/t/ann-mysql-replication-adapter/111970>\
**Category:** Rails\
**Created:** [August 13, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/ann-mysql-replication-adapter/111970 "2007-08-13T23:04:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdeverea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f6c823/32.png) [@bdeverea](https://www.ruby-forum.com/u/bdeverea)\
**Post date:** [August 13, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/ann-mysql-replication-adapter/111970/1 "2007-08-13T23:04:14Z")

</div>

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](http://blog.rapleaf.com/dev/?p=5). Check it out and  
let me know if it’s useful to you as well!

-Bryan
