无论你正在搭建一个社交媒体网站还是一个内部使用的企业应用,《MongoDB设计模式(影印版)》这本注重实践的指南都可以为你展示出在MongoDB和它所用来解决的商业问题之间的紧密联系。你将学习如何把MongoDB设计模式应用到多个具有挑战性的领域中,比如电子商务、内容管理和在线游戏。通过使用 Python和JayaScript的代码实例,你将了解MongoDB 是如何让你在调整数据模型的同时简化开发流程。很多商业应用在还没有理解如何更有效地使用NoSQL数据库之前就直接启用了它。这本《MongoDB设计模式( 影印版)》(作者科普兰)将为你演示文档嵌入、多态性架构和其他处理特定大数据用例的MongoDB模式的优势所在,包括:营运智能:执行商业数据的实时分析。电子商务:让MongoDB成为产品目录大师或者库存管理系统。内容管理:学习用来存储内容节点、二元资产和讨论区的方法。在线广告网络:把技术运用于广告播放的频次控制、关键字定位和竞价。社交网络:学习如何存储一个仿效Google+的复杂社交图。
在线游戏:为一个多人角色扮演游戏提供对人物和世界数据的并发访问。
MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能丰富,像关系数据库的。他支持的数据结构非常松散,是类似json的bson格式,因此可以存储比较复杂的数据类型。 对于新手和那些想要获取更多实践知识的有经验用户来说,《MongoDB设计模式(影印版)》(作者科普兰)都是一本必要的读物。
Preface Part I.Design Patterns 1.To EmbedOrReference Relational Data Modeling and Normalization What Is a Normal Form,Anyway? So What's the Problem? Denormalizing for Performance MongoDB:Wh0 Needs Normalization.Anyway? MongoDB Document Format Embedding for Locality Embedding for Atomicity and Isolation Referencing for Flexibilitv Referencing for Potentially High--Arity Relationships Many-to-Many Relationships Conclusion 2.PolymorphicSchemas Polymorphic Schemas to SuppoObjectOriented Programming Polymorphic Schemas Enable Schema Evolution Storage(In-)Efficiency ofBSON Polymorphic Schemas SuppoSemiStructured Domain Data Conclusion 3.MimickingTransactional Behavior The Relational Approach to Consistency Compound Documents Using Complex Updates Optimistic Update with Compensation Conclusion Partll.UseCases 4.OperationalIntelligence Storing Log Data Solution 0verview Schema Design Operations Sharding Concerns Managing Event Data Growth PreAggregated Reports Solution 0verview Schema Design Operations Sharding Concerns Hierarchical Aggregation Solution Overview Schema Design MapReduce Operations Sharding Concerns 5.Ecommetce Product Catalog Solution Overview Operations Sharding Concerns Category Hierarchy Solution Overview Schema Design Operations Sharding Concerns Inventory Management Solution 0verview Schema Operations Sharding Concerns 6.ContentManagementSystems Metadata and Asset Management Solution Overview Schema Design Operations Sharding Concerns Storing Comments Solution 0verview Approach:One Document per Comment Approach:Embedding All Comments Approach:Hybrid Schema Design Sharding Concerns 7.OnlineAdvertising Networks Solution Overview Design 1:Basic Ad Serving Schema Design Operation:Choose an Ad to Serve Operation:Make an Ad Campaign Inactive Sharding Concerns Design 2:Adding Frequency Capping Schema Design Operation:Choose an Ad to Serve Sharding Design 3:Keyword Targeting Schema Design Operation:Choose a Group ofAds to Serve 8.SociaI Networking Solution Overview Schema Design Independent Collections Dependent Collections Operations Viewing a News Feed or WaU Posts Commenting on a Post Creating a New Post Maintaining the Social Graph Sharding 9.OnlineGaminq. Solution Overview Schema Design Character Schema Rem Schema Locion Schema Operations Load Character Data from MongoDB Extract Armor and Weapon Data for Display Extract Character Attributes,Inventorand Room Information for Display PickUp anItemfrom aRoom Remove an Item from a Container Move the Character to a Different Room Buy an Item Sharding Afterword Index