Your SlideShare is downloading. ×
0
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
MongoDB
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

MongoDB

2,062

Published on

A brief intro to MongDB.

A brief intro to MongDB.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,062
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
128
Comments
0
Likes
2
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. MongoDB By Rony Abraham Gregory Model Engineering College
  • 2. What is MongoDB?• Humongous (huge + monstrous)• Document Database• Schema free• C++• Open Source
  • 3. What is MongoDB?• GNU AGPL v3.0 Licence• OSX, Linux, Windows, Solaris | 32 bit, 64 bit• Development and Support by 10gen and was first released in February 2009• NoSQL!
  • 4. Database Paradigms• Relational (RDBMS)• NoSQL oKey-value stores oDocument databases oWide column stores (BigTable and clones) oGraph databases
  • 5. Relational Databases• ACID (Atomicity Consistency Isolation and Durability)• SQL• MySQL, PostgreSQL, Oracle, etc.
  • 6. Key-value stores• “One key, one value, no duplicates and very fast”• It’s a Hash!• The value is a binary object aka “blob” – the DB doesn’t understand it and doesn’t want to understand it.• Amazon Dynamo, MemcacheDB, etc.
  • 7. Key-value stores Fig: A key-value store
  • 8. Document databases• Key-value stores, but the value is (usually) structured and “understood” by the DB.• Querying data is possible (by means other than just a key).• Amazon SimpleDB, CouchDB, MongoDB, Riak, e tc.
  • 9. Document databases Fig: A document database
  • 10. Why NoSQL?• Schema-free• Massive data stores• Scalability• Some services simpler to implement than using RDBMS• Great fit for many Web 2.0 applications
  • 11. Why NOT NoSQL?• RDBMSes and its tools are mature• NoSQL implementations are often in their “alpha” state• Data consistency, transactions• “Don’t scale until you need it”
  • 12. RDBMS vs NoSQL• Strong consistency vs Eventual consistency• Big dataset vs HUGE dataset• Scaling is possible vs Scaling is easy• Good availability vs Very high availability
  • 13. RDBMS vs NoSQL• Strong consistency vs Eventual consistency• Big dataset vs HUGE dataset• Scaling is possible vs Scaling is easy• Good availability vs Very high availability
  • 14. RDBMS vs NoSQL• Strong consistency vs Eventual consistency• Big dataset vs HUGE dataset• Scaling is possible vs Scaling is easy• Good availability vs Very high availability
  • 15. Features• Standard database stuff • Indexing • Replication/failover support
  • 16. Features• Documents are stored in BSON (JSON)• BSON is a Binary serialization of JSON- like objects• This is extremely powerful, because it means mongoDB understands JSON natively• Any valid JSON can be easily imported and queried
  • 17. Features• Schema-less; very flexible• Auto-sharding (alpha)• Makes for easy horizontal; scaling• Map/Reduce
  • 18. Features• Very, very fast• Super easy to install• Strong with major languages
  • 19. Features: Querying• Rich, JavaScript based query syntax• Allows us to do deep, nested queriesdb.order.find( {shipping: { carrier:”usps” }} ); shipping is an embedded document (object)
  • 20. Features: Official Drivers• .NET, Java, JavaScript, Ruby, Node.js, PH P, Haskell, C/C++, Perl
  • 21. Concepts: Document-Oriented• Think of “documents” as objects/database records• Documents are basically just JSON in binary• Ability to store information all together
  • 22. Concepts: Document-Oriented
  • 23. Concepts: Document-Oriented Concept Mapping
  • 24. Concepts: Cursors• Queries return “cursors” instead of collections • A cursor allows you to iterate through the result set • A big reason for this is performance • Much more efficient than loading all objects into memory
  • 25. Concepts: Cursors• The find() function returns a cursor object
  • 26. Basic Operations• Insert• Find• Update• Remove• ensureIndex
  • 27. Basic Operations• Insertdb.test.insert({hello:’world’});• Find oEquivalent of Select * FROM test;
  • 28. Basic Operations:Updatedb.test.update(<condition>,<operation>)
  • 29. Basic Operations: Removedb.test.remove(<condition>)
  • 30. Basic Operations: Indexing• Its usually a good idea to index collections• How and which columns depend on what is to be donedb.test.ensureIndex({hello:I})
  • 31. MongoDB in action!
  • 32. References• MongoDB home at http://www.mongodb.org• MongoDB - The Definitive Guide by Kristina Chodorow and Dirolf• NoSQL Paper at http://wiki.hsr.ch/Datenbanken/files/Weber_NoSQL_ Paper.pdf• Why MongoDB is awesome at http://www.slideshare.net/jnunemaker/why- mongodb-is-awesome• MongoDB wiki at http://en.wikipedia.org/wiki/MongoDB

×