Should I create a new collection for better performance in this case?

Hi, I’m a beginner in using MongoDB and databases in general.

I’m using MongoDB for a game, where players can select from a list of levels obtained from the database.

Some levels are single-player, others are multiplayer. Users will only be able to search for either single or multiplayer levels, never both at the same time.

I have a schema and collection called “levels”, only for single-player at the moment. Multiplayer levels could potentially use the same schema, the info is the same.

My question is, should I create a new collection for multiplayer levels, so search/query is potentially faster? Or can I just add a “multiplayer” boolean field in the existing level schema, without significant performance penalties?

It would be much easier for me to just add the multiplayer field, but I fear that if/when I have around a million documents, queries for a list of levels will be slower because it will have to check in a larger collection if each document is of the required “multiplayer” or “non-multiplayer” type. Does this make sense, or are there optimizations in place, or that I can make, to keep it performant?


I would not add a second collection for multi-player levels.

A flag is good.

Implement the simpler design and figure how to optimize it only if you need to.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.