János
János

Reputation: 35090

Disadvantages for using one big collection

What disadvantages do you see if instead of many collections I would use one, and "collecitonname" would be only a field in the record?

Upvotes: 0

Views: 110

Answers (1)

Adam Griffiths
Adam Griffiths

Reputation: 782

Search speed.

When you attempt to perform any operation on a document in a collection mongoDB must first find that document in the collection.

If the field you are searching for is not indexed then search speed will decrease at the same rate that you add documents to the collection.

If your collection is indexed, then the search speed will still decrease but at a much slower rate. Indexes are stored in RAM however so if you have one large collection then your index will take up a lot of RAM.

Upvotes: 2

Related Questions