SlideShare a Scribd company logo
Mongo DB
OPEN SOURCE, HIGH PERFORMANCE DATABASE
SEMINAR GUIDE: PRESENTED BY:
MR.M.V.VAIDYA NIKHIL SATISH PADMAWAR
(2012BIT028)
Outlines
 Mongo DB
 Introduction to 10gen
 Hawk eye @MongoDB
 Features
 Document Store
 Comparison
 Collections
 Replication
 Sharding
 CRUD
 NoSQL Type
 CAP Theorem
 Installation Process
10gen is the company behind MongoDB.
Founded in 2007
 Dwight Merriman, Eliot Horowitz
 Doubleclick, Oracle, Marklogic, HP
Worldwide Expanding Team
 140+ employees
 NY, Palo Alto, London, Dublin, Sydney
MongoDB’s Office,Palo Alto,California
Set the direction &
Contribute code to
MongoDB
Foster
Community
&
ecosystem
Provide
commercial
services
Provide MongoDB
management Services
Why MongoDB
 Schema-less
Pain of ‘Alter table’(Wide Application in E-commerce)
 No-Joins
Complexity of Join
 Data Type
Polymorphic data type
ex. A=1 and A=Nanded
 Big Size Limit per Document(16 MB per Doc)
What is MongoDB?
 Data model: Using BSON (binary JSON), developers can easily map to modern object-oriented
languages without a complicated ORM layer.
 ORM
 BSON
Lightweight, Traversable, Efficient.
MongoDB is the leading NoSql Solution
On In deed's Fastest Growing Jobs
Google Searches
Jasper soft Big data Index
MongoDB Increasing Its Dominance
Demand
For MongoDB,
the document-
oriented NoSQL
database, saw
the biggest
spike with over
200% growth in
2011.
Features
 Document-Oriented Storage
 Full Index Support
 Querying
 Replication and High Availability
 Auto Sharding
Fast In-place Updates
 Map/Reduce
 Operating System : Cross-Platform
Agile and Scalable
It is easy to
Code,
Scale, and
Manage
Database.
MongoDB is
Easy to
Use
General
Purpose
Fast &
Scalable
Rich DATA
Model
Full Featured
Indexes
Sophisticated
Query Language
Easy Mapping
To Object
Oriented Code
Operates at In
Memory Speed
Wherever
Possible
Native
Language
Drivers in
Auto-Sharding
Built in
Simple to Setup
and Manage
Dynamically
Add/remove
Capacity With
No Downtime
Document Store
RDBMS MongoDB
Database Database
Table, view Collection
Row Documents(JSON,BSON)
Column Field
Index Index
Join Embedded Document
Foreign Key Reference
Partition Key Shard Key
Relational Database MongoDB
Collections
 Collections of MongoDB is like table in SQL
 Dynamic schema
 No '$' or '0' in name of collection
 Capped collections
Replication
 Redundancy and Failover
 Zero downtime for upgrades and maintaince
 Master-Slave replication
Strong Consistency
Delayed Consistency
 Geospatial Features
Copying
Sharding
 Partition your data
 Scale write throughput
 Increase capacity
 Auto-balancing
One big database
Splitting of data
CRUD
 Create
db.collection.insert( <document> )
db.collection.insert({'author':'Bob','title':'Introduction to mysql','article':'mongodb is open source database'})
 Read
db.collection.find( <query>, <projection> )
db.collection.find({'author':''Bob}
 Update
db.collection.update( <query>, <update>, <options> )
db.collection.update({'author':'Bob'},{'$set':{'title':'Introduction to mongoDB'}})
 Delete
db.collection.remove( <query>, <justOne> )
db.collection.remove({'author':'Bob'})
CRUD Example
> db.user.insert({
first: "John",
last : "Doe",
age: 39
})
> db.user.update(
{"_id" : ObjectId("51…")},
{
$set: {
age: 40,
salary: 7000}
}
)
> db.user.find ()
{
"_id" : ObjectId("51…"),
"first" : "John",
"last" : "Doe",
"age" : 39
}
> db.user.remove({
"first": /^J/
})
MongoDB is Easy to Use
{
title: ‘MongoDB’,
contributors: [
{ name: ‘Eliot Horowitz’,
email: ‘eliot@10gen.com’ },
{ name: ‘Dwight Merriman’,
email: ‘dwight@10gen.com’ }
],
model: {
relational: false,
awesome: true
}
}
START TRANSACTION;
INSERT INTO contacts VALUES
(NULL, ‘joeblow’);
INSERT INTO contact_emails VALUES
( NULL, ”joe@blow.com”,
LAST_INSERT_ID() ),
( NULL, “joseph@blow.com”,
LAST_INSERT_ID() );
COMMIT;
db.contacts.save( {
userName: “joeblow”,
emailAddresses: [
“joe@blow.com”,
“joseph@blow.com” ] } );
MySQL MongoDB
NOSQL(Not Only SQL)Type
1) Key-Value databases
{
"Name": "John",
"Age": 20,
"address": "Nanded"
}
2) Document databases
{
"name": "John",
"age": 25,
"address": {
"streetAddress": "21 2nd
Street",
"city": "Nanded",
"state": "Maharashtra",
"postalCode": "403414”
},
"children": [“Anshu”,”chetan”],
}
Continue…
3) Wide Column Store / Column Families
Row Columner
Id Name Address Age
1 Nicks Nanded 21
2 Alice Mumbai 25
3 Bob Delhi 18
4 Jhon Pune 27
Id Name
1 Nicks
2 Alice
3 Bob
4 Jhon
4) Graph Databases
CAP Theorem
 Three properties of a system
Consistency
Availability
Partitions
JSON
Key value
{
“bookName”:”The Da Vinci Code”,
“authorName”:”Dan Brown”,
“pages”:320,
“ISBN”:”53453444-234”
}
Documents
{
“_id”: ObjectId("52452ea71c5619b639000005")
“bookName”:”The Da Vinci Code”,
“authorName”:”Dan Brown”,
“pages”:320,
“publishedOn”: ISODate("2013-09-27T07:07:19.610Z")
“tag”:[”novel”,”mystery”,”drama”,”action”]
}
Unique identifier
Date
Array list
Database
 Admin
 Local
 Config (Supports Sharded Cluster Operation)
Installation
 echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee
/etc/apt/sources.list.d/mongodb.list
 sudo apt-get update
 sudo apt-get install -y mongodb-org
mongo
one of the considerable advantage of using
MongoDB is-
we can calculate distances by providing latitude
and altitude in MongoDB query.
mysql
Few Commands
Connect
mongo
show dbs
use <db name>
show collections
use <collection name>
A MongoDB Users
MongoDB is widely used by many enterprises. To name a few:
 Disney
 MTV
 EA Sports
 Craigslist
References
 E. F. Codd. 1970. A relational model of data for large shared data
banks. Commun. ACM 13, 6 (June 1970), 377-387.
DOI=10.1145/362384.362685
http://doi.acm.org/10.1145/362384.362685
 ISO/IEC 9075-1:2008: Information technology – Database languages –
SQL – Part 1: Framework (SQL/Framework)
Conclusion
MongoDB, with its flexible schema, distributed deployment, aggregation and low latency
is typically suited for the following kind of applications:
 Content Management
 Inventory Management
 Game Development
 Social Media Storage
 Database for sensor streams
Thank You For Your Attention!

More Related Content

PPTX
The Basics of MongoDB
PPTX
MongoDB presentation
PPT
Introduction to MongoDB
PPTX
Basics of MongoDB
PPTX
Introduction to MongoDB
PPTX
Introduction to MongoDB.pptx
ODP
Introduction to MongoDB
PDF
Introduction to MongoDB
The Basics of MongoDB
MongoDB presentation
Introduction to MongoDB
Basics of MongoDB
Introduction to MongoDB
Introduction to MongoDB.pptx
Introduction to MongoDB
Introduction to MongoDB

What's hot (20)

PPT
Introduction to mongodb
PPTX
Introduction to MongoDB
PPTX
Mongodb basics and architecture
PPTX
An Introduction To NoSQL & MongoDB
PPTX
Mongo db intro.pptx
PDF
An introduction to MongoDB
PPTX
Mongo DB Presentation
PPTX
introduction to NOSQL Database
PPTX
Introducing MongoDB Atlas
PPTX
Mongo db queries
PDF
Intro To MongoDB
PPTX
Introduction to NoSQL
PDF
Cassandra Introduction & Features
PDF
An introduction to MongoDB
PDF
NOSQL- Presentation on NoSQL
PDF
Inside MongoDB: the Internals of an Open-Source Database
PDF
Intro to HBase
PPTX
Introduction to NoSQL Databases
Introduction to mongodb
Introduction to MongoDB
Mongodb basics and architecture
An Introduction To NoSQL & MongoDB
Mongo db intro.pptx
An introduction to MongoDB
Mongo DB Presentation
introduction to NOSQL Database
Introducing MongoDB Atlas
Mongo db queries
Intro To MongoDB
Introduction to NoSQL
Cassandra Introduction & Features
An introduction to MongoDB
NOSQL- Presentation on NoSQL
Inside MongoDB: the Internals of an Open-Source Database
Intro to HBase
Introduction to NoSQL Databases
Ad

Similar to MongoDB (20)

KEY
Introduction to MongoDB
KEY
PPTX
lecture_34e.pptx
PDF
MongoDB NoSQL database a deep dive -MyWhitePaper
PPTX
Introduction to MongoDB
PPT
Meetup#1: 10 reasons to fall in love with MongoDB
PPTX
Introduction to MongoDB and Workshop
PDF
MongoDB
ODP
PPTX
Mongodb introduction and_internal(simple)
PPTX
Jumpstart: Building Your First MongoDB App
PDF
Building your first app with MongoDB
KEY
2012 phoenix mug
PPTX
PPT
Mongodb Training Tutorial in Bangalore
PPT
Introduction to MongoDB (Webinar Jan 2011)
PPTX
MongoDB_Sharan_Prakash_Babu
PDF
10gen MongoDB Video Presentation at WebGeek DevCup
PPTX
Dev Jumpstart: Build Your First App with MongoDB
PDF
Mongo learning series
Introduction to MongoDB
lecture_34e.pptx
MongoDB NoSQL database a deep dive -MyWhitePaper
Introduction to MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
Introduction to MongoDB and Workshop
MongoDB
Mongodb introduction and_internal(simple)
Jumpstart: Building Your First MongoDB App
Building your first app with MongoDB
2012 phoenix mug
Mongodb Training Tutorial in Bangalore
Introduction to MongoDB (Webinar Jan 2011)
MongoDB_Sharan_Prakash_Babu
10gen MongoDB Video Presentation at WebGeek DevCup
Dev Jumpstart: Build Your First App with MongoDB
Mongo learning series
Ad

MongoDB

  • 1. Mongo DB OPEN SOURCE, HIGH PERFORMANCE DATABASE SEMINAR GUIDE: PRESENTED BY: MR.M.V.VAIDYA NIKHIL SATISH PADMAWAR (2012BIT028)
  • 2. Outlines  Mongo DB  Introduction to 10gen  Hawk eye @MongoDB  Features  Document Store  Comparison  Collections  Replication  Sharding  CRUD  NoSQL Type  CAP Theorem  Installation Process
  • 3. 10gen is the company behind MongoDB. Founded in 2007  Dwight Merriman, Eliot Horowitz  Doubleclick, Oracle, Marklogic, HP Worldwide Expanding Team  140+ employees  NY, Palo Alto, London, Dublin, Sydney MongoDB’s Office,Palo Alto,California Set the direction & Contribute code to MongoDB Foster Community & ecosystem Provide commercial services Provide MongoDB management Services
  • 4. Why MongoDB  Schema-less Pain of ‘Alter table’(Wide Application in E-commerce)  No-Joins Complexity of Join  Data Type Polymorphic data type ex. A=1 and A=Nanded  Big Size Limit per Document(16 MB per Doc)
  • 5. What is MongoDB?  Data model: Using BSON (binary JSON), developers can easily map to modern object-oriented languages without a complicated ORM layer.  ORM  BSON Lightweight, Traversable, Efficient.
  • 6. MongoDB is the leading NoSql Solution On In deed's Fastest Growing Jobs Google Searches Jasper soft Big data Index MongoDB Increasing Its Dominance Demand For MongoDB, the document- oriented NoSQL database, saw the biggest spike with over 200% growth in 2011.
  • 7. Features  Document-Oriented Storage  Full Index Support  Querying  Replication and High Availability  Auto Sharding Fast In-place Updates  Map/Reduce  Operating System : Cross-Platform
  • 8. Agile and Scalable It is easy to Code, Scale, and Manage Database.
  • 9. MongoDB is Easy to Use General Purpose Fast & Scalable Rich DATA Model Full Featured Indexes Sophisticated Query Language Easy Mapping To Object Oriented Code Operates at In Memory Speed Wherever Possible Native Language Drivers in Auto-Sharding Built in Simple to Setup and Manage Dynamically Add/remove Capacity With No Downtime
  • 10. Document Store RDBMS MongoDB Database Database Table, view Collection Row Documents(JSON,BSON) Column Field Index Index Join Embedded Document Foreign Key Reference Partition Key Shard Key
  • 12. Collections  Collections of MongoDB is like table in SQL  Dynamic schema  No '$' or '0' in name of collection  Capped collections
  • 13. Replication  Redundancy and Failover  Zero downtime for upgrades and maintaince  Master-Slave replication Strong Consistency Delayed Consistency  Geospatial Features Copying
  • 14. Sharding  Partition your data  Scale write throughput  Increase capacity  Auto-balancing One big database Splitting of data
  • 15. CRUD  Create db.collection.insert( <document> ) db.collection.insert({'author':'Bob','title':'Introduction to mysql','article':'mongodb is open source database'})  Read db.collection.find( <query>, <projection> ) db.collection.find({'author':''Bob}  Update db.collection.update( <query>, <update>, <options> ) db.collection.update({'author':'Bob'},{'$set':{'title':'Introduction to mongoDB'}})  Delete db.collection.remove( <query>, <justOne> ) db.collection.remove({'author':'Bob'})
  • 16. CRUD Example > db.user.insert({ first: "John", last : "Doe", age: 39 }) > db.user.update( {"_id" : ObjectId("51…")}, { $set: { age: 40, salary: 7000} } ) > db.user.find () { "_id" : ObjectId("51…"), "first" : "John", "last" : "Doe", "age" : 39 } > db.user.remove({ "first": /^J/ })
  • 17. MongoDB is Easy to Use { title: ‘MongoDB’, contributors: [ { name: ‘Eliot Horowitz’, email: ‘eliot@10gen.com’ }, { name: ‘Dwight Merriman’, email: ‘dwight@10gen.com’ } ], model: { relational: false, awesome: true } }
  • 18. START TRANSACTION; INSERT INTO contacts VALUES (NULL, ‘joeblow’); INSERT INTO contact_emails VALUES ( NULL, ”joe@blow.com”, LAST_INSERT_ID() ), ( NULL, “joseph@blow.com”, LAST_INSERT_ID() ); COMMIT; db.contacts.save( { userName: “joeblow”, emailAddresses: [ “joe@blow.com”, “joseph@blow.com” ] } ); MySQL MongoDB
  • 19. NOSQL(Not Only SQL)Type 1) Key-Value databases { "Name": "John", "Age": 20, "address": "Nanded" } 2) Document databases { "name": "John", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "Nanded", "state": "Maharashtra", "postalCode": "403414” }, "children": [“Anshu”,”chetan”], }
  • 20. Continue… 3) Wide Column Store / Column Families Row Columner Id Name Address Age 1 Nicks Nanded 21 2 Alice Mumbai 25 3 Bob Delhi 18 4 Jhon Pune 27 Id Name 1 Nicks 2 Alice 3 Bob 4 Jhon 4) Graph Databases
  • 21. CAP Theorem  Three properties of a system Consistency Availability Partitions
  • 22. JSON Key value { “bookName”:”The Da Vinci Code”, “authorName”:”Dan Brown”, “pages”:320, “ISBN”:”53453444-234” }
  • 23. Documents { “_id”: ObjectId("52452ea71c5619b639000005") “bookName”:”The Da Vinci Code”, “authorName”:”Dan Brown”, “pages”:320, “publishedOn”: ISODate("2013-09-27T07:07:19.610Z") “tag”:[”novel”,”mystery”,”drama”,”action”] } Unique identifier Date Array list
  • 24. Database  Admin  Local  Config (Supports Sharded Cluster Operation)
  • 25. Installation  echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list  sudo apt-get update  sudo apt-get install -y mongodb-org
  • 26. mongo one of the considerable advantage of using MongoDB is- we can calculate distances by providing latitude and altitude in MongoDB query. mysql
  • 27. Few Commands Connect mongo show dbs use <db name> show collections use <collection name>
  • 28. A MongoDB Users MongoDB is widely used by many enterprises. To name a few:  Disney  MTV  EA Sports  Craigslist
  • 29. References  E. F. Codd. 1970. A relational model of data for large shared data banks. Commun. ACM 13, 6 (June 1970), 377-387. DOI=10.1145/362384.362685 http://doi.acm.org/10.1145/362384.362685  ISO/IEC 9075-1:2008: Information technology – Database languages – SQL – Part 1: Framework (SQL/Framework)
  • 30. Conclusion MongoDB, with its flexible schema, distributed deployment, aggregation and low latency is typically suited for the following kind of applications:  Content Management  Inventory Management  Game Development  Social Media Storage  Database for sensor streams
  • 31. Thank You For Your Attention!

Editor's Notes

  • #4: JSON-Javascript Object Notation Humongous : Huge + Monstrous
  • #5: Former CEO : Max Schireson Since 2014 : Dev ittycheria Dwight Merriman : Chairman Eliot Horowitz : CTO(Chief Technology Officer) Kevin P. Ryan : Board Member
  • #7: ORM-is a programming technique for converting data between incompatible type systems in object-oriented programming languages. BSON-is a binary format in which zero or more key/value pairs are stored as a single entity.
  • #14: once a collection fills its allocated space, it makes room for new documents by overwriting the oldest document in collection
  • #15: Replication : Copying same data into multiple part -Replication protects a database from the loss of a single server -You can use replication to increase read capacity.
  • #16: -1970-2000: Vertical Scalability -Google,~2000: Horizontal Scalability -Process of storing data records across multiple machines. As the size of the data increases, a single machine may not be sufficient to store the data and gives improper throughput - Sharding solves the problem with horizontal scaling. With sharding, you add more machines to support data growth and the demands of read and write operations.
  • #21: NoSQL is popular for development & deployment of data-centric applications. Not using the relational model Running well on commodity hardware Horizontal scaling Mostly open-source Schema-less No joins
  • #22: Huge quantity of data => Distributed systems => expensive joins => New fields, new demands (graphs) => Different data strucutres: Simplier or more specific
  • #23: Consistency (all copies have same value) Availability (system can run even if parts have failed) Partitions (network can break into two or more parts, each with active systems that can’t talk to other parts)
  • #24: -JSON-Javascript Object Notation -Used to store info in organized manner -Less time Consuming