MongoDB Schema Design

來源:互聯網
上載者:User
文章目錄
  • 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

 

http://www.slideshare.net/kbanker/mongodb-schema-design, 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 MongoSF 2012)

http://www.slideshare.net/mongodb/schema-design-short?from=ss_embed, MongoDB Schema Design Basic

 

關於MongoDB的schema設計, 上面3篇ppt講的比較清晰
其實本身也比較簡單.

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

 

一對多問題

本質上講, 1和2是同一種設計, 只不過2中增加了嵌套, 從而是原來的array結構變成tree結構
3, 其實是類似RDB的設計, 應該不常採用, 雖然flexible, 但讀效率應該比較低

 

多對多問題

 

第二種alternative的方案, 減少了儲存空間, 因為在category中沒有儲存相應的products_id
作為tradeoff, 當查詢category對應的products時, 就非常麻煩需要去product裡面去遍曆.

 

MongoDB Schema Design Vs. HBase Schema Design(HBase-TDG Schema Design)

MongoDB Schema設計和HBase的相比, 主題還是Denormalization, 避免join
但是MongoDB的更為簡單,
Document的表達能力更強, 設計的時候更為方便.
MongoDB的index和MySQL沒啥區別, 都是使用B樹, 所以使用起來更熟悉. 而對於HBase索引機制是LSM-tree, 尤其當需要secondary index的比較麻煩

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.