I am a novice Zend Framework 2 and Doctrine developer. I could not find answers for the problems described below.
I am using multiple databases for one website. For example there is a users database with all user details and a database with statistics. It's possible that there are statistics for a user so there are relations (constrains) between both databases. For previous projects I used one configuration file and one class/directory with entities (for one db).
- How can I use multiple databases in one project with correct table relations?
- How/where should I store the database configuration?
- How/where should I store the entities?
In the same project I use multiple versions of the databases (develop, testing, production) so I want to use prefixes for the database name. For example dev_users and tst_users. I think I should use a prefix from an configuration file and use it somewhere to prefix the databases.
- How should I prefix all databases?
At last I am really curious how other people use database entities when the have multiple modules using them.