Your SlideShare is downloading. ×
A few questions on 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

A few questions on MongoDB

1,074

Published on

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

  • Be the first to like this

No Downloads
Views
Total Views
1,074
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
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. @ IPRUG "It is a scalable, high-performance, open source, Document-oriented database. Written in C++” What is mongoDB?
  • 2. @ IPRUG What is a Document Oriented Database?
  • 3. @ IPRUG {"IPRUG": { "tagline": "The source of all things Ruby in Suffolk", "website": "http://www.iprug.org", "members": [ {"name": "MrJaba", "role": "foolhardy organizer", "presentations" : ["higher order ruby", "websockets"]}, {"name": "KerryB", "role": "foolhardy presenter"} ] } } A Document
  • 4. @ IPRUG 1. Install Daemon Download and install the mongod - the database daemon itself 2. Install Driver gem install mongo gem install bson_ext (optional for extra performance) How do you use it? Part 1.
  • 5. @ IPRUG How do you use it? Part 2. 1. Connect: db = Mongo::Connection.new.db("mydb") 2. Insert a document: coll = db.collection("RUGS") iprug = { "IPRUG" => {"tagline" => "The source of all things Ruby in Suffolk", "website" => "iprug.org" } } coll.insert(iprug)
  • 6. @ IPRUG How do you use it? Part 3.3. Updating: iprug["tagline"] = "Suffolk haz Ruby!" coll.update({"_id" => iprug["_id"]}, iprug)
  • 7. @ IPRUG How do you use it? Part 4.4. Find all: coll.find() 5. Conditions: coll.find("tagline" => "Suffolk haz Ruby!") 6. Range Queries: coll.find("value" => {"$gt" => 20, "$lte" => 30}) 7. Regex queries: coll.find( {"tagline" => /^Suffolk/} )
  • 8. @ IPRUG ORM Tools? * MongoMapper * Mongoid * Mongomatic * MongoDoc * MongoModel * Candy
  • 9. @ IPRUG Is it In Memory?
  • 10. @ IPRUG Can it be written to disk?
  • 11. @ IPRUG What if my server crashes?
  • 12. @ IPRUG So I'm going to lose all my data?
  • 13. @ IPRUG What about Replication?
  • 14. @ IPRUG Insert Rows/Sec: 2,376 Retrieve Row/Sec: 1,047 Find All/Sec: 3,458 What about Performance?
  • 15. @ IPRUG Why would I use this over MySql?
  • 16. @ IPRUG Why Wouldn't I use MongoDb?
  • 17. @ IPRUG References Durability: http://www.mikealrogers.com/2010/07/mongodb-performance-durability/ Their Rebuttal: http://blog.mongodb.org/post/381927266/what-about-durability Durability Guide: http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/ Performance: http://www.eggheadcafe.com/tutorials/aspnet/6f573869-c8eb-40c3-9946-2f61e0163966/mongodb-vs-sql-server-basic-speed-tests.aspx http://prajwal-tuladhar.net.np/2009/11/15/500/mongodbs-performance-as-compared-to-others-esp-couchdb/ NoSQL Overview: http://bjclark.me/2009/08/nosql-if-only-it-was-that-easy/

×