Your SlideShare is downloading. ×
Technical Introduction to MongoDB
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Technical Introduction to MongoDB

2,028
views

Published on

Presented at http://www.meetup.com/emerging-business-technology/events/60978812/

Presented at http://www.meetup.com/emerging-business-technology/events/60978812/


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,028
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 1
  • 2. Today‟s Talk• 10gen• MongoDB• Real World Applications / Use Cases• Community 2
  • 3. 10gen• 10gen began the MongoDB project• Development, support, and services• ~125 employees• New York, Palo Alto, London, Dublin• $31M+ funding (last round, Sept 2011)• Investors: Sequoia, Flybridge, Union Square 3
  • 4. MongoDBMongoDB is a scalable, high-performanceopen source NoSQL database • Document-Oriented Storage • Replication and High Availability • Auto-Sharding • Fast In-Place updates • Ad-hoc Querying • Full index support • Map/Reduce
  • 5. Database Landscape MemcachedScalability & Performance Key / Value RDBMS Depth of functionality
  • 6. What‟s a document anyway?doc ={ author : "roger", date : "Sat Jul 24 2010 19:47:11 GMT-0700 (PDT)", text : "Spirited Away", tags : [ "Tezuka", "Manga" ], comments : [ { author : "Fred", date : "Sat Jul 24 2010 20:51:03 GMT-0700 (PDT)", text : "Best Movie Ever" } ]}
  • 7. Atomic Updates• $set, $unset, $inc, $push, $pull, …> comment = { author: “john”, date: new Date(), text: “I didn„t like it so much”}> db.posts.update( { _id: doc._id }, $push: {comments: comment} );
  • 8. Querying // find posts tagged with Manga > db.posts.find( {tags: “Manga”} ) // find posts commented on by Fred > db.posts.find( {“comments.author” : “Fred” } ) // Aggregation > db.posts.find( {author: „roger‟} ).count()
  • 9. Query Operators• Conditional Operators • $all, $exists, $mod, $ne, $in, $nin, $nor, $or, $size, $type • $lt, $lte, $gt, $gte > db.posts.find({tags : {$in : [“Manga”, “animation}]})• Regular expressions > db.posts.find({author: /^r/})
  • 10. Indexes // Index nested documents > db.posts.ensureIndex( “comments.author”:1 )  db.posts.find({„comments.author‟:‟Fred‟}) // Index on tags > db.posts.ensureIndex( tags: 1) > db.posts.find( { tags: ‟Manga‟ } )
  • 11. Replica Sets Write Primary Read Asynchronous Secondary Replication Read Secondary Read
  • 12. Replica Sets Write Primary Read Secondary Read Secondary Read
  • 13. Replica Sets Primary Automatic Leader Election Write Primary Read Secondary Read
  • 14. Replica Sets Secondary Read Write Primary Read Secondary Read
  • 15. Write Read MongoS MongoS MongoS MongoS Key Range Key Range Key Range Key Range -∞..n1, n6..n7 n1..n2, n7..n8 n3..n4, n8..n9 n5..n6, n9..∞ Primary Primary Primary PrimarySecondary Secondary Secondary SecondarySecondary Secondary Secondary Secondary
  • 16. MongoDB Use Cases Content Analytics E-Commerce Management Advertising Gaming Social Network
  • 17. Community• MongoDB Days • 23+ MongoDB Days reaching over 10,000 people annually • MongoNYC May 23rd • MongoBoston in Fall• MongoDB User Groups • 28 cities with MUGs • Join Boston MUG • http://bit.ly/BostonMUG• User Forum • http://bit.ly/mongodb-user • 15,000+ questions answered• Office Hours • Coming soon… Suggestions? 17