LiJung
LiJung

Reputation: 7949

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

I had read many database design books, but all of them use only one database to deal with a project. But I was wondering that is that a good idea to have multiple database dealing with the same project?

Upvotes: 9

Views: 10694

Answers (3)

Will Hartung
Will Hartung

Reputation: 118593

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.

Upvotes: 6

Eric J.
Eric J.

Reputation: 150108

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.

Upvotes: 3

Robert Harvey
Robert Harvey

Reputation: 180787

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.

Upvotes: 4

Related Questions