MongoDB
Upcoming SlideShare
Loading in...5
×
 

MongoDB

on

  • 2,085 views

A brief intro to MongDB.

A brief intro to MongDB.

Statistics

Views

Total Views
2,085
Views on SlideShare
2,084
Embed Views
1

Actions

Likes
2
Downloads
87
Comments
0

1 Embed 1

http://www.docshut.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

MongoDB MongoDB Presentation Transcript

  • MongoDB By Rony Abraham Gregory Model Engineering College
  • What is MongoDB?• Humongous (huge + monstrous)• Document Database• Schema free• C++• Open Source
  • 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! View slide
  • Database Paradigms• Relational (RDBMS)• NoSQL oKey-value stores oDocument databases oWide column stores (BigTable and clones) oGraph databases View slide
  • Relational Databases• ACID (Atomicity Consistency Isolation and Durability)• SQL• MySQL, PostgreSQL, Oracle, etc.
  • 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.
  • Key-value stores Fig: A key-value store
  • 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.
  • Document databases Fig: A document database
  • Why NoSQL?• Schema-free• Massive data stores• Scalability• Some services simpler to implement than using RDBMS• Great fit for many Web 2.0 applications
  • 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”
  • 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
  • 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
  • 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
  • Features• Standard database stuff • Indexing • Replication/failover support
  • 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
  • Features• Schema-less; very flexible• Auto-sharding (alpha)• Makes for easy horizontal; scaling• Map/Reduce
  • Features• Very, very fast• Super easy to install• Strong with major languages
  • 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)
  • Features: Official Drivers• .NET, Java, JavaScript, Ruby, Node.js, PH P, Haskell, C/C++, Perl
  • Concepts: Document-Oriented• Think of “documents” as objects/database records• Documents are basically just JSON in binary• Ability to store information all together
  • Concepts: Document-Oriented
  • Concepts: Document-Oriented Concept Mapping
  • 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
  • Concepts: Cursors• The find() function returns a cursor object
  • Basic Operations• Insert• Find• Update• Remove• ensureIndex
  • Basic Operations• Insertdb.test.insert({hello:’world’});• Find oEquivalent of Select * FROM test;
  • Basic Operations:Updatedb.test.update(<condition>,<operation>)
  • Basic Operations: Removedb.test.remove(<condition>)
  • 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})
  • MongoDB in action!
  • 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