title: How to access multiple databases in rails 3.1.0 app?
body: <p>In our rails 3.1.0 app, we would like to access multiple databases based on user credential. There are multiple solutions. One is to install one app for each user and every app only accesses one database. The problem is that if there are many databases (such as hundreds), there would be equal number of app installations. Maintenance of large number of apps may be a hassle.  Another approach is to access multiple databases within the app. However this approach seems not readily supported in rails 3.1.0. Certainly there would be a code within the app to decide which database to access for the user who just logs in. Can someone provide solutions and insights about pros and cons of the approache? thanks so much. </p>