DB Design betwwen 2 DBs VS 2 Schemas We're preparing a database design for an ERP. The ERP are composed from several modules and every module has his proper db, which can deployed at least on one personnel schema. 

When we have the choice to choose between deploying the app on 2 databases on the same physical server or on 2 schemas always on the same server, which strategy we have to choose or use?

We're using PostgreSQL 9.4 and Jboss server.
While cross-database queries are possible and quite efficient with a current release (not such much with the somewhat dated 9.4 version), they are still more complicated then simply joining two tables from two different schemas.

So, if there is just a slight chance that you want to do queries that use tables from more then one module (e.g. for reporting) separate the modules using schemas. 

Using different database doesn't really buy you that much unless you also host them on separate instances, which would enable you to e.g. replicate them individually (replication can - as of 9.6 - still only be done per cluster with stock Postgres). 

Different database would help if those modules were more like tenants and you want to make sure that a single module and their (database) users never have the chance to even take a glimpse on the other tables.



Unrelated, but: for a new project you should really consider the current Postgres version which is 9.6.