Reputation: 7949
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
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
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
Reputation: 180787
Generally, no. However...
Reasons you might want multiple databases:
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