Reputation: 551
When would I create a new database in MongoDB - does creating a separate database offer any advantage? From my understanding all the databases in a cluster share the same hardware resources so there’s no advantage there. Same for collections.
When would I create a new collection (table in RDBMS)? Only when the data looks different from other collections? or is there some sort of configuration, isolation etc that creating a new collection vs using the same collection provides?
Upvotes: 2
Views: 872
Reputation: 14490
Databases are created for, among other reasons:
Collections are created for, among other reasons:
It is possible to put all data into a single collection in a single database. https://www.thedailywtf.com/ has examples of (anonymized) applications doing that. See e.g. https://thedailywtf.com/articles/dynamic-tables. Usually the result is unmaintainable.
Upvotes: 2