Skip to content

Commit

Permalink
Updated README file to include an example of the database.yml file an…
Browse files Browse the repository at this point in the history
…d a little more of an overview of what masochism does.
  • Loading branch information
Robby Russell authored and technoweenie committed Mar 4, 2008
1 parent 00f72aa commit 50e9e58
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions README
@@ -1,15 +1,32 @@
masochism
==============

Connection proxy sends some queries (those in a transaction, update statements,
and ActiveRecord::Base#reload) to a master database, and the rest to the slave
database. The ActiveReload::MasterDatabase model uses a 'master_database'
setting in database.yml to serve as the master database.
The masochism plugin provides an easy solution for Ruby on Rails applications to
work in a replicated database environment. Connection proxy sends some database
queries (those in a transaction, update statements, and ActiveRecord::Base#reload)
to a master database, and the rest to the slave database.

The ActiveReload::MasterDatabase model uses a 'master_database' setting in
database.yml to serve as the master database.

# config/database.yml
login: &login
adapter: postgresql
host: localhost
port: 5432

production:
database: slave_database_name
<<: *login

master_database:
database: master_database_name
<<: *login

To setup:

Whether you want this in production only, or maybe just your deployment server,
is up to you. Just call this method somewhere:
is up to you.

ActiveReload::ConnectionProxy.setup!

Expand Down

0 comments on commit 50e9e58

Please sign in to comment.