4

I understand the difference between embedded and referenced relationships in mongodb. By why do you need them in the first place?

say
  • 2,585
  • 7
  • 35
  • 48

3 Answers3

5

MongoDB documentation has a section on this including a discussion on "why would I not want to embed this object?"

http://www.mongodb.org/display/DOCS/Schema+Design

Sometimes it's a question of the maintenance effort required to embed copies in each document, sometimes it's simply impossible to embed because of the limits on document sizes.

Ian Mercer
  • 38,490
  • 8
  • 97
  • 133
1

This question is really being asked ten times a day on IRC and various mailing lists. It's documented in depth on the MongoDB site (see above), various blog postings and talks and presentations. Basic research appreciated.

http://www.10gen.com/presentations

In addition: various SO postings deal with that:

MongoDB Schema Design - New Collection or Reference?

Mongodb schema design

MongoDB Schema Design - Many small documents or fewer large documents?

mongodb schema design for blogs

Community
  • 1
  • 1
1

As well as the 10gen resources this is a really great intro to MongoDB, the little MongoDB book is an excellent & quick read along with the interactive guides.

http://mongly.com/

DoodleWalker
  • 289
  • 3
  • 8