I have a couple of questions
1. A typical rails environment has 3 databases - development, test,
production.
- Can I have more?
- Is there a limit?
2. In most rails applications you usually have one database type i.e.
MySQL or sqlite3 or PostgreSQL or ...
- Can I use MySQL and sqlite3 from the same rails application?
- Is there a limit?
As a usage note, create an abstract base class with the connection you
want and inherit the children (models) from this base class for
connection pooling to work properly. If you don't, your database may
end up with one connection per model in your code.
class OracleConnectBase < ActiveRecord::Base
establish_connection :xyz
@abstract_class = true
end
I have a couple of questions
1. A typical rails environment has 3 databases - development, test,
production.
- Can I have more?
- Is there a limit?
David and Mukund seem to have answered your second question. I'll
focus on this one.
I'd rephrase your question a bit:
1. A typical rails application defines three environments -
development, test, production.
- Can I define others?
Yes, you can. I've had "staging", "fabrication", and
"production_LIVE" environments on various projects in addition to the
standard three.
- Is there a limit?
No, not really. You do have to keep a config/environments/staging.rb
(or whatever your environment is called) and the corresponding section
of the database.yml file, but that doesn't put a limit on how many
environments you can have. The real limit is probably your ability to
give them names that you can keep straight.