Ryan Tomayko has written a very informative post about how they use Rails to connect to multiple databases for scalability purposes on his project.

You should also check out this post by Blaine Cook, another engineer at Twitter.