MongoDB at RuPy

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    Order Preserving Partitioning
    Split
    Migrate

    Server Layout

    blog post
    twitter

    6 Favorites

    MongoDB at RuPy - Presentation Transcript

    1. open-source, high-performance, schema-free, document-oriented database
    2. RDBMS • Great for many applications • Shortcomings • Scalability • Availability • Flexibility
    3. Key-value stores
    4. CouchDB
    5. JSON-style documents
    6. Schema-free • Loosening constraints - added flexibility • Dynamically typed languages (RuPy!) • Migrations
    7. Dynamic queries • Administration • Ease of development • Familiarity
    8. Focus on performance
    9. Replication
    10. Auto-sharding
    11. Many supported platforms / languages
    12. Good at • The web • Caching • High volume data • Scalability
    13. Less good at • Highly transactional • Ad-hoc business intelligence • Problems that require SQL
    14. MongoDB Basics
    15. Document • Unit of storage (think row) • BSON (Binary JSON) • Represented as a dict / Hash
    16. Collection • Schema-free equivalent of a table • Logical groups of documents • Indexes are per-collection
    17. _id • Special key • Present in all documents • Unique across a Collection • Any type you want
    18. Blog back-end
    19. Post {“author”: “mike”, “date”: datetime.datetime.utcnow(), “text”: “my blog post...”, “tags”: [“mongodb”, “python”, “ruby”]}
    20. Comment {“author”: “eliot”, “date”: datetime.datetime.utcnow(), “text”: “great post!”}
    21. New post post = {“author”: “mike”, “date”: datetime.datetime.utcnow(), “text”: “my blog post...”, “tags”: [“mongodb”, “python”, “ruby”]} post_id = db.posts.save(post)
    22. Embedding a comment c = {“author”: “eliot”, “date”: datetime.datetime.utcnow(), “text”: “great post!”} db.posts.update({“_id”: post_id}, {“$push”: {“comments”: c}})
    23. Posts by author db.posts.find({“author”: “mike”})
    24. Last 10 posts query = db.posts.find() .sort(“date”, DESCENDING) .limit(10) for post in query: print post[“text”]
    25. Posts in the last week last_week = datetime.datetime.utcnow() + datetime.timedelta(days=-7) db.posts.find({“date”: {“$gt”: last_week}})
    26. Posts ending with ‘RuPy’ db.posts.find({“text”: re.compile(“RuPy$”)})
    27. Posts with a tag db.posts.find({“tags”: “mongodb”}) ... and fast db.posts.create_index(“tags”)
    28. Counting posts db.posts.count() db.posts.find({“author”: “mike”}).count()
    29. Basic paging page = 2 page_size = 15 db.posts.find().limit(page_size) .skip(page * page_size)
    30. Migration: adding titles • Easy - just start adding them: post = {“author”: “mike”, “date”: datetime.datetime.utcnow(), “text”: “another blog post...”, “tags”: [“conference”, “rupy”], “title”: “Review from RuPy”} post_id = db.posts.save(post)
    31. Advanced queries • $gt, $lt, $gte, $lte, $ne, $all, $in, $nin • where() db.posts.find().where(“this.author==‘mike’ || this.title==‘hello’”) • group()
    32. Other cool stuff • Aggregation and map reduce • Capped collections • Unique indexes • Mongo shell • GridFS • MongoKit, Mongoid, MongoMapper, etc.
    33. Sharding
    34. Terminology • Shard key • Chunk • Range of the value space • (collection, key, min_val, max_val) • Shard • Single node (or replica pair) • Responsible for set of chunks
    35. client
    36. mongos client
    37. Shards mongod mongod mongod ... mongod mongod mongod mongos client
    38. Shards mongod mongod mongod ... mongod mongod mongod mongos mongos ... client
    39. Shards mongod mongod mongod ... Config mongod mongod mongod Servers mongod mongod mongod mongos mongos ... client
    40. • Download MongoDB http://www.mongodb.org • Try it out • Let us know what you think! • Oh, and get stickers!
    41. • http://www.mongodb.org • irc.freenode.net#mongodb • mongodb-user on google groups • @mongodb, @mdirolf • mike@10gen.com • http://www.slideshare.net/mdirolf

    + Mike DirolfMike Dirolf, 3 weeks ago

    custom

    499 views, 6 favs, 0 embeds more stats

    Presentation on MongoDB given at RuPy in November o more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 499
      • 499 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 6
    • Downloads 10
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories