When should a new Database be created rather than new tables in an existing Database?
For example, if I have a site and I want to add a forum to it, should I add the forum tables to the existing Database or should I create a new Database and add the forum tables there?
In other words, when does it make sense to add new tables to a new Database rather than to an existing Database?
Thank you.
It is generally syntactically easier to join on tables that are in the same database. It’s really a question of logical grouping.
In the case of a forum on a website, if you have a shared “User” table, or similar, you may want to keep things in the same database because it can make things like foreign key constraints and joining simpler.
you could design your application so that every table is in a separate database. If that seems ridiculous, ask yourself why it seems ridiculous, and you are likely to come up with a heuristic about what tables belong together. you can then apply that heuristic to future additions.
This answer doesn’t really apply if you are talking about 3rd party databases. For 3rd party products that need their own database, I think ringfencing into a separate DB is almost always the right call.