Which is more efficient way of retrieving data

Option A : 1 billion data in one collection (with indexing )
Option B : 1 billion data in multiple collection (api will need data across multiple collection )

Happy to hear your feedback

Hi @Bhuvanesh_J ,

There is no enough information to answer such a question.

How many documents are retrieve in each query?

What is the document size on avg? Does the indexes cover efficiently the queried fields?

Does the indexes fit into memory of the queried instance in their uncompressed form?

In general, MongoDB design will prefer data that is queried together to be stored in the same collection or document if it is logically justified, this is to avoid joining collection and multiple data access.

But there is no ne solution fit all and it is really depends on the use case and access pattern.

Thanks
Pavel

2 Likes