慕课网 《MongoDB 2014北京大会》视频笔记

学习地址:MongoDB 2014北京大会

第一章 MongoDB欢迎致辞及MongoDB简介

General purpose
Document database
Open-source

Create Applications — Never Before Possible

creat_applications

MongoDB Business Value:
- Enabiling New Apps
- BetterCustomer Experience
- Faster Time to Marker
- Lower TCO

What we sell?

  • MongoDB Enterprise Advanced
    Management platform, advanced security, proactive support, and more.
  • MongoDB Management Service(MMS)
    Automated deployment, upgrades, backup and monitoring in the cloud.
  • Production Support
    Support for production deployments.
  • Development Support
    Support, on-demand training and health check for teams in development.
  • Consulting
    Packaged service offerings for critical points in the project lifecycle.
  • Training
    Certification and training in development and ops - online & in-person.

THE LARGEST ECOSYSTEM
- 9,000,000+
MongoDB Downloads
- 250,000+
Online Education Registrants
- 35,000+
MongoDB User Group Members
- 40,000+
MongoDB Management Service(MMS) Users
- 600+
Technology and Services Partners
- 1,000+
Custormers Across All Industries

Document Level Locking
( Coming early 2015 )

pluggable : In-memory, RocksDB, TokuKV, FusionIO
What is the storage engine today?
MMAP & WiredTiger

Automation

第2章 MongoDB模式设计的艺术:该做的与不该做的

The Fine Art of Schema Design: Dos and Don’ts

(Matias Cas callares
Senior Solutions Architect, MongoB Inc.
matias@mongodb.com)

RDBMs

  • Relational databases are made up of tables
  • Tables are made up of rows:

    • All rows have identical structure
    • Each row has the same number of columns
    • Every cell in a column stores the same type of data

    MongoDB is a Document Oriented database

Document Model

  • MongoDB is made up of collections
  • Collections are composed of documents
    • Each document is a set of key-value pairs
    • No predefined schema
    • Keys are always strings
    • Values can be any(supported) data type
    • Values can also be an array
    • Values can also be a document

document inside documents
Benifits of these document model….?

  • Flexibility

    • Each document can have different fields
    • No need of long migrations, easier to be agile
    • Common structure enforced at application level
  • Arrays

    • Documents can have field with array values
    • Ability to query and index array elements
    • We can model relationships with no need of different tables or collections
  • Embedded documents

    • Documents can have field with document values
    • Ability to query and index nested documents
    • Semantic closer to Object Oriented Programming

    Relational Schema Design:
    Focus on data storage.
    Document Schema Design:
    Focus on data usage.

SCHEMA DESIGN IS AN ART

A task tracking app

Requirement #1
“We need to store user information” like name, email and their addresses…yes they can have mort than one.”
—Bill, a project manager, contemporary

Requirement #2
“We have to be able to store tasks, assign them to users and track their progress…”
—Bill, a project manager, contemporary

Embedding tasks

  • Tasks are unbounded items: initially we do not know how many tasks we are going to have
  • A user along time can end with thousands of tasks
  • Maximum document size in MongoDB: 16MB!
  • It is harder to access task information without a user context

Array update operators

  • pop
  • push
  • pull
  • pullAll

Why is expensive to move a document?

  • We need to write the document in another locaion($$)

  • We need to mark the original position as free for new documents($)

  • We need to update all those index entries pointing to the moved document to the new location($$$)

Considerations with arrays

  • Limited number of items
  • Avoid document movements
    • Document movements can be delayed with padding factor
    • Document movement can be mitigated with preallocation

RECIPE #4
USE DATA MODELS THAT MINIMIZE THE NEED FOR DOCUMENT GROWTH

RECIPE #5
DENORMALIZE TO AVOID APP-LEVEL JOINS

RECIPI #6
DENORMALIZE ONLY WHEN YOU HAVE A HIGH READ TO WRITE RATIO

Bucketing
What’s th idea?

  • Reduce number of documents to be retrieved
  • Less documents to retrieve mean less disk seeks
  • Using arrays we can store more than one entity per document
  • We group things that are accessed together
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值