Is it good to have multiple database running in a same project? Is it good to have multiple database running in a same project? database database

Is it good to have multiple database running in a same project?


Not really.

There are certainly circumstances where it's required or even desirable, but those are for specific use cases.

In general you don't want to for a combination of relational integrity (difficult to enforce across databases) and transactional integrity. There would have to be a really compelling reason to split the datasets to incur the added complexity and maintenance of a separate database instance.


Generally, no. However...

Reasons you might want multiple databases:

  1. Different objectives. e.g. OLAP vs OLTP
  2. Different companies, domains or tenants, where you need guarantees that the data between domains will never be commingled.
  3. Data archival.

If none of these conditions apply, you probably don't need multiple databases. Instead, you partition your data by using field id's such as TenantID, CategoryID, etc.


Generally, if one project consumes multiple databases, it is because it must consume different, often legacy sources of information that originated outside of this particular project. This is most common in Enterprise environments.

If you are creating a new project, create a single database to represent the data associated with that project unless there is a specific, convincing argument to do otherwise.