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
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'})
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
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
Former CEO : Max Schireson
Since 2014 : Dev ittycheria
Dwight Merriman : Chairman
Eliot Horowitz : CTO(Chief Technology Officer)
Kevin P. Ryan : Board Member
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.
once a collection fills its allocated space, it makes room for new documents by overwriting the oldest document in collection
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.
-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.
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
Huge quantity of data => Distributed systems => expensive joins =>
New fields, new demands (graphs) =>
Different data strucutres:
Simplier or more specific
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)
-JSON-Javascript Object Notation
-Used to store info in organized manner
-Less time Consuming