MongoDB at CodeMash 2.0.1.0
Upcoming SlideShare
Loading in...5
×
 

MongoDB at CodeMash 2.0.1.0

on

  • 4,578 views

Presentation on MongoDB from CodeMash 2010 in Sandusky

Presentation on MongoDB from CodeMash 2010 in Sandusky

Statistics

Views

Total Views
4,578
Views on SlideShare
4,179
Embed Views
399

Actions

Likes
5
Downloads
101
Comments
0

15 Embeds 399

http://nosql.mypopescu.com 350
http://www.slideshare.net 15
http://teamco-anthill.blogspot.com 13
http://teamco-anthill.blogspot.in 6
http://teamco-anthill.blogspot.fr 2
http://teamco-anthill.blogspot.hu 2
http://teamco-anthill.blogspot.sk 2
http://teamco-anthill.blogspot.com.br 2
http://webcache.googleusercontent.com 1
http://teamco-anthill.blogspot.jp 1
http://teamco-anthill.blogspot.cz 1
http://teamco-anthill.blogspot.de 1
http://teamco-anthill.blogspot.it 1
http://teamco-anthill.blogspot.ch 1
http://teamco-anthill.blogspot.co.uk 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Collection (logical groupings of documents) <br /> Indexes are per-collection
  • blog post <br /> twitter

MongoDB at CodeMash 2.0.1.0 MongoDB at CodeMash 2.0.1.0 Presentation Transcript

  • open-source, high-performance, schema-free, document-oriented database
  • One-Size-Fits-All No Longer RDBMS (Oracle, MySQL) Non-relational New gen. OLAP (vertica, aster, greenplum) operational stores (“NoSQL”)
  • NoSQL really means: non-relational next generation operational datastores and databases
  • Scaling out no joins + light transactional semantics = horizontally scalable architectures
  • Data models no joins + light transactional semantics = horizontally scalable architectures important side effect : new data models = improved ways to develop applications
  • Data Models Key/Value Tabular Document-based
  • Data Models Key/Value memcached, dynamo, voldemort Tabular bigtable, cassandra, hbase, hypertable Document-oriented mongodb, couchdb. JSON stores
  • JSON-style documents
  • Schema-free • Loosening constraints - added flexibility • Dynamically typed languages • Migrations
  • Dynamic queries • Administration • Ease of development • Familiarity
  • Focus on performance
  • Replication
  • Auto-sharding
  • Many supported platforms / languages
  • Good at • The web • Caching • High volume data • Scalability
  • Less good at • Highly transactional • Ad-hoc business intelligence • Problems that require SQL
  • MongoDB Basics
  • Document • Unit of storage (think row) • BSON (Binary JSON) • Represented is language dependent
  • Collection • Schema-free equivalent of a table • Logical groups of documents • Indexes are per-collection
  • _id • Special key • Present in all documents • Unique across a Collection • Any type you want
  • Blog back-end
  • Post {author: “mike”, date: new Date(), text: “my blog post...”, tags: [“mongodb”, “codemash”]}
  • Comment {author: “eliot”, date: new Date(), text: “great post!”}
  • New post post = {author: “mike”, date: new Date(), text: “my blog post...”, tags: [“mongodb”, “codemash”]} db.posts.save(post)
  • Embedding a comment c = {author: “eliot”, date: new Date(), text: “great post!”} db.posts.update({_id: post._id}, {$push: {comments: c}})
  • Posts by author db.posts.find({author: “mike”})
  • Last 10 posts db.posts.find() .sort({date: -1}) .limit(10)
  • Posts in the last week last_week = new Date(2010, 0, 6) db.posts.find({date: {$gt: last_week}})
  • Posts ending with ‘Mash’ db.posts.find({text: /Mash$/})
  • Posts with a tag db.posts.find({tags: “mongodb”}) ... and fast db.posts.ensureIndex({tags: 1})
  • Counting posts db.posts.count() db.posts.find({author: “mike”}).count()
  • Basic paging page = 2 page_size = 15 db.posts.find().limit(page_size) .skip(page * page_size)
  • Migration: adding titles • Easy - just start adding them: post = {author: “mike”, date: new Date(), text: “another blog post...”, tags: [“codemash”], title: “Review from CodeMash”} post_id = db.posts.save(post)
  • Advanced queries • $gt, $lt, $gte, $lte, $ne, $all, $in, $nin • where() db.posts.find({$where: “this.author == ‘mike’”})
  • Other cool stuff • Aggregation and map reduce • Capped collections • Unique indexes • Mongo shell • GridFS
  • • Download MongoDB http://www.mongodb.org • Try it out • Let us know what you think!
  • • http://www.mongodb.org • irc.freenode.net#mongodb • mongodb-user on google groups • @mongodb, @mdirolf • mike@10gen.com • http://www.slideshare.net/mdirolf