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.