mongodb – separate document vs. embedded document

  • no big difference for insert and update
  • So, separate collections are good if you need to select individual documents, need more control over querying, or have huge documents.

    Embedded documents are good when you want the entire document, the document with a $slice of comments, or with no comments at all.

  • As a general rule, if you have a lot of “comments” or if they are large, a separate collection might be best.

    Smaller and/or fewer documents tend to be a natural fit for embedding.

  • http://openmymind.net/Multiple-Collections-Versus-Embedded-Documents/
Advertisements
This entry was posted in DB. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s