SlideShare a Scribd company logo
MongoDB“Walking on water and developing software from a
specification are easy if both are frozen.”
BY :
NklMish
@nklmish
Why & What?
Features
Aggregation framework overview
Sharding and Replica Set
Summary
Agenda
This talk is not about :
NoSql
Relational vs Non-Relational
Comparison of other NoSql flavors
NOTE
“One size fits all” approach no longer applies
NoSql Database
SchemaLess != NoSchema
Document based Approach
Non-Relational Dbs scale more easily, especially
horizontally
In a nutshell focus on speed, performance, flexibility and
scalability.
What is MongoDB?
“Nothing endures but change”
Agility.
High Scalability => horizontal => thousand of nodes or clouds or across multiple data centers
Rich Indexing
Real life example:
Server Density
OTTO
Expedia, Forbes, MetLife,Bosch, etc.
Why?
“Luck is not a factor. Hope is not a strategy. Fear is not an option”
RDBMS
Tables
Records/rows
Queries return
records
Mapping
“You improvise. You adapt. You overcome.”
MongoDB
Collections
Documents/objects
Queries return a
cursor ???? Because
of performance,
efficiency
Standard Db Features
Docs are stored in BSON => Mongo understands JSON
natively => Any Valid JSON can be imported and
queried(E.g. mongoimport -f foo.json).
Map Reduce
Aggregation Framework
GridFS (for Efficient binary large objects )
GeoNear
Features
“Stable Velocity. Sustainable Pace.”
$match – filter docs
$project – reshape docs
$group – Summarize docs
$unwind – Expand docs
$sort – Order docs
$limit/$skip – paginate docs
$redact – Restrict docs
$geoNear – Proximity sort docs
$let, $map – Define variables
Aggregation In Nutshell
“Talk is cheap. Show me the code”
{
name : “Java”,
price : 250,
Type : “ebook”
}
{
name : “Php”,
price : 200,
Type : “ebook”
}
{
name : “Javascript”,
price : 150,
Type : “hardCopy”
}
Matching
{$match : {
Type : “ebook”
}}
{
name : “Java”,
price : 200,
Type : “ebook”
}
{
name : “Php”,
price : 200,
Type : “ebook”
}
{
name : “Java”,
price : 250,
Type : “ebook”
}
{
name : “Php”,
price : 200,
Type : “ebook”
}
{
name : “Javascript”,
price : 150,
Type : “hardCopy”
}
Query Operator
{$match : {
price : {$gt : 200}
}}
{
name : “Java”,
price : 250,
Type : “ebook”
}
{
name : “Php”,
price : 200,
Type : “ebook”
}
{
name : “Java”,
price : 250,
Type : “ebook”
}
{
name : “Php”,
price : 200,
Type : “ebook”
}
Including Excluding part of document
{$project : {
name :1,
price : 1,
Type : 0
}}
{
name : “Java”,
price : 200”
}
{
name : “Php”,
price : 200
}
{
name : “Java”,
price : 250,
Type : “ebook”,
quantity : 3
}
{
name : “Php”,
price : 200,
Type : “ebook”,
quantity : 2
}
Custom Field Computation
{$project : {
fullStock : {
$mul : [“$price”, “$quantity”]
},
Title : “$name”
}}
{
fullStock : 750,
Title: “Java”
}
{
price : 400,
Title: “Php”
}
{
name : “Java”,
price : 250,
Type : “ebook”,
quantity : 3
}
{
name : “Php”,
price : 200,
Type : “ebook”,
quantity : 2
}
Generating Sub-Document
{$project : {
fullStock : {
$mul : [“$price”, “$quantity”]
},
details : {Title : “$name”, quantity : “$quantity” }
}}
{
fullStock : 750,
details : {Title: “Java”, quantity : 3}
},
{,
fullStock : 400,
details : {Title: “Php”, quantity : 2}
}
$group
Group Docs by value
By default in memory processing
Helpful operators that go with:
$max, $min, $avg, $sum
$addToSet, $push
$first, $last
{
name : “Java Fun”,
publisher : “manning”,
price : 1000
}
{
name : “Oracle Fun”,
publisher : “manning”,
price : 1000
}
{
name : “Php Fun”,
publisher : “Orelly”,
price : 400
}
Compute Average
{$group : {
_id : “$publisher”,
avgPrice : {$avg : “$price” }
}}
{
_id: manning,
avgPrice :1000
},
{
_id : Php,,
avgPrice: 400
}
$unwind
Useful for doc containing array fields:
Create docs from array entries
Entries can be replace by value
{
publisher :“manning”,
title: [“java”, “Php”],
discount : 50%
}
$unwind
{$unwind : $category}
{
publisher : manning,
title: java,
discount :50%
},
{
publisher : manning,
title: Php,
discount :50%
}
$redact
Restrict access to docs based on doc fields
to define privileges
Useful terminology $$DESCEND, $$PRUNE,
$$KEEP
{
_id :123,
name : logo,
security : “ANYONE”,
Profit : {
security : “MARKETING”,
revenue : 500%,
ProfitByCountry : {
security : “BOARD_OF_DIRECTOR”
PL : 800 %
NO : 700 %
DK : 600%
SW : 500 %
}
}
}
$redact
db.products.aggregate([
{$match : {name : “logo”}},
$redact : {
$cond : {
if : {$eq : …},
then : “$$DESCEND”,
else : “$PRUNE
}
}
])
{...}
Sharding(Horizontal scaling)
Sharding
Allow to store data across multiple machines.
Ok but what for ?
Database systems with large data sets and high throughput applications
can challenge the capacity of a single server.
High query rates can exhaust the CPU capacity of the server.
Larger data sets exceed the storage capacity of a single machine
Working set sizes larger than the system’s RAM stress the I/O capacity of
disk drives.
Replica Set
Replica Set
Group of mongod processes that maintain the same data set. Provides redundancy and high
availability, in a nutshell basis for all production deployments.
Min 3 nodes required E.g.
Document oriented db.
Scale and performs well
Provide powerful aggregration framework
Tested on massive datasets.
Support for map reduce.
Summary
Questions ????

More Related Content

What's hot

Tech Gupshup Meetup On MongoDB - 24/06/2016
Tech Gupshup Meetup On MongoDB - 24/06/2016Tech Gupshup Meetup On MongoDB - 24/06/2016
Tech Gupshup Meetup On MongoDB - 24/06/2016
Mukesh Tilokani
 
Xml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh malothXml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh maloth
Bhavsingh Maloth
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
Knoldus Inc.
 
WordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a FrameworkWordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a Framework
Exove
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source BridgeChris Anderson
 
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
BookNet Canada
 
Introduction to couchdb
Introduction to couchdbIntroduction to couchdb
Introduction to couchdb
iammutex
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
Abhijeet Vaikar
 
Multipart form data
Multipart form dataMultipart form data
Multipart form data
Yubin Lim
 
MongoDB hearts Django? (Django NYC)
MongoDB hearts Django? (Django NYC)MongoDB hearts Django? (Django NYC)
MongoDB hearts Django? (Django NYC)
Mike Dirolf
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 
java script json
java script jsonjava script json
java script json
chauhankapil
 
Json parser
Json parserJson parser
Json parser
Son Nguyen
 
Ebook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura Brady
Ebook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura BradyEbook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura Brady
Ebook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura Brady
BookNet Canada
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJustin Smestad
 
ePUB 3 and Publishing e-books
ePUB 3 and Publishing e-booksePUB 3 and Publishing e-books
ePUB 3 and Publishing e-books
Kerem Karatal
 
Java script
Java scriptJava script
Java script
rajshreemuthiah
 
Experion Presentation at JavaOne 2011: Memory optimizing Java ME applications
Experion Presentation at JavaOne 2011:  Memory optimizing Java ME applicationsExperion Presentation at JavaOne 2011:  Memory optimizing Java ME applications
Experion Presentation at JavaOne 2011: Memory optimizing Java ME applications
Experion Technologies
 

What's hot (20)

Tech Gupshup Meetup On MongoDB - 24/06/2016
Tech Gupshup Meetup On MongoDB - 24/06/2016Tech Gupshup Meetup On MongoDB - 24/06/2016
Tech Gupshup Meetup On MongoDB - 24/06/2016
 
Xml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh malothXml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh maloth
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
 
WordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a FrameworkWordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a Framework
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
 
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
You Want to Go XML-First: Now What? Building an In-House XML-First Workflow -...
 
Introduction to couchdb
Introduction to couchdbIntroduction to couchdb
Introduction to couchdb
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Multipart form data
Multipart form dataMultipart form data
Multipart form data
 
MongoDB hearts Django? (Django NYC)
MongoDB hearts Django? (Django NYC)MongoDB hearts Django? (Django NYC)
MongoDB hearts Django? (Django NYC)
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Scala with MongoDB
Scala with MongoDBScala with MongoDB
Scala with MongoDB
 
java script json
java script jsonjava script json
java script json
 
Json parser
Json parserJson parser
Json parser
 
Ebook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura Brady
Ebook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura BradyEbook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura Brady
Ebook Accessibility: Why, How, and What For - ebookcraft 2016 - Laura Brady
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
ePUB 3 and Publishing e-books
ePUB 3 and Publishing e-booksePUB 3 and Publishing e-books
ePUB 3 and Publishing e-books
 
Java script
Java scriptJava script
Java script
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 
Experion Presentation at JavaOne 2011: Memory optimizing Java ME applications
Experion Presentation at JavaOne 2011:  Memory optimizing Java ME applicationsExperion Presentation at JavaOne 2011:  Memory optimizing Java ME applications
Experion Presentation at JavaOne 2011: Memory optimizing Java ME applications
 

Viewers also liked

UArts 2012 Opening Meeting Invite
UArts 2012 Opening Meeting InviteUArts 2012 Opening Meeting Invite
UArts 2012 Opening Meeting InvitePamela Shropshire
 
Discurso Verónika Mendoza en evento CONFIEP
Discurso Verónika Mendoza en evento CONFIEPDiscurso Verónika Mendoza en evento CONFIEP
Discurso Verónika Mendoza en evento CONFIEP
Eduardo Zegarra Méndez
 
Po pierwsze smartfon
Po pierwsze smartfonPo pierwsze smartfon
Po pierwsze smartfon
BPSC
 
Oficio simulacro de sismos y tsunami ugel chiclayo
Oficio simulacro de sismos y tsunami   ugel chiclayoOficio simulacro de sismos y tsunami   ugel chiclayo
Oficio simulacro de sismos y tsunami ugel chiclayo
Karina Verónica Santisteban Fernandez
 
Plan de Gobierno en Economia y Agro--Verónika Mendoza
Plan de Gobierno en Economia y Agro--Verónika MendozaPlan de Gobierno en Economia y Agro--Verónika Mendoza
Plan de Gobierno en Economia y Agro--Verónika Mendoza
Eduardo Zegarra Méndez
 
AEROSOLS
AEROSOLSAEROSOLS
AEROSOLS
Jagadeesh Babu
 
Event triggered control design of linear networked systems with quantizations
Event triggered control design of linear networked systems with quantizationsEvent triggered control design of linear networked systems with quantizations
Event triggered control design of linear networked systems with quantizations
ISA Interchange
 
Valve usage and replacement when converting power generation from coal to gas
Valve usage and replacement when converting power generation from coal to gasValve usage and replacement when converting power generation from coal to gas
Valve usage and replacement when converting power generation from coal to gas
Mountain States Engineering and Controls
 
Contrato docente Coar Lambayeque área tecnologías educativas
Contrato docente Coar Lambayeque área  tecnologías educativasContrato docente Coar Lambayeque área  tecnologías educativas
Contrato docente Coar Lambayeque área tecnologías educativas
Karina Verónica Santisteban Fernandez
 
Built environment_urban transformation
Built environment_urban transformationBuilt environment_urban transformation
Built environment_urban transformationKeerthana Ravichandran
 
Proposed urban renewal of nw ne quiapo district & riverfront revitalization
Proposed urban renewal of nw ne quiapo district & riverfront revitalizationProposed urban renewal of nw ne quiapo district & riverfront revitalization
Proposed urban renewal of nw ne quiapo district & riverfront revitalization
Aleli Arafol
 
Pyrrole (o.c iv)
Pyrrole (o.c iv)Pyrrole (o.c iv)
Pyrrole (o.c iv)
Srinivas Bhairy
 
RECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONS
RECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONSRECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONS
RECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONS
SANJAY YADAV
 
Barbarians At the Gate
Barbarians At the GateBarbarians At the Gate
Barbarians At the GateCarl Huckstep
 

Viewers also liked (17)

UArts 2012 Opening Meeting Invite
UArts 2012 Opening Meeting InviteUArts 2012 Opening Meeting Invite
UArts 2012 Opening Meeting Invite
 
Discurso Verónika Mendoza en evento CONFIEP
Discurso Verónika Mendoza en evento CONFIEPDiscurso Verónika Mendoza en evento CONFIEP
Discurso Verónika Mendoza en evento CONFIEP
 
Po pierwsze smartfon
Po pierwsze smartfonPo pierwsze smartfon
Po pierwsze smartfon
 
Oficio simulacro de sismos y tsunami ugel chiclayo
Oficio simulacro de sismos y tsunami   ugel chiclayoOficio simulacro de sismos y tsunami   ugel chiclayo
Oficio simulacro de sismos y tsunami ugel chiclayo
 
Plan de Gobierno en Economia y Agro--Verónika Mendoza
Plan de Gobierno en Economia y Agro--Verónika MendozaPlan de Gobierno en Economia y Agro--Verónika Mendoza
Plan de Gobierno en Economia y Agro--Verónika Mendoza
 
AEROSOLS
AEROSOLSAEROSOLS
AEROSOLS
 
Event triggered control design of linear networked systems with quantizations
Event triggered control design of linear networked systems with quantizationsEvent triggered control design of linear networked systems with quantizations
Event triggered control design of linear networked systems with quantizations
 
Valve usage and replacement when converting power generation from coal to gas
Valve usage and replacement when converting power generation from coal to gasValve usage and replacement when converting power generation from coal to gas
Valve usage and replacement when converting power generation from coal to gas
 
Contrato docente Coar Lambayeque área tecnologías educativas
Contrato docente Coar Lambayeque área  tecnologías educativasContrato docente Coar Lambayeque área  tecnologías educativas
Contrato docente Coar Lambayeque área tecnologías educativas
 
Built environment_urban transformation
Built environment_urban transformationBuilt environment_urban transformation
Built environment_urban transformation
 
Proposed urban renewal of nw ne quiapo district & riverfront revitalization
Proposed urban renewal of nw ne quiapo district & riverfront revitalizationProposed urban renewal of nw ne quiapo district & riverfront revitalization
Proposed urban renewal of nw ne quiapo district & riverfront revitalization
 
Gaya hidup sihat
Gaya hidup sihatGaya hidup sihat
Gaya hidup sihat
 
Pyrrole (o.c iv)
Pyrrole (o.c iv)Pyrrole (o.c iv)
Pyrrole (o.c iv)
 
RECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONS
RECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONSRECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONS
RECENT ADVANCES IN THE TREATMENT OF DIABETES MELLITUS AND ITS COMPLICATIONS
 
Godrej company
Godrej companyGodrej company
Godrej company
 
Godrej product mix
Godrej product mixGodrej product mix
Godrej product mix
 
Barbarians At the Gate
Barbarians At the GateBarbarians At the Gate
Barbarians At the Gate
 

Similar to Mongo - an intermediate introduction

Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
AhmedabadJavaMeetup
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
Bruno Alló Bacarini
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaSolutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Guido Schmutz
 
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaSolutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Guido Schmutz
 
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
confluent
 
The Django Book chapter 5 Models
The Django Book chapter 5 ModelsThe Django Book chapter 5 Models
The Django Book chapter 5 Models
Vincent Chien
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
delagoya
 
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Comsysto Reply GmbH
 
MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
Andrew Morgan
 
MongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB
 
Specification-Driven Development of REST APIs by Alexander Zinchuk
Specification-Driven Development of REST APIs by Alexander Zinchuk   Specification-Driven Development of REST APIs by Alexander Zinchuk
Specification-Driven Development of REST APIs by Alexander Zinchuk
OdessaJS Conf
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB App
Henrik Ingo
 
Intro to CouchDB
Intro to CouchDBIntro to CouchDB
Intro to CouchDB
sbisbee
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
NoSQLmatters
 
Introduction to CouchDB
Introduction to CouchDBIntroduction to CouchDB
Introduction to CouchDB
OpusVL
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Forever
stephskardal
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
Alive Kuo
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
Christian Baranowski
 

Similar to Mongo - an intermediate introduction (20)

Introduction to MongoDB and Workshop
Introduction to MongoDB and WorkshopIntroduction to MongoDB and Workshop
Introduction to MongoDB and Workshop
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaSolutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
 
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache KafkaSolutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
Solutions for bi-directional Integration between Oracle RDMBS & Apache Kafka
 
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
Solutions for bi-directional integration between Oracle RDBMS and Apache Kafk...
 
The Django Book chapter 5 Models
The Django Book chapter 5 ModelsThe Django Book chapter 5 Models
The Django Book chapter 5 Models
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
 
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
 
MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
 
MongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in BavariaMongoDB Munich 2012: MongoDB for official documents in Bavaria
MongoDB Munich 2012: MongoDB for official documents in Bavaria
 
Specification-Driven Development of REST APIs by Alexander Zinchuk
Specification-Driven Development of REST APIs by Alexander Zinchuk   Specification-Driven Development of REST APIs by Alexander Zinchuk
Specification-Driven Development of REST APIs by Alexander Zinchuk
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB App
 
Intro to CouchDB
Intro to CouchDBIntro to CouchDB
Intro to CouchDB
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
 
Introduction to CouchDB
Introduction to CouchDBIntroduction to CouchDB
Introduction to CouchDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Forever
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
 

More from nklmish

Demystifying Kafka
Demystifying KafkaDemystifying Kafka
Demystifying Kafka
nklmish
 
Scaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and realityScaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and reality
nklmish
 
CQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & AxonCQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & Axon
nklmish
 
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
nklmish
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
nklmish
 
Distributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your productionDistributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your production
nklmish
 
Spock
SpockSpock
Spock
nklmish
 
Microservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuffMicroservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuff
nklmish
 
Neo4J
Neo4JNeo4J
Neo4J
nklmish
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
nklmish
 

More from nklmish (10)

Demystifying Kafka
Demystifying KafkaDemystifying Kafka
Demystifying Kafka
 
Scaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and realityScaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and reality
 
CQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & AxonCQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & Axon
 
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
 
Distributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your productionDistributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your production
 
Spock
SpockSpock
Spock
 
Microservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuffMicroservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuff
 
Neo4J
Neo4JNeo4J
Neo4J
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 

Recently uploaded

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Mongo - an intermediate introduction

  • 1. MongoDB“Walking on water and developing software from a specification are easy if both are frozen.” BY : NklMish @nklmish
  • 2. Why & What? Features Aggregation framework overview Sharding and Replica Set Summary Agenda
  • 3. This talk is not about : NoSql Relational vs Non-Relational Comparison of other NoSql flavors NOTE
  • 4. “One size fits all” approach no longer applies NoSql Database SchemaLess != NoSchema Document based Approach Non-Relational Dbs scale more easily, especially horizontally In a nutshell focus on speed, performance, flexibility and scalability. What is MongoDB? “Nothing endures but change”
  • 5. Agility. High Scalability => horizontal => thousand of nodes or clouds or across multiple data centers Rich Indexing Real life example: Server Density OTTO Expedia, Forbes, MetLife,Bosch, etc. Why? “Luck is not a factor. Hope is not a strategy. Fear is not an option”
  • 6. RDBMS Tables Records/rows Queries return records Mapping “You improvise. You adapt. You overcome.” MongoDB Collections Documents/objects Queries return a cursor ???? Because of performance, efficiency
  • 7. Standard Db Features Docs are stored in BSON => Mongo understands JSON natively => Any Valid JSON can be imported and queried(E.g. mongoimport -f foo.json). Map Reduce Aggregation Framework GridFS (for Efficient binary large objects ) GeoNear Features “Stable Velocity. Sustainable Pace.”
  • 8. $match – filter docs $project – reshape docs $group – Summarize docs $unwind – Expand docs $sort – Order docs $limit/$skip – paginate docs $redact – Restrict docs $geoNear – Proximity sort docs $let, $map – Define variables Aggregation In Nutshell “Talk is cheap. Show me the code”
  • 9. { name : “Java”, price : 250, Type : “ebook” } { name : “Php”, price : 200, Type : “ebook” } { name : “Javascript”, price : 150, Type : “hardCopy” } Matching {$match : { Type : “ebook” }} { name : “Java”, price : 200, Type : “ebook” } { name : “Php”, price : 200, Type : “ebook” }
  • 10. { name : “Java”, price : 250, Type : “ebook” } { name : “Php”, price : 200, Type : “ebook” } { name : “Javascript”, price : 150, Type : “hardCopy” } Query Operator {$match : { price : {$gt : 200} }} { name : “Java”, price : 250, Type : “ebook” } { name : “Php”, price : 200, Type : “ebook” }
  • 11. { name : “Java”, price : 250, Type : “ebook” } { name : “Php”, price : 200, Type : “ebook” } Including Excluding part of document {$project : { name :1, price : 1, Type : 0 }} { name : “Java”, price : 200” } { name : “Php”, price : 200 }
  • 12. { name : “Java”, price : 250, Type : “ebook”, quantity : 3 } { name : “Php”, price : 200, Type : “ebook”, quantity : 2 } Custom Field Computation {$project : { fullStock : { $mul : [“$price”, “$quantity”] }, Title : “$name” }} { fullStock : 750, Title: “Java” } { price : 400, Title: “Php” }
  • 13. { name : “Java”, price : 250, Type : “ebook”, quantity : 3 } { name : “Php”, price : 200, Type : “ebook”, quantity : 2 } Generating Sub-Document {$project : { fullStock : { $mul : [“$price”, “$quantity”] }, details : {Title : “$name”, quantity : “$quantity” } }} { fullStock : 750, details : {Title: “Java”, quantity : 3} }, {, fullStock : 400, details : {Title: “Php”, quantity : 2} }
  • 14. $group Group Docs by value By default in memory processing Helpful operators that go with: $max, $min, $avg, $sum $addToSet, $push $first, $last
  • 15. { name : “Java Fun”, publisher : “manning”, price : 1000 } { name : “Oracle Fun”, publisher : “manning”, price : 1000 } { name : “Php Fun”, publisher : “Orelly”, price : 400 } Compute Average {$group : { _id : “$publisher”, avgPrice : {$avg : “$price” } }} { _id: manning, avgPrice :1000 }, { _id : Php,, avgPrice: 400 }
  • 16. $unwind Useful for doc containing array fields: Create docs from array entries Entries can be replace by value
  • 17. { publisher :“manning”, title: [“java”, “Php”], discount : 50% } $unwind {$unwind : $category} { publisher : manning, title: java, discount :50% }, { publisher : manning, title: Php, discount :50% }
  • 18. $redact Restrict access to docs based on doc fields to define privileges Useful terminology $$DESCEND, $$PRUNE, $$KEEP
  • 19. { _id :123, name : logo, security : “ANYONE”, Profit : { security : “MARKETING”, revenue : 500%, ProfitByCountry : { security : “BOARD_OF_DIRECTOR” PL : 800 % NO : 700 % DK : 600% SW : 500 % } } } $redact db.products.aggregate([ {$match : {name : “logo”}}, $redact : { $cond : { if : {$eq : …}, then : “$$DESCEND”, else : “$PRUNE } } ]) {...}
  • 21. Sharding Allow to store data across multiple machines. Ok but what for ? Database systems with large data sets and high throughput applications can challenge the capacity of a single server. High query rates can exhaust the CPU capacity of the server. Larger data sets exceed the storage capacity of a single machine Working set sizes larger than the system’s RAM stress the I/O capacity of disk drives.
  • 23. Replica Set Group of mongod processes that maintain the same data set. Provides redundancy and high availability, in a nutshell basis for all production deployments. Min 3 nodes required E.g.
  • 24. Document oriented db. Scale and performs well Provide powerful aggregration framework Tested on massive datasets. Support for map reduce. Summary