Sharing databases between applications
Firstly, you need to open your firewall on the first application to allow your second application's web servers to access the database.
You will then reference the database credentials from your first application in the database.yml of your second application. You can reference the environment variables for these credentials on your first application as follows:
(your application UID is available under the Information tab of your Settings page)
For example, your environment variables would be set like this: