VANDANA
B.Tech CS 3rd yr
Roll No.9072
 First developed by the software company
MongoDB Inc. in October 2007 as a
component of a planned platform as a service
product.
 The company shifted to an open source
development model in 2009.
 In just 5 yrs. In 24 AUG. 2015 MongoDB has
evolved into one of the world’s most popular
database.
 MongoDB is a cross - platform, Document
oriented database .
 MongoDB supports JSON like documents with
dynamic schemas.
 MongoDB supports indexing.
RDBMS MongoDB
Database Database
Table Collection
Tuple/Row Document
Column Field
Table Join Embedded
Documents
Primary Key Primary
Key
(Default key_id
provided by
mongodb itself)
 Schema less
 No complex joins
 Deep-Query ability
 Easy to Scale-out
 Uses internal memory for storing working
set
 Create database
> use DATABASE_NAME
>use mydb
switched to db mydb
>db
mydb
>show dbs
local 0.78125GB
test 0.23012GB
>db.first.insert({“name”:”my first document”})
>show dbs
local 0.78125GB
mydb 0.23012GB
test 0.23012GB
 Drop Database
>use mydb
>db.dropDatabase()
>{“dropped” : ”mydb”, ”ok” : 1}
IN MONGODB IN RDBMS
In MongoDB In RDBMS
 Sharding is a method for storing data across
multiple machines.
 Purpose of sharding is that database with
large data set exceed the storage capacity of
the server.
 So,database have 2 basic approaches:
1.Vertical scaling
2. Sharding
 Sharding partitions a collection’s data by
shard key.
 MongoDB divides shard key values into
chunks and distributes chunks evenly across
shards.
 MongoDB uses either Range based
paritioning or hash based partitioning.
 The addition of new data can result in data
distribution imbalances within the cluster.
 So to maintain MongoDB ensures two
background processes:
1.Splitting
2.Balancing
 Replication provides redundancy and
increases data availability.
.
 There is only one primary database allows
write operation.
.
 Multiple secondary database servers only for
read operation.
.
 Arbiter doesn’t store data. It used during
failover to decide which server will be next
primary server.
 Document Oriented Storage
 Disaster Recovery
 Auto – Sharding
 Indexing
 GridFS
Mongo db1
Mongo db1
Mongo db1
Mongo db1
Mongo db1

Mongo db1

  • 1.
    VANDANA B.Tech CS 3rdyr Roll No.9072
  • 2.
     First developedby the software company MongoDB Inc. in October 2007 as a component of a planned platform as a service product.  The company shifted to an open source development model in 2009.  In just 5 yrs. In 24 AUG. 2015 MongoDB has evolved into one of the world’s most popular database.
  • 3.
     MongoDB isa cross - platform, Document oriented database .  MongoDB supports JSON like documents with dynamic schemas.  MongoDB supports indexing.
  • 4.
    RDBMS MongoDB Database Database TableCollection Tuple/Row Document Column Field Table Join Embedded Documents Primary Key Primary Key (Default key_id provided by mongodb itself)
  • 13.
     Schema less No complex joins  Deep-Query ability  Easy to Scale-out  Uses internal memory for storing working set
  • 14.
     Create database >use DATABASE_NAME >use mydb switched to db mydb >db mydb >show dbs local 0.78125GB test 0.23012GB >db.first.insert({“name”:”my first document”}) >show dbs local 0.78125GB mydb 0.23012GB test 0.23012GB
  • 15.
     Drop Database >usemydb >db.dropDatabase() >{“dropped” : ”mydb”, ”ok” : 1}
  • 16.
  • 18.
  • 19.
     Sharding isa method for storing data across multiple machines.  Purpose of sharding is that database with large data set exceed the storage capacity of the server.  So,database have 2 basic approaches: 1.Vertical scaling 2. Sharding
  • 22.
     Sharding partitionsa collection’s data by shard key.  MongoDB divides shard key values into chunks and distributes chunks evenly across shards.  MongoDB uses either Range based paritioning or hash based partitioning.
  • 25.
     The additionof new data can result in data distribution imbalances within the cluster.  So to maintain MongoDB ensures two background processes: 1.Splitting 2.Balancing
  • 26.
     Replication providesredundancy and increases data availability. .  There is only one primary database allows write operation. .  Multiple secondary database servers only for read operation. .  Arbiter doesn’t store data. It used during failover to decide which server will be next primary server.
  • 28.
     Document OrientedStorage  Disaster Recovery  Auto – Sharding  Indexing  GridFS