MongoDB Schema Design

Source: Internet
Author: User
Tags mongodb schema design
Document directory
  • Relational vs. documentoriented

Http://www.blogjava.net/czihong/archive/2012/02/18/370250.html, schema design for MongoDB

Http://docs.mongodb.org/manual/core/data-modeling/, Data Modeling considerations for MongoDB applications

 

MongoDB schema design, http://www.slideshare.net/kbanker/mongodb-schema-design

Http://www.slideshare.net/jetlore/mongodb-schema-design-insights-and-tradeoffs-jetlore-mongosf-2012? Ref = http://www.10gen.com/presentations/mongodb-schema-design-insights-and-tradeoffs, MongoDB Schema Design: insights and tradeoffs (jetlore's talk at least SF 2012)

Http://www.slideshare.net/mongodb/schema-design-short? From = ss_embed, MongoDB schema design basic

 

For the schema design of apsaradb for MongoDB, the above three slides are clear.
In fact, it is relatively simple.

Relational vs. documentoriented

Advantages of DOC-oriented Schema

• Avoid joins
• Disk locality when fetching relations (everything is stored within a doc record)
• Schema-less Design

 

One-to-multiple problem

Essentially, 1 and 2 are the same design, but 2 adds nesting, from the original array structure to the tree structure.
3. It is actually a design similar to RDB and should not be used frequently. Although flexible, the Read efficiency should be relatively low.

 

Many-to-many problems

 

The second alternative solution reduces the storage space because the corresponding products_id is not stored in the category.
As tradeoff, when querying the products corresponding to category, it is very troublesome to traverse the product.

 

MongoDB Schema Design vs. hbase Schema Design (hbase-TDG Schema Design)

Compared with hbase, MongoDB schema design adopts denormalization to avoid join.
However, MongoDB is simpler,
Document is more expressive and easier to design.
There is no difference between MongoDB index and MySQL. They both use B-tree, so they are more familiar with it. hbase index mechanism is LSM-tree, especially when secondary index is required.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.