Hi @Shruthi_s1,

Welcome to MongoDB community.

Its true that collection and databases share the same resources and potentially connection string from your drivers.

Moreover database is a logical context and does not necessarily influence number of files or eventually data size.

Database seperation is usually done as same collection have different context or for security measures where I have a user per database and it can read/write data to that database only.

However, seperating collections is a data design consideration.

Its important to remember that we want to access as less documents as possible to fetch our information while maintaining a good tradeoff to our index sizes, write performance and concurrency patterns.

In general a completely separate business logic entity should store its data in. A sperate collection and have its own indexes and access pattern.

There are other considerations like relationship, compression and future scale out (sharding) that can influence a good choice of schema and collection seperation.

I recommend reading the following:

https://www.mongodb.com/article/schema-design-anti-pattern-summary/

https://www.mongodb.com/article/mongodb-schema-design-best-practices/

Thanks.
Pavel

6 Likes