0
@ IPRUG
"It is a scalable, high-performance, open source,
Document-oriented database. Written in C++”
What is mongoDB?
@ IPRUG
What is a Document
Oriented Database?
@ IPRUG
{"IPRUG": {
"tagline": "The source of all things Ruby in Suffolk",
"website": "http://www.iprug.org",
"members": [...
@ IPRUG
1. Install Daemon
Download and install the mongod - the database daemon itself
2. Install Driver
gem install mongo...
@ IPRUG
How do you use it? Part
2.
1. Connect:
db = Mongo::Connection.new.db("mydb")
2. Insert a document:
coll = db.colle...
@ IPRUG
How do you use it? Part
3.3. Updating:
iprug["tagline"] = "Suffolk haz Ruby!"
coll.update({"_id" => iprug["_id"]},...
@ IPRUG
How do you use it? Part
4.4. Find all:
coll.find()
5. Conditions:
coll.find("tagline" => "Suffolk haz Ruby!")
6. R...
@ IPRUG
ORM Tools?
* MongoMapper
* Mongoid
* Mongomatic
* MongoDoc
* MongoModel
* Candy
@ IPRUG
Is it In
Memory?
@ IPRUG
Can it be
written to disk?
@ IPRUG
What if my server
crashes?
@ IPRUG
So I'm going to lose all
my data?
@ IPRUG
What about Replication?
@ IPRUG
Insert Rows/Sec: 2,376
Retrieve Row/Sec: 1,047
Find All/Sec: 3,458
What about
Performance?
@ IPRUG
Why would I use this
over MySql?
@ IPRUG
Why Wouldn't I use MongoDb?
@ IPRUG
References
Durability:
http://www.mikealrogers.com/2010/07/mongodb-performance-durability/
Their Rebuttal:
http://...
Upcoming SlideShare
Loading in...5
×

A few questions on MongoDB

1,112

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,112
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "A few questions on MongoDB"

  1. 1. @ IPRUG "It is a scalable, high-performance, open source, Document-oriented database. Written in C++” What is mongoDB?
  2. 2. @ IPRUG What is a Document Oriented Database?
  3. 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. 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. 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. 6. @ IPRUG How do you use it? Part 3.3. Updating: iprug["tagline"] = "Suffolk haz Ruby!" coll.update({"_id" => iprug["_id"]}, iprug)
  7. 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. 8. @ IPRUG ORM Tools? * MongoMapper * Mongoid * Mongomatic * MongoDoc * MongoModel * Candy
  9. 9. @ IPRUG Is it In Memory?
  10. 10. @ IPRUG Can it be written to disk?
  11. 11. @ IPRUG What if my server crashes?
  12. 12. @ IPRUG So I'm going to lose all my data?
  13. 13. @ IPRUG What about Replication?
  14. 14. @ IPRUG Insert Rows/Sec: 2,376 Retrieve Row/Sec: 1,047 Find All/Sec: 3,458 What about Performance?
  15. 15. @ IPRUG Why would I use this over MySql?
  16. 16. @ IPRUG Why Wouldn't I use MongoDb?
  17. 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/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×