views:

109

answers:

1

I am saving a reference to an RSS Feed in MongoDB, each Feed has an ever growing list of Entries. As I'm designing my schema, I'm concerned about this statement from the MongoDB Schema Design - Embed vs. Reference Documentation:

If the amount of data to embed is huge (many megabytes), you may read the limit on size of a single object.

This will surely happen if I understand the statement correctly. So the question is, I am correct to assume that I should not embed the Feed Entries within a Feed because I'll eventually reach the limit on size of a single object?

+2  A: 

In designing your schema, you should be cognizant of the 4MB size limit on a single document in Mongo.

SERVER-431 states:

the 4mb limit isn't a hard limit per se, its easy to change. the reson its there and we really like it is that it keeps performance uniform, lets drivers make some assumption about input to make, and generally prevents really horrible things from happening.

if there is a large consensus that it should change however, we certainly could.

Ryan Cox
That is a very interesting statement, it appears MongoDB is opinionated software. So if I design my schema around those constraints I can learn some conventions for modeling data in MongoDB, to limit the amount of knowlege I need to have about the database engine itself. I like the sound of that. In my case feed entries will have to reference feeds. Thanks for pointing me to this.
Patrick Klingemann