Data Modeling for MongoDB

4星(超过85%的资源)
所需积分/C币:19 2014-07-27 23:45:56 17.19MB PDF
12
收藏 收藏
举报

MongoDB建模方法和技巧,到底是文档嵌套还是应用,看看就知道了!
Technics Published b Technics Publications LLC 2 Lindsley road Basking ridge NJ07920 USA Publications http://www.technicsPub.com Cover design by Mark Brye Edited by Carol Lehn and erin elizabeth long Technical reviews by rob Garrison and Richard Kreuter All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording or by any information storage and retrieval system. without written permission from the publisher except for the inclusion of brief quotations in a review The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no for errors or omissions ne liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein Mongodb is a registered trademark of mongoDB, Inc. All other trademarks are property of their respective owners and should be treated as such Copyright o 2014 by Technics Publications, LLC ISBN, print ed.978-1-935504-70-2 ISBN, e Pub ec.978-1935504-71-9 first Printing 2014 Library of Congress Control Number: 2014938921 o my brother, Gary, who is not only an impressive techno-wiz and C1O, but also knows how to apply technology to make amazing things happen Table of contents Foreword By Ryan Smith, Information Architect at Nike Introduction Conventions Used in This book Section I Getting Started Chapter I The Power of data Modeling Many Forms to represent an Information Landscape Confirming and Documenting Different Perspectives Data Mode ling Is Not Optional! Embarking on Our Publishing Adventure EXERCISE 1: Life Without Data Modeling Chapter 2 The Power of nosol and MongoDB NOSQL VS the Traditional Relational Database Four Types of nosQl Databases MongoDB Is a Document-Oriented NosQL Database Installing MongoDB Chapter 3 MongoDB Objects Entities Attributes Domains Relationships Keys Chapter 4 MongoDB Functionality Adding Data in MongoDB Querying Data in MongoDB Updating Data in Mongo DB Deleting data in MongoDB EXERCISE 4: Mongo db functionality Section ll levels of granularity Chapter 5 Conceptual Data Modeling Concept Explanation Conceptual Data Mode ling Approach EXERCISE 5: Conceptual Data Modeling Mindset Chapter 6 Logical Data Modeling Logical Data Modeling Approach EXERCISE 6: Logical Data Mode ling mindset Chapter 7 Physical Data Modeling Physical Data Modeling approach Section I Case Study Chapter Survey Data Entry Case Study background Conceptual Data Mode ling Logical Data Modeling Physical Data Modeling APPENDIX A AnSwers to Exercises EXERCISE 1: Life without data modeling? EXERCISE 2: Subtyping in MongoDB EXERCISE 3: Interpreting Queries EXERCISE 4: MongoDB Functionality EXERCISE 5: Conceptual Data Modeling mindset EXERCISE 6: Logical Data Mode ling mindset EXERCISE 7: Embed or Reference APPENDIX B References APPENDIX C Glossar Index Foreword By ryan smith, Information Architect at Nike How do you design for a database platform w hich doesnt require design? Should you design your data at all, or just start building? Id like to think i have a somew hat unique perspective on this, working at Nike where I have a front row seat to world class product design and innovation Perspectives vary on the importance of designing data these days. Traditional databases fundamentally force a certain level of design, to define the structure of your information before content can be inserted But many NosQl databases will accept whatever data format you throw at them, and you can completely change that format from one record to the next. So in theory you dont need to have a plan for your data at all I strongly believe that you need to have a plan. Designing your data brings clarity. It exposes what you do and dont know about it, and what confusion may exist about it within your team and organization. Designing data is an essential form of leadership charting a course and testing ideas, bringing forward a clear story while being open to changing it based on new learning Most importantly design is about understanding the consumer, knowing what audiences will be using the system and what they need the data to do for them. Data modeling can greatly accelerate development, improve the quality of the end product, reduce maintenance costs, and multiply the value of what has been built by establishing a common understanding of the information In many ways up-front data design with NoSQL databases can actually be more important than it is with traditional relational databases. For example, since many of these databases dont join data sets, their fast-retrieval performance potential excels only if the collections you've created contain all or most of the information required by a given request. If you have to retrieve a large percentage of your database content in order to scan and filter it down to a relevant result set, you would have been better off writing SQL to join tables within a relational database. But as I have seen in my experience, good data design practices can lead to excellent performance Beyond the performance topic, NosQL databases with flexible schema capabilities similarly require more discipline in aligning to a common information model. For example, MongoDB would not hesitate to allow you to sequentially save four records in the same collection with field names of: zipCode, zipcode, Zip Code, and postalCode respectively. Each of these variations will be treated as a new field, with no warnings given. Everything will work great until you ask for your zip Code values back and only one document out of four has a field by that name The flexible schema is a great innovation for quick evolution of your data model, and yet it requires discipline to harvest the benefits without experiencing major data quality issues and other frustrations as a result Data modeling is essential for success, but it's not rocket science, and with this book it is easier than ever to implement effectively. Written by an exceptional teacher of data modeling, these chapters clearly explain the process needed to navigate these new capabilities with confidence. Anyone who has taken Steves Data Modeling Master Class can attest to his passion for both data and teaching. In reading the manuscript, it was immediately evident to me that his gift for teaching is here in his writing every bit as much as when he presents in person Steve carefully crafts his explanations so that even the more abstract concepts can be easily grasped and internalized. Steve's broad consulting experience also shows through. Seth godin states in his book linchpin that there is a"thrashing,process inherent in the creation of any product, meaning the brainstorming and iteration of different ideas and approaches. He writes, Thrashing is essential. The question is: when to thrash? In the typical amateur project, all the thrashing is near the end... Professional creators thrash early. Anyone who has found themselves at the tail end of a poorly-executed project knows all about late thrashing. Early and ongoing modeling adds tremendous value, no matter how agnle your methodology. Steve's book is about how to work through uncertainties like a professional, so you can evolve your data models over time without devolving into chaos May your data models provide calm and clarity which allow your work to thrive, so that you can focus on what matters most: your team, your objectives, and your consumers Introduction Congratulations! You completed the MongoDB application within the given tight timeframe, and there is a party to celebrate your applications release into production. Although people are congratulating you at the celebration, you are feeling some uneasiness inside. To complete the project on time required making a lot of assumptions about the data such as what terms meant and how calculations were derived. In addition. the poor documentation about the application will be of limited use to the support team, and not investigating all of the inherent rules in the data may eventually lead to poorly performing structures in the not-SO-distant future Now, what if you had a time machine and could go back and read this book before starting the project. You would learn that even nosql databases like MongodB require some level of data modeling Data modeling is the process of learning about the data. and regardless of technology, this process must be pe rformed for a success application. You would learn the value of conceptual, logical, and physical data modeling and how each stage increases our knowledge of the data and reduces assumptions and poor design decisions Read this book to learn how to do data modeling for MongoDB applications and accomplish these five objectives 1. Understand how data modeling contributes to the process of learning about the data and is, therefore, a required technique even when the resulting database is not relational. That is, NOSOL does not mean NoDataModeling 2. Know how NoSQL databases differ from traditional relational databases and where Mongodb fits 3. Explore each Mongodb object and comprehend how each compares to its data modeling and traditional relational database counterparts, as well as learn the basics of adding, querying, updating, and deleting data in MongoDB 4. Practice a streamlined, template-driven approach to performing conceptual logical, and physical data modeling. Recognize that data modeling does not always have to lead to traditional data models 5. Know the difference between top-down and bottom-up data modeling approaches and complete a top-down case study This book is written for anyone who is working with, or will be working with MongoDB including business analysts, data modelers, database administrators developers, project managers, and data scientists. There are three sections In Section I, Getting Started, we will reveal the power of data modeling and the important connections to data models that exist when designing any type of database(Chapter 1); compare NosQL with traditional relational databases and find where MongoDB fits( Chapter 2); explore each MongoDB object and comprehend how each compares to its data modeling and traditional relational database counterparts( Chapter 3); and explain the basics of addi n eryin updating, and deleting data in Mongo DB( Chapter 4) I n Section Il, Levels of granularity, we cover Conceptual Data Modeling Chapter 5), Logical Data Modeling(Chapter 6), and Physical Data Modeling Chapter 7). Notice the"ing at the end of each of these chapters. We focus on the process of building each of these models, which is where we gain essential business knowled I n Section Ill, Case Study, we will explain both top-down and bottom-up development approaches and complete a top -down case study where we start with conceptual data modeling and end with a mongodB database. This case study will tie together the conceptual, logical, and physical techniques from Section II Key points are included at the end of each chapter as a way to reinforce concepts. In addition this book is loaded with hands-on exercises along with their answers which are provided in Appendix a. Appendix b contains all of the book's references, and Appendix c contains a glossary of the terms used throughout the text. There is also a comprehensive index. CONVENTIONS USED IN THIS BOOK We will use the shortcut RDBMS for Relational Database Management System RDBMs represents the traditional relational database invented by e f. Codd at IBM in 1970 and first commercially available in 1979(which was Oracle)[wikipedia]. Popular rDbms databases today include Oracle, Sybase, Microsoft SQL Server, and Teradata We use the embarcadero ER studio data architect tool to build our data models throughout the text. Learn more about this tool at this website http://www.embarcadero.com/products/er-studio-data-architect. There is an important distinction between the term relational database and the term

...展开详情
试读 127P Data Modeling for MongoDB
立即下载
限时抽奖 低至0.43元/次
身份认证后 购VIP低至7折
一个资源只可评论一次,评论内容不能少于5个字
wxw01234 你看这本书他又薄又方
2019-03-16
回复
糊涂boy 书还是不错的。
2017-05-31
回复
bright002 非常不错的资源,感谢分享
2017-02-05
回复
caidezhi2006081013 非常不错的资源,感谢分享
2016-08-01
回复
fate1982 It made my life of learning mongodb absolutely easy, going through the lesson step by step ease the learning curve!
2016-05-17
回复
shuji2010 不错的资料。如果有中文版的就更好了!
2016-03-29
回复
u010047434 不知道 mongodb 怎样支撑 基于大量doc和xls文件内数据的大数据分析
2016-03-10
回复
dfch84 不错的资料。如果有中文版的就更好了!
2016-02-27
回复
leoling2 可以的 宏观的简介
2015-09-20
回复
ikaliZpeet 分析有见地, 不适合初学者。
2015-09-08
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
Data Modeling for MongoDB 19积分/C币 立即下载
1/127
Data Modeling for MongoDB第1页
Data Modeling for MongoDB第2页
Data Modeling for MongoDB第3页
Data Modeling for MongoDB第4页
Data Modeling for MongoDB第5页
Data Modeling for MongoDB第6页
Data Modeling for MongoDB第7页
Data Modeling for MongoDB第8页
Data Modeling for MongoDB第9页
Data Modeling for MongoDB第10页
Data Modeling for MongoDB第11页
Data Modeling for MongoDB第12页
Data Modeling for MongoDB第13页
Data Modeling for MongoDB第14页
Data Modeling for MongoDB第15页
Data Modeling for MongoDB第16页
Data Modeling for MongoDB第17页
Data Modeling for MongoDB第18页
Data Modeling for MongoDB第19页
Data Modeling for MongoDB第20页

试读结束, 可继续阅读

19积分/C币 立即下载