Embedding vs linking

In my Users collection, each document represents a user of my app. Each user may create up to N sets of filters. Each set of filter forms a document of up to 10 kb.

Suppose that N = 100, would embedding be preferred?

....

At N = what would linking be preferred, roughly speaking?

Upvotes: 2

Views: 29

Answers (1)

NeNaD
NeNaD

Reputation: 20334

MongoDB document limitation is 16MB.

That means that you can store up to 1600 filters in the user document, where each filter will have 10kb. Also, consider that your user will probably have other fields in its document.

So, to answer your question, 100 filters would be ok to embed.

Upvotes: 2

Related Questions