SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Gagan | Rohith | Sunil
“ MongoDB (from "hu mongo us") is a scalable, high-performance, open source, schema-free, document-oriented database.” - mongodb.org Created by 10gen
Features   ,[object Object],[object Object],[object Object],[object Object]
Document oriented storage ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
 
Querying ,[object Object],[object Object]
SQL Statement  Mongo Query Language Statement  CREATE TABLE USERS (a Number, b Number); implicit; can be done  explicitly  INSERT INTO USERS VALUES(1,1); db.users.insert({a:1,b:1}) SELECT * FROM users; db.users.find() SELECT * FROM users WHERE age=33; db.users.find({age:33}) SELECT * FROM users WHERE age=33 ORDER BY name; db.users.find({age:33}).sort({name:1}) SELECT * FROM users WHERE age>33; db.users.find({'age':{$gt:33}}) SELECT * FROM users WHERE age<33; db.users.find({'age':{$lt:33}})
DEMO (Part 1)
Sharding Sharding is the partitioning of data among multiple machines in an  order-preserving manner . SHARDING IN MONGODB: Auto –Sharding (only needs shard key ). Automatic load Balancing. Scaling out to thousands of nodes. Availability and automated failover
 
Architectural Overview
Operations ,[object Object],[object Object],[object Object]
Config server Mongos Shards
Architectural Overview
Operation Types ,[object Object],[object Object],[object Object],[object Object]
Flowchart App  Server Client (Mongos) Configuration Server DECISION Global Targeted Shard3 Shard4 Shard2 Shard1
Sharding and Failover NO SINGLE POINT FAILURE Failure of ->Mongos process ->Single mongod server ->Failure of all mongod servers comprising a shard. ->Config server.
Master and Slave
REPLICA SETS Shards Architecture Representation
Replication Set
A Set
A Set
A Set
A Set
Election Algorithm Periodically exchange  Maxappliedoptime  with all other nodes using the following format (selfid,maxoptime)  . If nodes  maxoptime  is more send NO or else send YES(Arbitrer). The node getting the majority of yes and see majority of nodes will be elected as  Primary . The process is repeated periodically.
Election Algorithm(Flow) server-a: primary oplog: (a1,a2,a3,a4,a5) server-b: secondary oplog: (a1) server-c: secondary oplog: (a1,a2,a3) … // server-a goes down … server-b: secondary oplog: (a1) server-c: secondary oplog: (a1,a2,a3) ... server-b: secondary oplog: (a1) server-c: primary oplog: (a1,a2,a3) // c has highest ord and becomes primary ... server-b: secondary oplog: (a1,a2,a3) server-c: primary oplog: (a1,a2,a3,c4) ... server-a resumes ... server-a: recovering oplog: (a1,a2,a3,a4,a5) server-b: secondary oplog: (a1,a2,a3) server-c: primary oplog: (a1,a2,a3,c4) … server-a: recovering oplog: (a1,a2,a3,c4) server-b: secondary oplog: (a1,a2,a3,c4) server-c: primary oplog: (a1,a2,a3,c4) … server-a: secondary oplog: (a1,a2,a3,c4) server-b: secondary oplog: (a1,a2,a3,c4) server-c: primary oplog: (a1,a2,a3,c4,c5,c6,c7,c8) … server-a: secondary oplog: (a1,a2,a3,c4,c5,c6,c7,c8) server-b: secondary oplog: (a1,a2,a3,c4,c5,c6,c7,c8) server-c: primary oplog: (a1,a2,a3,c4,c5,c6,c7,c8)
DEMO
BIBLOGRAPHY ,[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013
Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013
Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013PostgresOpen
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation FrameworkMongoDB
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorHenrik Ingo
 
MongoDB Aggregation
MongoDB Aggregation MongoDB Aggregation
MongoDB Aggregation Amit Ghosh
 
JavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primerJavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primerBruce McPherson
 
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodbLee Theobald
 
Jsquery - the jsonb query language with GIN indexing support
Jsquery - the jsonb query language with GIN indexing supportJsquery - the jsonb query language with GIN indexing support
Jsquery - the jsonb query language with GIN indexing supportAlexander Korotkov
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichNorberto Leite
 
Do something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appDo something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appBruce McPherson
 
Do something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databasesDo something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databasesBruce McPherson
 
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...MongoDB
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part AKazuchika Sekiya
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation FrameworkMongoDB
 
Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Andy Bunce
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueGleicon Moraes
 

Was ist angesagt? (19)

Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013
Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013
Andrew Dunstan 9.3 JSON Presentation @ Postgres Open 2013
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
 
MongoDB Aggregation
MongoDB Aggregation MongoDB Aggregation
MongoDB Aggregation
 
JavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primerJavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primer
 
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
 
Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !
 
Jsquery - the jsonb query language with GIN indexing support
Jsquery - the jsonb query language with GIN indexing supportJsquery - the jsonb query language with GIN indexing support
Jsquery - the jsonb query language with GIN indexing support
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days Munich
 
Do something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appDo something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing app
 
Do something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databasesDo something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databases
 
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
 
Power shell
Power shellPower shell
Power shell
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
 
MongoDB and Python
MongoDB and PythonMongoDB and Python
MongoDB and Python
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 

Ähnlich wie Mongodb

Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBJesse Wolgamott
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introductionTse-Ching Ho
 
MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...
MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...
MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...MongoDB
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo dbAmit Thakkar
 
Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Andreas Jung
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDBMongoDB
 
Social Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBSocial Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBTakahiro Inoue
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleSean Chittenden
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomyDongmin Yu
 
MongoSF 2011 - Using MongoDB for IGN's Social Platform
MongoSF 2011 - Using MongoDB for IGN's Social PlatformMongoSF 2011 - Using MongoDB for IGN's Social Platform
MongoSF 2011 - Using MongoDB for IGN's Social PlatformManish Pandit
 
MongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo SeattleMongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo SeattleMongoDB
 
Flink Forward SF 2017: Malo Deniélou - No shard left behind: Dynamic work re...
Flink Forward SF 2017: Malo Deniélou -  No shard left behind: Dynamic work re...Flink Forward SF 2017: Malo Deniélou -  No shard left behind: Dynamic work re...
Flink Forward SF 2017: Malo Deniélou - No shard left behind: Dynamic work re...Flink Forward
 
Scaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachScaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachJinal Jhaveri
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - GuilinJackson Tian
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsOWASP Kyiv
 
API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)
API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)
API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)AnuradhaRaman5
 
Xadoop - new approaches to data analytics
Xadoop - new approaches to data analyticsXadoop - new approaches to data analytics
Xadoop - new approaches to data analyticsMaxim Grinev
 

Ähnlich wie Mongodb (20)

A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
 
MongoDB 3.0
MongoDB 3.0 MongoDB 3.0
MongoDB 3.0
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...
MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...
MongoDB World 2018: Tutorial - Free the DBA: Building Chat Bots to Triage, Mo...
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
 
Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Python mongo db-training-europython-2011
Python mongo db-training-europython-2011
 
Scaling with MongoDB
Scaling with MongoDBScaling with MongoDB
Scaling with MongoDB
 
Social Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBSocial Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDB
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
 
MongoSF 2011 - Using MongoDB for IGN's Social Platform
MongoSF 2011 - Using MongoDB for IGN's Social PlatformMongoSF 2011 - Using MongoDB for IGN's Social Platform
MongoSF 2011 - Using MongoDB for IGN's Social Platform
 
MongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo SeattleMongoDB Auto-Sharding at Mongo Seattle
MongoDB Auto-Sharding at Mongo Seattle
 
Flink Forward SF 2017: Malo Deniélou - No shard left behind: Dynamic work re...
Flink Forward SF 2017: Malo Deniélou -  No shard left behind: Dynamic work re...Flink Forward SF 2017: Malo Deniélou -  No shard left behind: Dynamic work re...
Flink Forward SF 2017: Malo Deniélou - No shard left behind: Dynamic work re...
 
Scaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachScaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approach
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - Guilin
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tips
 
API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)
API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)
API Testing - The power of libraries (chai, cheerio.js ,lodash and moment.js)
 
Xadoop - new approaches to data analytics
Xadoop - new approaches to data analyticsXadoop - new approaches to data analytics
Xadoop - new approaches to data analytics
 

Mongodb

  • 1. Gagan | Rohith | Sunil
  • 2. “ MongoDB (from &quot;hu mongo us&quot;) is a scalable, high-performance, open source, schema-free, document-oriented database.” - mongodb.org Created by 10gen
  • 3.
  • 4.
  • 5.  
  • 6.  
  • 7.
  • 8. SQL Statement  Mongo Query Language Statement  CREATE TABLE USERS (a Number, b Number); implicit; can be done  explicitly  INSERT INTO USERS VALUES(1,1); db.users.insert({a:1,b:1}) SELECT * FROM users; db.users.find() SELECT * FROM users WHERE age=33; db.users.find({age:33}) SELECT * FROM users WHERE age=33 ORDER BY name; db.users.find({age:33}).sort({name:1}) SELECT * FROM users WHERE age>33; db.users.find({'age':{$gt:33}}) SELECT * FROM users WHERE age<33; db.users.find({'age':{$lt:33}})
  • 10. Sharding Sharding is the partitioning of data among multiple machines in an order-preserving manner . SHARDING IN MONGODB: Auto –Sharding (only needs shard key ). Automatic load Balancing. Scaling out to thousands of nodes. Availability and automated failover
  • 11.  
  • 13.
  • 16.
  • 17. Flowchart App Server Client (Mongos) Configuration Server DECISION Global Targeted Shard3 Shard4 Shard2 Shard1
  • 18. Sharding and Failover NO SINGLE POINT FAILURE Failure of ->Mongos process ->Single mongod server ->Failure of all mongod servers comprising a shard. ->Config server.
  • 20. REPLICA SETS Shards Architecture Representation
  • 22. A Set
  • 23. A Set
  • 24. A Set
  • 25. A Set
  • 26. Election Algorithm Periodically exchange Maxappliedoptime with all other nodes using the following format (selfid,maxoptime) . If nodes maxoptime is more send NO or else send YES(Arbitrer). The node getting the majority of yes and see majority of nodes will be elected as Primary . The process is repeated periodically.
  • 27. Election Algorithm(Flow) server-a: primary oplog: (a1,a2,a3,a4,a5) server-b: secondary oplog: (a1) server-c: secondary oplog: (a1,a2,a3) … // server-a goes down … server-b: secondary oplog: (a1) server-c: secondary oplog: (a1,a2,a3) ... server-b: secondary oplog: (a1) server-c: primary oplog: (a1,a2,a3) // c has highest ord and becomes primary ... server-b: secondary oplog: (a1,a2,a3) server-c: primary oplog: (a1,a2,a3,c4) ... server-a resumes ... server-a: recovering oplog: (a1,a2,a3,a4,a5) server-b: secondary oplog: (a1,a2,a3) server-c: primary oplog: (a1,a2,a3,c4) … server-a: recovering oplog: (a1,a2,a3,c4) server-b: secondary oplog: (a1,a2,a3,c4) server-c: primary oplog: (a1,a2,a3,c4) … server-a: secondary oplog: (a1,a2,a3,c4) server-b: secondary oplog: (a1,a2,a3,c4) server-c: primary oplog: (a1,a2,a3,c4,c5,c6,c7,c8) … server-a: secondary oplog: (a1,a2,a3,c4,c5,c6,c7,c8) server-b: secondary oplog: (a1,a2,a3,c4,c5,c6,c7,c8) server-c: primary oplog: (a1,a2,a3,c4,c5,c6,c7,c8)
  • 28. DEMO
  • 29.