Efficient way of using multple Database

Is there a efficient way of using multiple databases in a Rails
application. I saw DB Charmer but, it did not work with 3.2.8 and even
in Rails 3.2.3 it gave problems.

Is using establish_connection inefficient?


Nope, what I am thinking is we need to migrate, the two databases need
different set of tables. I am having a hard time.

Ah, ok, a subject line and posting that asked for the best way to
handle migration of multiple databases might have been more useful.
Sorry I have never done that, but googling for
rails migrate multiple databases
yields some likely looking hits.


There is a gem called DB charmer, but does not work :frowning:

You can try the following, so far it has worked for me on rails 3.2.8

Grab the gem source code from
1. git clone https://github.com/kovyrin/db-charmer.git

Modify the dependency inside the gemspec file, instead of <= 3.2.3 edit
to ~> 3.2.3
2. vim db-charmer.gemspec
3. s.add_dependency 'activesupport', '~> 3.2.3'
     s.add_dependency 'activerecord', '~> 3.2.3'

Build the Gem.

4. gem build db-charmer.gemspec

Install the newly built gem. (You should replace the old one after with
gem clean)

5. gem install db-charmer-1.7.1.gem

We use Octopus https://github.com/tchandy/octopus , its quiet good