SlideShare a Scribd company logo
1 of 52
Download to read offline
MongoDB Internals
2
Agenda
Overview
Architecture
Storage Engines
Data Model
Query Engine
Client APIs
3
Norberto Leite
Developer Advocate
Twitter: @nleite
norberto@mongodb.com
Overview
5
MongoDB
GENERAL PURPOSE DOCUMENT DATABASE OPEN-SOURCE
MongoDB is Fully Featured
7
Three types: hash-based, range-based, location-aware
Increase or decrease capacity as you go
Automatic balancing
Horizontal Scalable
8
Replica Sets
Replica Set – 2 to 50 copies
Self-healing shard
Data Center Aware
Addresses availability considerations:
High Availability
Disaster Recovery
Maintenance
Workload Isolation: operational & analytics
Over
10,000,000
downloads
300,000 Students
for MongoDB
University
35,000
attendees to
MongoDB events
annually
Over 1,000
Partners
Over 2,000!
Paying Customers
MongoDB Architecture
11
MongoDB Architecture
Content
Repo
IoT Sensor
Backend
Ad Service
Customer
Analytics
Archive
MongoDB Query Language (MQL) + Native Drivers
MongoDB Document Data Model
MMAP V1WT 3rd Party
Available 3.2 Your own?
Management
Security
Beta
In-memoryEncrypted
12
MongoDB Architecture
MMAP V1WT 3rd Party
Officially supported Your own?Beta
In-memoryEncrypted
Storage Layer
•  Different workloads require
different storage strategies
•  Exposed by a Storage Engine
API
•  Provides more flexibility to your
deployments
13
MongoDB Architecture
MongoDB Document Data Model
BSON Collections Indexes
Data Model
Databases
14
MongoDB Architecture
MongoDB Query Language (MQL) + Native Drivers
Java Python PerlRuby
db.coll.insert({'name': 'Norberto'})
db.coll.update({'name': 'Norberto'}, {'$set':{'role': 'Developer Advocate'})
db.coll.find({'role': /^Developer/})
db.coll.find({}).skip(10).limit(20)
db.coll.aggregate({'$group': { '_id': '$role', "howmany": {"$sum":1} }})
db.serverStatus()
15
Distributed Database
Storage Engines
17
Varying Access & Storage Requirements
Modern
apps
Sensitive
data
Cost
effective
storage
High
concurrency
High
throughput
Low latency
Real-time
analytics
18
Storage Engine API
•  Allows to "plug-in" different storage engines
–  Different use cases require different performance characteristics
–  mmapv1 is not ideal for all workloads
–  More flexibility
•  Can mix storage engines on same replica set/sharded cluster
•  Opportunity to integrate further ( HDFS, native encrypted, hardware
optimized …)
19
WiredTiger is the New Default
WiredTiger – widely deployed with 3.0 – is
now the default storage engine for
MongoDB.
•  Best general purpose storage engine
•  7-10x better write throughput
•  Up to 80% compression
20
Good Old MMAPv1
MMAPv1 is our traditional storage engine
that allows a great deal of performance for
read heavy applications
•  Improved concurrency control
•  Great performance on read-heavy workloads
•  Data & Indexes memory mapped into virtual address
space
•  Data access is paged into RAM
•  OS evicts using LRU
•  More frequently used pages stay in RAM
21
Encrypted Storage Engine
Encrypted storage engine for end-to-end
encryption of sensitive data in regulated
industries
•  Reduces the management and performance
overhead of external encryption mechanisms
•  AES-256 Encryption, FIPS 140-2 option available
•  Key management: Local key management via keyfile
or integration with 3rd party key management
appliance via KMIP
•  Based on WiredTiger storage engine
•  Requires MongoDB Enterprise Advanced
22
In-Memory Storage Engine (Beta)
Handle ultra-high throughput with low latency
and high availability
•  Delivers the extreme throughput and
predictable latency required by the most
demanding apps in Adtech, finance, and
more.
•  Achieve data durability with replica set
members running disk-backed storage
engine
•  Available for beta testing and is
expected for GA in early 2016
Data Model
24
Terminology
RDBMS MongoDB
Database Database
Table Collection
Index Index
Row Document
Join Embedding & Linking
Document Data Model
Relational MongoDB
{
first_name: ‘Paul’,
surname: ‘Miller’,
city: ‘London’,
location:
[45.123,47.232],
cars: [
{ model: ‘Bentley’,
year: 1973,
value: 100000, … },
{ model: ‘Rolls Royce’,
year: 1965,
value: 330000, … }
]
}
26
Documents are Rich Data Structures
{
first_name: ‘Paul’,
surname: ‘Miller’,
cell: 447557505611,
city: ‘London’,
location: [45.123,47.232],
Profession: [‘banking’, ‘finance’,
‘trader’],
cars: [
{ model: ‘Bentley’,
year: 1973,
value: 100000, … },
{ model: ‘Rolls Royce’,
year: 1965,
value: 330000, … }
]
}
Fields can contain an array of sub-
documents
Fields
Typed field values
Fields can
contain arrays
String
Number
27
Document Model Benefits
Agility and flexibility
Data model supports business change
Rapidly iterate to meet new requirements
Intuitive, natural data representation
Eliminates ORM layer
Developers are more productive
Reduces the need for joins, disk seeks
Programming is more simple
Performance delivered at scale
{
_id : ObjectId("4c4ba5e5e8aabf3"),
employee_name: "Dunham, Justin",
department : "Marketing",
title : "Product Manager, Web",
report_up: "Neray, Graham",
pay_band: “C",
benefits : [
{ type : "Health",
plan : "PPO Plus" },
{ type : "Dental",
plan : "Standard" }
]
}
28
Dynamic Schemas
{
policyNum: 123,
type: auto,
customerId: abc,
payment: 899,
deductible: 500,
make: Taurus,
model: Ford,
VIN: 123ABC456,
}
{
policyNum: 456,
type: life,
customerId: efg,
payment: 240,
policyValue: 125000,
start: jan, 1995
end: jan, 2015
}
{
policyNum: 789,
type: home,
customerId: hij,
payment: 650,
deductible: 1000,
floodCoverage: No,
street: “10 Maple Lane”,
city: “Springfield”,
state: “Maryland”
}
BSON
•  Binary JSON serialization format
•  JSON with types
•  The language MongoDB speaks
http://bsonspec.org
BSON Data Types
•  String
•  Document
•  Array
•  Binary
•  ObjectId
•  Boolean
•  Date
•  Timestamp
•  Double (64 bit)
•  Long (64 bit)
•  Integer (32 bit)
•  Min Key
•  Max Key
•  Javascript
•  Javascript with Scope
•  Null value
http://bsonspec.org
Query Engine
Query Engine
Query Engine
Command Parser / Validator
Your Super Cool App
DML Write Operation Read Operation
Logging/Profiling
Authorization
Query Planner
Document Validation
Go and try it out:
https://jira.mongodb.org/browse/SERVER-18227
http://www.eliothorowitz.com/blog/2015/09/11/document-validation-and-what-dynamic-
schema-means/
https://docs.mongodb.org/manual/release-notes/3.2/#document-validation
Query Engine
Query Engine
Command Parser / Validator
Your Super Cool App
DML Write Operation Read Operation
Logging/Profiling
Authorization
Query Planner
35
CRUD Commands
•  find command
•  getMore command
•  killCursors command
•  insert command
•  update command
•  delete command
•  other commands
Find command parameters
•  find: <string>
•  filter: <document>
•  sort: <document>
•  projection: <document>
•  hint: <document|string>
•  skip: <int64>
•  limit: <int64>
•  batchSize: <int64>
•  singleBatch: <boolean>
•  comment: <string>
•  maxScan: <int32>
•  maxTimeMS: <int32>
•  min: <document>
•  returnKey: <bool>
•  showRecordId: <bool>
•  snapshot: <bool>
•  tailable: <bool>
•  oplogReply: <bool>
•  noCursorTimeout: <bool>
•  awaitData: <bool>
•  allowPartialResults: <bool>
•  readConcern: <document>
Query Operators
Conditional Operators
$all, $exists, $mod, $ne, $in, $nin, $nor, $or, $size, $type
$lt, $lte, $gt, $gte
// find all documents that contain name field
> db.teams.find( {name: {$exists: true }} )
// find names using regular expressions
> db.names.find( {last: /^Nor*/i } )
// count people by city
> db.teams.find( {city: "Madrid"} ).count()
Write Operators
Field $set, $unset, $mul, $min, $max ,$inc, $currentDate, $setOnInsert
Array	$push,	$pop,	$addToSet,	$pull,	$	
Modifiers	$each,	$slice,	$sort,	$posi6on
// Increment value by one
>db.events.update({_id:1}, {attendees: {$inc: 1}} )
// set array on insert
> db.names.update( {name: 'Bryan'}, { $setOnInsert: {talks:[0,0,0,0]}},
{upsert:true} )
// unset a field
> db.names.update( {name: "Bryan"}, {$unset: {mug_member: "" }})
Indexes
// Index nested documents
> db.customers.ensureIndex( “policies.agent”:1 )
> db.customers.find({‘policies.agent’:’Fred’})
// geospatial index
> db.customers.ensureIndex( “property.location”: “2d” )
> db.customers.find( “property.location” : { $near : [22,42] } )
// text index
> db.customers.ensureIndex( “policies.notes”: “text” )
Partial Indexes
Go and try it out:
https://docs.mongodb.org/manual/release-notes/3.2/#partial-indexes
Client APIs
Client APIs
//java maps
Document query = new Document("_id", "PSG");
Map<Object> m = collection.find(query).first();
Date established = (Date)m.get("established");
#python dictionaries
query = {'_id': 'PSG'}
document = collection.find_one(query)
established = document['established'].year
#ruby hashmaps
query = {:_id=> 'PSG'}
document = collection.find_one(query)
date = document[:established]
43
Client APIs
Your App
Driver
Replica Set
Here we speak your
programing language
(java, python c …)
Here we speak BSON
Driver is responsible from
serializing your language
objects into the proper
BSON commands
BSON
44
Morphia
MEAN Stack
Java Python PerlRuby
Support for the most popular languages and frameworks
Drivers & Ecosystem
45
Analytics & BI Integration
46
MongoDB Connector for BI
Visualize and explore multi-dimensional documents
using SQL-based BI tools. The connector does the
following:
•  Provides the BI tool with the schema of the
MongoDB collection to be visualized
•  Translates SQL statements issued by the
BI tool into equivalent MongoDB queries
that are sent to MongoDB for processing
•  Converts the results into the tabular format
expected by the BI tool, which can then
visualize the data based on user
requirements
47
Improved In-Database Analytics & Search
New Aggregation operators extend options for
performing analytics and ensure that answers are
delivered quickly and simply with lower developer
complexity
•  Array operators: $slice, $arrayElemAt,
$concatArrays, $filter, $min, $max, $avg, $sum,
and more
•  New mathematical operators: $stdDevSamp,
$stdDevPop, $sqrt, $abs, $trunc, $ceil, $floor,
$log, $pow, $exp, and more
•  Random sample of documents: $sample
•  Case sensitive text search and support for
additional languages such as Arabic, Farsi,
Chinese, and more
Let's see some code!
49
What's Next?
•  Download the Whitepaper
–  https://www.mongodb.com/collateral/mongodb-3-2-whats-new
•  Read the Release Notes
–  https://docs.mongodb.org/manual/release-notes/3.2/
•  Not yet ready for production but download and try!
–  https://www.mongodb.org/downloads#development
•  Detailed blogs
–  https://www.mongodb.com/blog/
•  Feedback
–  MongoDB 3.2 Bug Hunt
•  https://www.mongodb.com/blog/post/announcing-the-mongodb-3-2-bug-hunt
–  https://jira.mongodb.org/
DISCLAIMER: MongoDB's product plans are for informational purposes only. MongoDB's plans may change and you
should not rely on them for delivery of a specific feature at a specific time.
50
Never Stop Learning
https://university.mongodb.com
51
Engineering	
Sales	&	Account	Management		 Finance	&	People	Opera6ons	
Pre-Sales	Engineering	 Marke6ng	
Join	the	Team	
View	all	jobs	and	apply:	hGp://grnh.se/pj10su
Obrigado!
Norberto Leite
Technical Evangelist
norberto@mongodb.com
@nleite

More Related Content

What's hot

HBase in Practice
HBase in PracticeHBase in Practice
HBase in Practicelarsgeorge
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBNodeXperts
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningPuneet Behl
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 
InnoDB Internal
InnoDB InternalInnoDB Internal
InnoDB Internalmysqlops
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architectureBishal Khanal
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Kai Zhao
 
MongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMydbops
 
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]MongoDB
 
MongoDB Atlas
MongoDB AtlasMongoDB Atlas
MongoDB AtlasMongoDB
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & FeaturesDataStax Academy
 
MongoDB World 2019: The Sights (and Smells) of a Bad Query
MongoDB World 2019: The Sights (and Smells) of a Bad QueryMongoDB World 2019: The Sights (and Smells) of a Bad Query
MongoDB World 2019: The Sights (and Smells) of a Bad QueryMongoDB
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQLJoel Brewer
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation FrameworkCaserta
 

What's hot (20)

HBase in Practice
HBase in PracticeHBase in Practice
HBase in Practice
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
InnoDB Internal
InnoDB InternalInnoDB Internal
InnoDB Internal
 
Mongodb basics and architecture
Mongodb basics and architectureMongodb basics and architecture
Mongodb basics and architecture
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
MongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To Transactions
 
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
 
MongoDB Atlas
MongoDB AtlasMongoDB Atlas
MongoDB Atlas
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
 
MongoDB World 2019: The Sights (and Smells) of a Bad Query
MongoDB World 2019: The Sights (and Smells) of a Bad QueryMongoDB World 2019: The Sights (and Smells) of a Bad Query
MongoDB World 2019: The Sights (and Smells) of a Bad Query
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQL
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 

Similar to MongodB Internals

Eagle6 mongo dc revised
Eagle6 mongo dc revisedEagle6 mongo dc revised
Eagle6 mongo dc revisedMongoDB
 
Eagle6 Enterprise Situational Awareness
Eagle6 Enterprise Situational AwarenessEagle6 Enterprise Situational Awareness
Eagle6 Enterprise Situational AwarenessMongoDB
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB
 
Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...Maxime Beugnet
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101MongoDB
 
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDBMongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDBMongoDB
 
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...MongoDB
 
Novedades de MongoDB 3.6
Novedades de MongoDB 3.6Novedades de MongoDB 3.6
Novedades de MongoDB 3.6MongoDB
 
Single View of the Customer
Single View of the Customer Single View of the Customer
Single View of the Customer MongoDB
 
Neue Features in MongoDB 3.6
Neue Features in MongoDB 3.6Neue Features in MongoDB 3.6
Neue Features in MongoDB 3.6MongoDB
 
Production deployment
Production deploymentProduction deployment
Production deploymentMongoDB
 
Webinar: Deploying MongoDB to Production in Data Centers and the Cloud
Webinar: Deploying MongoDB to Production in Data Centers and the CloudWebinar: Deploying MongoDB to Production in Data Centers and the Cloud
Webinar: Deploying MongoDB to Production in Data Centers and the CloudMongoDB
 
Webinar: How Banks Use MongoDB as a Tick Database
Webinar: How Banks Use MongoDB as a Tick DatabaseWebinar: How Banks Use MongoDB as a Tick Database
Webinar: How Banks Use MongoDB as a Tick DatabaseMongoDB
 
How sitecore depends on mongo db for scalability and performance, and what it...
How sitecore depends on mongo db for scalability and performance, and what it...How sitecore depends on mongo db for scalability and performance, and what it...
How sitecore depends on mongo db for scalability and performance, and what it...Antonios Giannopoulos
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaEvolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaMongoDB
 
Keynote - Speaker: Grigori Melnik
Keynote - Speaker: Grigori Melnik Keynote - Speaker: Grigori Melnik
Keynote - Speaker: Grigori Melnik MongoDB
 

Similar to MongodB Internals (20)

MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
 
Eagle6 mongo dc revised
Eagle6 mongo dc revisedEagle6 mongo dc revised
Eagle6 mongo dc revised
 
Eagle6 Enterprise Situational Awareness
Eagle6 Enterprise Situational AwarenessEagle6 Enterprise Situational Awareness
Eagle6 Enterprise Situational Awareness
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and Implications
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101
 
MongoDB Meetup
MongoDB MeetupMongoDB Meetup
MongoDB Meetup
 
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDBMongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
 
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
 
Novedades de MongoDB 3.6
Novedades de MongoDB 3.6Novedades de MongoDB 3.6
Novedades de MongoDB 3.6
 
Single View of the Customer
Single View of the Customer Single View of the Customer
Single View of the Customer
 
Neue Features in MongoDB 3.6
Neue Features in MongoDB 3.6Neue Features in MongoDB 3.6
Neue Features in MongoDB 3.6
 
Production deployment
Production deploymentProduction deployment
Production deployment
 
Webinar: Deploying MongoDB to Production in Data Centers and the Cloud
Webinar: Deploying MongoDB to Production in Data Centers and the CloudWebinar: Deploying MongoDB to Production in Data Centers and the Cloud
Webinar: Deploying MongoDB to Production in Data Centers and the Cloud
 
Webinar: How Banks Use MongoDB as a Tick Database
Webinar: How Banks Use MongoDB as a Tick DatabaseWebinar: How Banks Use MongoDB as a Tick Database
Webinar: How Banks Use MongoDB as a Tick Database
 
How sitecore depends on mongo db for scalability and performance, and what it...
How sitecore depends on mongo db for scalability and performance, and what it...How sitecore depends on mongo db for scalability and performance, and what it...
How sitecore depends on mongo db for scalability and performance, and what it...
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaEvolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
 
Keynote - Speaker: Grigori Melnik
Keynote - Speaker: Grigori Melnik Keynote - Speaker: Grigori Melnik
Keynote - Speaker: Grigori Melnik
 

More from Norberto Leite

Data Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel AvivData Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel AvivNorberto Leite
 
MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016Norberto Leite
 
Geospatial and MongoDB
Geospatial and MongoDBGeospatial and MongoDB
Geospatial and MongoDBNorberto Leite
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger InternalsNorberto Leite
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewNorberto Leite
 
MongoDB: Agile Combustion Engine
MongoDB: Agile Combustion EngineMongoDB: Agile Combustion Engine
MongoDB: Agile Combustion EngineNorberto Leite
 
MongoDB Capacity Planning
MongoDB Capacity PlanningMongoDB Capacity Planning
MongoDB Capacity PlanningNorberto Leite
 
Strongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible SchemasStrongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible SchemasNorberto Leite
 
Effectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEMEffectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEMNorberto Leite
 
Advanced applications with MongoDB
Advanced applications with MongoDBAdvanced applications with MongoDB
Advanced applications with MongoDBNorberto Leite
 

More from Norberto Leite (20)

Data Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel AvivData Modelling for MongoDB - MongoDB.local Tel Aviv
Data Modelling for MongoDB - MongoDB.local Tel Aviv
 
Avoid Query Pitfalls
Avoid Query PitfallsAvoid Query Pitfalls
Avoid Query Pitfalls
 
MongoDB and Spark
MongoDB and SparkMongoDB and Spark
MongoDB and Spark
 
Mongo db 3.4 Overview
Mongo db 3.4 OverviewMongo db 3.4 Overview
Mongo db 3.4 Overview
 
MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016MongoDB Certification Study Group - May 2016
MongoDB Certification Study Group - May 2016
 
Geospatial and MongoDB
Geospatial and MongoDBGeospatial and MongoDB
Geospatial and MongoDB
 
MongoDB WiredTiger Internals
MongoDB WiredTiger InternalsMongoDB WiredTiger Internals
MongoDB WiredTiger Internals
 
MongoDB 3.2 Feature Preview
MongoDB 3.2 Feature PreviewMongoDB 3.2 Feature Preview
MongoDB 3.2 Feature Preview
 
Mongodb Spring
Mongodb SpringMongodb Spring
Mongodb Spring
 
MongoDB on Azure
MongoDB on AzureMongoDB on Azure
MongoDB on Azure
 
MongoDB: Agile Combustion Engine
MongoDB: Agile Combustion EngineMongoDB: Agile Combustion Engine
MongoDB: Agile Combustion Engine
 
MongoDB Capacity Planning
MongoDB Capacity PlanningMongoDB Capacity Planning
MongoDB Capacity Planning
 
Spark and MongoDB
Spark and MongoDBSpark and MongoDB
Spark and MongoDB
 
Analyse Yourself
Analyse YourselfAnalyse Yourself
Analyse Yourself
 
Python and MongoDB
Python and MongoDB Python and MongoDB
Python and MongoDB
 
Strongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible SchemasStrongly Typed Languages and Flexible Schemas
Strongly Typed Languages and Flexible Schemas
 
Effectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEMEffectively Deploying MongoDB on AEM
Effectively Deploying MongoDB on AEM
 
Advanced applications with MongoDB
Advanced applications with MongoDBAdvanced applications with MongoDB
Advanced applications with MongoDB
 
MongoDB and Node.js
MongoDB and Node.jsMongoDB and Node.js
MongoDB and Node.js
 
MongoDB + Spring
MongoDB + SpringMongoDB + Spring
MongoDB + Spring
 

Recently uploaded

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 

Recently uploaded (20)

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 

MongodB Internals

  • 3. 3 Norberto Leite Developer Advocate Twitter: @nleite norberto@mongodb.com
  • 5. 5 MongoDB GENERAL PURPOSE DOCUMENT DATABASE OPEN-SOURCE
  • 6. MongoDB is Fully Featured
  • 7. 7 Three types: hash-based, range-based, location-aware Increase or decrease capacity as you go Automatic balancing Horizontal Scalable
  • 8. 8 Replica Sets Replica Set – 2 to 50 copies Self-healing shard Data Center Aware Addresses availability considerations: High Availability Disaster Recovery Maintenance Workload Isolation: operational & analytics
  • 9. Over 10,000,000 downloads 300,000 Students for MongoDB University 35,000 attendees to MongoDB events annually Over 1,000 Partners Over 2,000! Paying Customers
  • 11. 11 MongoDB Architecture Content Repo IoT Sensor Backend Ad Service Customer Analytics Archive MongoDB Query Language (MQL) + Native Drivers MongoDB Document Data Model MMAP V1WT 3rd Party Available 3.2 Your own? Management Security Beta In-memoryEncrypted
  • 12. 12 MongoDB Architecture MMAP V1WT 3rd Party Officially supported Your own?Beta In-memoryEncrypted Storage Layer •  Different workloads require different storage strategies •  Exposed by a Storage Engine API •  Provides more flexibility to your deployments
  • 13. 13 MongoDB Architecture MongoDB Document Data Model BSON Collections Indexes Data Model Databases
  • 14. 14 MongoDB Architecture MongoDB Query Language (MQL) + Native Drivers Java Python PerlRuby db.coll.insert({'name': 'Norberto'}) db.coll.update({'name': 'Norberto'}, {'$set':{'role': 'Developer Advocate'}) db.coll.find({'role': /^Developer/}) db.coll.find({}).skip(10).limit(20) db.coll.aggregate({'$group': { '_id': '$role', "howmany": {"$sum":1} }}) db.serverStatus()
  • 17. 17 Varying Access & Storage Requirements Modern apps Sensitive data Cost effective storage High concurrency High throughput Low latency Real-time analytics
  • 18. 18 Storage Engine API •  Allows to "plug-in" different storage engines –  Different use cases require different performance characteristics –  mmapv1 is not ideal for all workloads –  More flexibility •  Can mix storage engines on same replica set/sharded cluster •  Opportunity to integrate further ( HDFS, native encrypted, hardware optimized …)
  • 19. 19 WiredTiger is the New Default WiredTiger – widely deployed with 3.0 – is now the default storage engine for MongoDB. •  Best general purpose storage engine •  7-10x better write throughput •  Up to 80% compression
  • 20. 20 Good Old MMAPv1 MMAPv1 is our traditional storage engine that allows a great deal of performance for read heavy applications •  Improved concurrency control •  Great performance on read-heavy workloads •  Data & Indexes memory mapped into virtual address space •  Data access is paged into RAM •  OS evicts using LRU •  More frequently used pages stay in RAM
  • 21. 21 Encrypted Storage Engine Encrypted storage engine for end-to-end encryption of sensitive data in regulated industries •  Reduces the management and performance overhead of external encryption mechanisms •  AES-256 Encryption, FIPS 140-2 option available •  Key management: Local key management via keyfile or integration with 3rd party key management appliance via KMIP •  Based on WiredTiger storage engine •  Requires MongoDB Enterprise Advanced
  • 22. 22 In-Memory Storage Engine (Beta) Handle ultra-high throughput with low latency and high availability •  Delivers the extreme throughput and predictable latency required by the most demanding apps in Adtech, finance, and more. •  Achieve data durability with replica set members running disk-backed storage engine •  Available for beta testing and is expected for GA in early 2016
  • 24. 24 Terminology RDBMS MongoDB Database Database Table Collection Index Index Row Document Join Embedding & Linking
  • 25. Document Data Model Relational MongoDB { first_name: ‘Paul’, surname: ‘Miller’, city: ‘London’, location: [45.123,47.232], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] }
  • 26. 26 Documents are Rich Data Structures { first_name: ‘Paul’, surname: ‘Miller’, cell: 447557505611, city: ‘London’, location: [45.123,47.232], Profession: [‘banking’, ‘finance’, ‘trader’], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } Fields can contain an array of sub- documents Fields Typed field values Fields can contain arrays String Number
  • 27. 27 Document Model Benefits Agility and flexibility Data model supports business change Rapidly iterate to meet new requirements Intuitive, natural data representation Eliminates ORM layer Developers are more productive Reduces the need for joins, disk seeks Programming is more simple Performance delivered at scale { _id : ObjectId("4c4ba5e5e8aabf3"), employee_name: "Dunham, Justin", department : "Marketing", title : "Product Manager, Web", report_up: "Neray, Graham", pay_band: “C", benefits : [ { type : "Health", plan : "PPO Plus" }, { type : "Dental", plan : "Standard" } ] }
  • 28. 28 Dynamic Schemas { policyNum: 123, type: auto, customerId: abc, payment: 899, deductible: 500, make: Taurus, model: Ford, VIN: 123ABC456, } { policyNum: 456, type: life, customerId: efg, payment: 240, policyValue: 125000, start: jan, 1995 end: jan, 2015 } { policyNum: 789, type: home, customerId: hij, payment: 650, deductible: 1000, floodCoverage: No, street: “10 Maple Lane”, city: “Springfield”, state: “Maryland” }
  • 29. BSON •  Binary JSON serialization format •  JSON with types •  The language MongoDB speaks http://bsonspec.org
  • 30. BSON Data Types •  String •  Document •  Array •  Binary •  ObjectId •  Boolean •  Date •  Timestamp •  Double (64 bit) •  Long (64 bit) •  Integer (32 bit) •  Min Key •  Max Key •  Javascript •  Javascript with Scope •  Null value http://bsonspec.org
  • 32. Query Engine Query Engine Command Parser / Validator Your Super Cool App DML Write Operation Read Operation Logging/Profiling Authorization Query Planner
  • 33. Document Validation Go and try it out: https://jira.mongodb.org/browse/SERVER-18227 http://www.eliothorowitz.com/blog/2015/09/11/document-validation-and-what-dynamic- schema-means/ https://docs.mongodb.org/manual/release-notes/3.2/#document-validation
  • 34. Query Engine Query Engine Command Parser / Validator Your Super Cool App DML Write Operation Read Operation Logging/Profiling Authorization Query Planner
  • 35. 35 CRUD Commands •  find command •  getMore command •  killCursors command •  insert command •  update command •  delete command •  other commands
  • 36. Find command parameters •  find: <string> •  filter: <document> •  sort: <document> •  projection: <document> •  hint: <document|string> •  skip: <int64> •  limit: <int64> •  batchSize: <int64> •  singleBatch: <boolean> •  comment: <string> •  maxScan: <int32> •  maxTimeMS: <int32> •  min: <document> •  returnKey: <bool> •  showRecordId: <bool> •  snapshot: <bool> •  tailable: <bool> •  oplogReply: <bool> •  noCursorTimeout: <bool> •  awaitData: <bool> •  allowPartialResults: <bool> •  readConcern: <document>
  • 37. Query Operators Conditional Operators $all, $exists, $mod, $ne, $in, $nin, $nor, $or, $size, $type $lt, $lte, $gt, $gte // find all documents that contain name field > db.teams.find( {name: {$exists: true }} ) // find names using regular expressions > db.names.find( {last: /^Nor*/i } ) // count people by city > db.teams.find( {city: "Madrid"} ).count()
  • 38. Write Operators Field $set, $unset, $mul, $min, $max ,$inc, $currentDate, $setOnInsert Array $push, $pop, $addToSet, $pull, $ Modifiers $each, $slice, $sort, $posi6on // Increment value by one >db.events.update({_id:1}, {attendees: {$inc: 1}} ) // set array on insert > db.names.update( {name: 'Bryan'}, { $setOnInsert: {talks:[0,0,0,0]}}, {upsert:true} ) // unset a field > db.names.update( {name: "Bryan"}, {$unset: {mug_member: "" }})
  • 39. Indexes // Index nested documents > db.customers.ensureIndex( “policies.agent”:1 ) > db.customers.find({‘policies.agent’:’Fred’}) // geospatial index > db.customers.ensureIndex( “property.location”: “2d” ) > db.customers.find( “property.location” : { $near : [22,42] } ) // text index > db.customers.ensureIndex( “policies.notes”: “text” )
  • 40. Partial Indexes Go and try it out: https://docs.mongodb.org/manual/release-notes/3.2/#partial-indexes
  • 42. Client APIs //java maps Document query = new Document("_id", "PSG"); Map<Object> m = collection.find(query).first(); Date established = (Date)m.get("established"); #python dictionaries query = {'_id': 'PSG'} document = collection.find_one(query) established = document['established'].year #ruby hashmaps query = {:_id=> 'PSG'} document = collection.find_one(query) date = document[:established]
  • 43. 43 Client APIs Your App Driver Replica Set Here we speak your programing language (java, python c …) Here we speak BSON Driver is responsible from serializing your language objects into the proper BSON commands BSON
  • 44. 44 Morphia MEAN Stack Java Python PerlRuby Support for the most popular languages and frameworks Drivers & Ecosystem
  • 45. 45 Analytics & BI Integration
  • 46. 46 MongoDB Connector for BI Visualize and explore multi-dimensional documents using SQL-based BI tools. The connector does the following: •  Provides the BI tool with the schema of the MongoDB collection to be visualized •  Translates SQL statements issued by the BI tool into equivalent MongoDB queries that are sent to MongoDB for processing •  Converts the results into the tabular format expected by the BI tool, which can then visualize the data based on user requirements
  • 47. 47 Improved In-Database Analytics & Search New Aggregation operators extend options for performing analytics and ensure that answers are delivered quickly and simply with lower developer complexity •  Array operators: $slice, $arrayElemAt, $concatArrays, $filter, $min, $max, $avg, $sum, and more •  New mathematical operators: $stdDevSamp, $stdDevPop, $sqrt, $abs, $trunc, $ceil, $floor, $log, $pow, $exp, and more •  Random sample of documents: $sample •  Case sensitive text search and support for additional languages such as Arabic, Farsi, Chinese, and more
  • 48. Let's see some code!
  • 49. 49 What's Next? •  Download the Whitepaper –  https://www.mongodb.com/collateral/mongodb-3-2-whats-new •  Read the Release Notes –  https://docs.mongodb.org/manual/release-notes/3.2/ •  Not yet ready for production but download and try! –  https://www.mongodb.org/downloads#development •  Detailed blogs –  https://www.mongodb.com/blog/ •  Feedback –  MongoDB 3.2 Bug Hunt •  https://www.mongodb.com/blog/post/announcing-the-mongodb-3-2-bug-hunt –  https://jira.mongodb.org/ DISCLAIMER: MongoDB's product plans are for informational purposes only. MongoDB's plans may change and you should not rely on them for delivery of a specific feature at a specific time.