SlideShare una empresa de Scribd logo
1 de 58
Engineer
Bryan Reinero
@blimpyacht
Relational to MongoDB
Unhelpful Terms
• NoSQL
• Big Data
• Distributed
What’s the data model?
MongoDB
• Non-relational
• Scalable
• Highly available
• Full featured
• Document database
RDBMS MongoDB
Table, View ➜ Collection
Row ➜ Document
Index ➜ Index
Join ➜ Embedded Document
Foreign Key ➜ Reference
Partition ➜ Shard
Terminology
Sample Document
{
maker : "M.V. Agusta",
type : sportbike,
rake : 7,
trail : 3.93,
engine : {
type : "internal cumbustion",
layout : "inline"
cylinders : 4,
displacement : 750,
},
transmission : {
type : "cassette",
speeds : 6,
pattern : "sequential”,
ratios : [ 2.7, 1.94, 1.34, 1, 0.83, 0.64 ]
}
}
Relational DBs
• Attribute columns are valid for every row
• Duplicate rows are not allowed
• Every column has the same type and
same meaning
As a document store, MongoDB supports a
flexible schema
1st Normal Form: No
repeating groups
• Can't use equality to match elements
Name
Lumia
iPad
Galaxy
Categories
“electronics,hand held, smart phone”
“PDA,tablet”
“smart phone,tablet”
Product_id
1234
5678
91011
Maker
Nokia
Apple
Samsung
1st Normal Form: No
repeating groups
• Can't use equality to match elements
• Must use regular expressions to find data
Name
Lumia
iPad
Galaxy
Categories
“electronics,hand held, smart phone”
“PDA,tablet”
“smart phone,tablet”
Product_id
1234
5678
91011
Maker
Nokia
Apple
Samsung
1st Normal Form: No
repeating groups
• Can't use equality to match elements
• Must use regular expressions to find data
• Aggregate functions are difficult
Name
Lumia
iPad
Galaxy
Categories
“electronics,hand held, smart phone”
“PDA,tablet”
“smart phone,tablet”
Product_id
1234
5678
91011
Maker
Nokia
Apple
Samsung
1st Normal Form: No
repeating groups
• Can't use equality to match elements
• Must use regular expressions to find data
• Aggregate functions are difficult
• Updating a specific element is difficult
Name
Lumia
iPad
Galaxy
Categories
“electronics,hand held, smart phone”
“PDA,tablet”
“smart phone,tablet”
Product_id
1234
5678
91011
Maker
Nokia
Apple
Samsung
The Tao of MongoDB
{ _id : ObjectId(),
maker : “Nokia”
name : “Lumia”,
categories : [
"electronics",
"handheld",
"smart phone"
]
}
The Tao of MongoDB
{ _id : ObjectId(),
maker : “Nokia”
name : “Lumia”,
categories : [
"electronics",
"handheld",
"smart phone"
]
}
// querying is easy
db.products.find( { "categories": ”handheld" } );
The Tao of MongoDB
{ _id : ObjectId(),
maker : “Nokia”
name : “Lumia”,
categories : [
"electronics",
"handheld",
"smart phone"
]
}
// querying is easy
db.products.find( { "categories": ”handheld" } );
// can be indexed
db.products.ensureIndex( { "categories”: 1 } );
The Tao of MongoDB
{ _id : ObjectId(),
maker : “Nokia”
name : “Lumia”,
categories : [
"electronics",
"handheld",
"smart phone"
]
}
// Updates are easy
db.products.update(
{ "categories": "electronics"},
{ $set: { "categories.$" : "consumer electronics" } }
);
The Tao of MongoDB
{ _id : ObjectId(),
maker : “Nokia”
name : “Lumia”,
categories : [
"electronics",
"handheld",
"smart phone"
]
}
db.products.aggregate(
{ $unwind : "$categories" },
{ $group : {
"_id" : "$categories", "counts" : { "$sum" : 1 }
}
}
);
The Tao of MongoDB
{ _id : ObjectId(),
maker : “Nokia”
name : “Lumia”,
categories : [
"electronics",
"handheld",
"smart phone"
]
}
db.products.aggregate(
{ $unwind : "$categories" },
{ $group : {
"_id" : "$categories", "counts" : { "$sum" : 1 }
}
}
);
Unwind the array
The Tao of MongoDB
{ _id : ObjectId(),
maker : “Nokia”
name : “Lumia”,
categories : [
"electronics",
"handheld",
"smart phone"
]
}
db.products.aggregate(
{ $unwind : "$categories" },
{ $group : {
"_id" : "$categories", "counts" : { "$sum" : 1 }
}
}
);
Unwind the array
Tally the occurrences
The Tao of MongoDB
"result" : [
{ "_id" : "smart phone”, "counts" : 1589 },
{ "_id" : "handheld”, "counts" : 2403 },
{ "_id" : "electronics”, "counts" : 4767 }
]
db.products.aggregate(
{ $unwind : "$categories" },
{ $group : {
"_id" : "$categories", "counts" : { "$sum" : 1 }
}
}
);
Meh, big deal…. Right?
Aren’t nested structures just a pre-joined schema?
• I could use an adjacency list
• I could use an intersection table
Goals of Normalization
• Model data an understandable form
• Reduce fact redundancy and data
inconsistency
• Enforce integrity constraints
Performance is not a primary
goal
Normalize or Denormalize
Commonly held that denormalization is faster
Normalize or Denormalize
Commonly held that denormalization is faster
• Normalization can be fast, right?
Normalize or Denormalize
Commonly held that denormalization is faster
• Normalization can be fast, right? Requires
proper indexing, indexing effects write
performance
Normalize or Denormalize
Commonly held that denormalization is faster
• Normalization can be fast, right? Requires
proper indexing, indexing effects write
performance
• Does denormalization commit me to a join
strategy?
Normalize or Denormalize
Commonly held that denormalization is faster
• Normalization can be fast, right? Requires
proper indexing, indexing effects write
performance
• Does denormalization commit me to a join
strategy? Indexing overhead is a commitment
too
Normalize or Denormalize
Commonly held that denormalization is faster
• Normalization can be fast, right? Requires
proper indexing, indexing effects write
performance
• Does denormalization commit me to a join
strategy? Indexing overhead is a commitment
too
• Does denormalizaiton improve a finite set of
queries at the cost of several others?
Normalize or Denormalize
Commonly held that denormalization is faster
• Normalization can be fast, right? Requires
proper indexing, indexing effects write
performance
• Does denormalization commit me to a join
strategy? Indexing overhead is a commitment
too
• Does denormalizaiton improve a finite set of
queries at the cost of several others? MongoDB
works best in service to an application
Object–Relational
Impedance Mismatch
• Inheritance hierarchies
• Polymorphic associations
Table Per Subclass
Vehicles
vin
registration
maker
Motorcycle
Engine
rake
trial Racebike
racing number
class
team
rider
Table Per Subclass
Vehicles
- electric
- car
- bus
- motorcycle
- internal combustion
-motorcycle
- aircraft
- human powered
- bicycle
- skateboard
-horsedrawn
Table Per Concrete Class
• Each class is mapped to a separate table
• Inherited fields are present in each class’ table
• Can’t support polymorphic relationships
Table Per Concrete Class
• Each class is mapped to a separate table
• Inherited fields are present in each class’ table
• Can’t support polymorphic relationships
SELECT maker FROM Motorcycles WHERE Motorcycles.country =
"Italy"
UNION
SELECT maker FROM Automobiles WHERE Automobiles.country =
"Italy"
Table Per Class Family
• Classes mapped to a single table
Name
F4
A104
Triton 95
Type
sportbike
helicopter
submarine
Vehicle_id
1234
5678
91011
Maker
M.V
Agusta
M.V.
Agusta
Triton
Table Per Class Family
• Classes mapped to a single table
• Discriminator column to identify class
discriminator
Name
F4
A104
Triton 95
Type
sportbike
helicopter
submarine
Vehicle_id
1234
5678
91011
Maker
M.V
Agusta
M.V.
Agusta
Triton
Table Per Class Family
• Classes mapped to a single table
• Discriminator column to identify class
• Many empty columns, nullability issues
Name
F4
A104
Triton 95
Type
sportbike
helicopter
submarine
Vehicle_id
1234
5678
91011
Maker
M.V
Agusta
M.V.
Agusta
Triton
Table Per Class Family
• Classes mapped to a single table
• Discriminator column to identify class
• Many empty columns, nullability issues
maker = “M.V.
Agusta”,
type = “sportbike”,
num_doors = 0,
wing_area = 0,
maximum_depth = 0
???Name
F4
A104
Triton 95
Type
sportbike
helicopter
submarine
Vehicle_id
1234
5678
91011
Maker
M.V
Agusta
M.V.
Agusta
Triton
The Tao of MongoDB
{ maker : "M.V. Agusta",
type : sportsbike,
engine : {
type : ”internal combustion",
cylinders: 4,
displacement : 750
},
rake : 7,
trail : 3.93
}
{ maker : "M.V. Agusta",
type : Helicopter
engine : {
type : "turboshaft"
layout : "axial”,
massflow : 1318
},
Blades : 4
undercarriage : "fixed"
}
The Tao of MongoDB
{ maker : "M.V. Agusta",
type : sportsbike,
engine : {
type : ”internal combustion",
cylinders: 4,
displacement : 750
},
rake : 7,
trail : 3.93
}
{ maker : "M.V. Agusta",
type : Helicopter,
engine : {
type : "turboshaft"
layout : "axial”,
massflow : 1318
},
Blades : 4,
undercarriage : "fixed"
}
Discriminator column
The Tao of MongoDB
{ maker : "M.V. Agusta",
type : sportsbike,
engine : {
type : ”internal combustion",
cylinders: 4,
displacement : 750
},
rake : 7,
trail : 3.93
}
{ maker : "M.V. Agusta",
type : Helicopter
engine : {
type : "turboshaft"
layout : "axial”,
massflow : 1318
},
Blades : 4,
undercarriage : "fixed"
}
Shared indexing strategy
The Tao of MongoDB
{ maker : "M.V. Agusta",
type : sportsbike,
engine : {
type : ”internal combustion",
cylinders: 4,
displacement : 750
},
rake : 7,
trail : 3.93
}
{ maker : "M.V. Agusta",
type : Helicopter
engine : {
type : "turboshaft"
layout : "axial”,
massflow : 1318
},
Blades : 4
undercarriage : "fixed"
}
Polymorphic attributes
Relaxed ACID
• Atomic operations at the Document level
Relaxed ACID
• Atomic operations at the Document level
• Consistency – strong / eventual
Replication
Relaxed ACID
• Atomic operations at the Document level
• Consistency – strong / eventual
• Isolation - read lock, write lock / logical
database
Relaxed ACID
• Atomic operations at the Document level
• Consistency – strong / eventual
• Isolation - read lock, write lock / logical
database
• Durability – write ahead journal,
replication
The Tao of MongoDB
• Document database
• Flexible schema
• Relaxed ACID
This favors denormalization.
What’s the consequence?
Scaling MongoDB
Client
Application
Single Instance
Or
Replica Set
MongoDB
Sharded cluster
Partitioning
• User defines shard key
• Shard key defines range of data
• Key space is like points on a line
• Range is a segment of that line
The Mechanism of Sharding
Complete Data Set
Define shard key on vehicle id
3456 56781234 45672345
The Mechanism of Sharding
Chunk Chunk
Define shard key on title
3456 56781234 45672345
The Mechanism of Sharding
Chunk Chunk ChunkChunk
Define shard key on vehicle id
3456 56781234 45672345
Chunk Chunk ChunkChunk
Shard 1 Shard 2 Shard 3 Shard 4
3456 56781234 45672345
Define shard key on vehicle id
Shard 1 Shard 2 Shard 3 Shard 4
Targeted
Operations
Client
mongos
Shard 1 Shard 2 Shard 3 Shard 4
Data Growth
Shard 1 Shard 2 Shard 3 Shard 4
Load Balancing
Relational if you need to
• Enforce data constraints
• Service a broad set of queries
• Minimize redundancy
The Tao of MongoDB
• Avoid ad-hoc queries
• Model data for use, not storage
• Index effectively, index efficiently
Engineer, 10gen
Bryan Reinero
@blimpyacht
Thank You

Más contenido relacionado

Destacado

Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...
Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...
Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...Fwdays
 
Design and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design ToolDesign and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design Tooltalk2harry
 
Rim Based Relational Database Design Tutorial September 2008
Rim Based Relational Database Design Tutorial September 2008Rim Based Relational Database Design Tutorial September 2008
Rim Based Relational Database Design Tutorial September 2008Abdul-Malik Shakir
 
Understanding Linked Data via EAV Model based Structured Descriptions
Understanding Linked Data via EAV Model based Structured DescriptionsUnderstanding Linked Data via EAV Model based Structured Descriptions
Understanding Linked Data via EAV Model based Structured DescriptionsKingsley Uyi Idehen
 
Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)Tâm
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)welcometofacebook
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMSkoolkampus
 
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Beat Signer
 

Destacado (11)

Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...
Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...
Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...
 
Design and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design ToolDesign and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design Tool
 
Eav Data Model Concepts
Eav Data Model ConceptsEav Data Model Concepts
Eav Data Model Concepts
 
Rim Based Relational Database Design Tutorial September 2008
Rim Based Relational Database Design Tutorial September 2008Rim Based Relational Database Design Tutorial September 2008
Rim Based Relational Database Design Tutorial September 2008
 
Understanding Linked Data via EAV Model based Structured Descriptions
Understanding Linked Data via EAV Model based Structured DescriptionsUnderstanding Linked Data via EAV Model based Structured Descriptions
Understanding Linked Data via EAV Model based Structured Descriptions
 
Entity Attribute Value (Eav)
Entity   Attribute   Value (Eav)Entity   Attribute   Value (Eav)
Entity Attribute Value (Eav)
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
 

Similar a Webinar: From Relational Databases to MongoDB - What You Need to Know

Webinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to KnowWebinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to KnowMongoDB
 
Webinar: MongoDB and Polyglot Persistence Architecture
Webinar: MongoDB and Polyglot Persistence ArchitectureWebinar: MongoDB and Polyglot Persistence Architecture
Webinar: MongoDB and Polyglot Persistence ArchitectureMongoDB
 
Polyglot Persistence
Polyglot PersistencePolyglot Persistence
Polyglot PersistenceBryan Reinero
 
Retail referencearchitecture productcatalog
Retail referencearchitecture productcatalogRetail referencearchitecture productcatalog
Retail referencearchitecture productcatalogMongoDB
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBAlex Zyl
 
David Bilík: Anko – modern way to build your layouts?
David Bilík: Anko – modern way to build your layouts?David Bilík: Anko – modern way to build your layouts?
David Bilík: Anko – modern way to build your layouts?mdevtalk
 
Oracle PIM: Phantasmal Item Descriptions in your Organization
Oracle PIM: Phantasmal Item Descriptions in your OrganizationOracle PIM: Phantasmal Item Descriptions in your Organization
Oracle PIM: Phantasmal Item Descriptions in your OrganizationAXIA Consulting Inc.
 
Webinar: Scaling MongoDB
Webinar: Scaling MongoDBWebinar: Scaling MongoDB
Webinar: Scaling MongoDBMongoDB
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide shareMike Ensor
 
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
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro outputTom Chen
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Le big data à l'épreuve des projets d'entreprise
Le big data à l'épreuve des projets d'entrepriseLe big data à l'épreuve des projets d'entreprise
Le big data à l'épreuve des projets d'entrepriseRubedo, a WebTales solution
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performanceoysteing
 

Similar a Webinar: From Relational Databases to MongoDB - What You Need to Know (20)

Webinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to KnowWebinar: From Relational Databases to MongoDB - What You Need to Know
Webinar: From Relational Databases to MongoDB - What You Need to Know
 
Webinar: MongoDB and Polyglot Persistence Architecture
Webinar: MongoDB and Polyglot Persistence ArchitectureWebinar: MongoDB and Polyglot Persistence Architecture
Webinar: MongoDB and Polyglot Persistence Architecture
 
Polyglot Persistence
Polyglot PersistencePolyglot Persistence
Polyglot Persistence
 
Retail referencearchitecture productcatalog
Retail referencearchitecture productcatalogRetail referencearchitecture productcatalog
Retail referencearchitecture productcatalog
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
David Bilík: Anko – modern way to build your layouts?
David Bilík: Anko – modern way to build your layouts?David Bilík: Anko – modern way to build your layouts?
David Bilík: Anko – modern way to build your layouts?
 
Oracle PIM: Phantasmal Item Descriptions in your Organization
Oracle PIM: Phantasmal Item Descriptions in your OrganizationOracle PIM: Phantasmal Item Descriptions in your Organization
Oracle PIM: Phantasmal Item Descriptions in your Organization
 
MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
 
Webinar: Scaling MongoDB
Webinar: Scaling MongoDBWebinar: Scaling MongoDB
Webinar: Scaling MongoDB
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide share
 
Dataweek-Talk-2014
Dataweek-Talk-2014Dataweek-Talk-2014
Dataweek-Talk-2014
 
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...
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Elasticsearch intro output
Elasticsearch intro outputElasticsearch intro output
Elasticsearch intro output
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Le big data à l'épreuve des projets d'entreprise
Le big data à l'épreuve des projets d'entrepriseLe big data à l'épreuve des projets d'entreprise
Le big data à l'épreuve des projets d'entreprise
 
کارگاه سئو
کارگاه سئوکارگاه سئو
کارگاه سئو
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
 
ElasticSearch Hands On
ElasticSearch Hands OnElasticSearch Hands On
ElasticSearch Hands On
 

Más de MongoDB

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
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump StartMongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB
 

Más de MongoDB (20)

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
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Último

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Webinar: From Relational Databases to MongoDB - What You Need to Know

  • 2. Unhelpful Terms • NoSQL • Big Data • Distributed What’s the data model?
  • 3. MongoDB • Non-relational • Scalable • Highly available • Full featured • Document database
  • 4. RDBMS MongoDB Table, View ➜ Collection Row ➜ Document Index ➜ Index Join ➜ Embedded Document Foreign Key ➜ Reference Partition ➜ Shard Terminology
  • 5. Sample Document { maker : "M.V. Agusta", type : sportbike, rake : 7, trail : 3.93, engine : { type : "internal cumbustion", layout : "inline" cylinders : 4, displacement : 750, }, transmission : { type : "cassette", speeds : 6, pattern : "sequential”, ratios : [ 2.7, 1.94, 1.34, 1, 0.83, 0.64 ] } }
  • 6. Relational DBs • Attribute columns are valid for every row • Duplicate rows are not allowed • Every column has the same type and same meaning As a document store, MongoDB supports a flexible schema
  • 7. 1st Normal Form: No repeating groups • Can't use equality to match elements Name Lumia iPad Galaxy Categories “electronics,hand held, smart phone” “PDA,tablet” “smart phone,tablet” Product_id 1234 5678 91011 Maker Nokia Apple Samsung
  • 8. 1st Normal Form: No repeating groups • Can't use equality to match elements • Must use regular expressions to find data Name Lumia iPad Galaxy Categories “electronics,hand held, smart phone” “PDA,tablet” “smart phone,tablet” Product_id 1234 5678 91011 Maker Nokia Apple Samsung
  • 9. 1st Normal Form: No repeating groups • Can't use equality to match elements • Must use regular expressions to find data • Aggregate functions are difficult Name Lumia iPad Galaxy Categories “electronics,hand held, smart phone” “PDA,tablet” “smart phone,tablet” Product_id 1234 5678 91011 Maker Nokia Apple Samsung
  • 10. 1st Normal Form: No repeating groups • Can't use equality to match elements • Must use regular expressions to find data • Aggregate functions are difficult • Updating a specific element is difficult Name Lumia iPad Galaxy Categories “electronics,hand held, smart phone” “PDA,tablet” “smart phone,tablet” Product_id 1234 5678 91011 Maker Nokia Apple Samsung
  • 11. The Tao of MongoDB { _id : ObjectId(), maker : “Nokia” name : “Lumia”, categories : [ "electronics", "handheld", "smart phone" ] }
  • 12. The Tao of MongoDB { _id : ObjectId(), maker : “Nokia” name : “Lumia”, categories : [ "electronics", "handheld", "smart phone" ] } // querying is easy db.products.find( { "categories": ”handheld" } );
  • 13. The Tao of MongoDB { _id : ObjectId(), maker : “Nokia” name : “Lumia”, categories : [ "electronics", "handheld", "smart phone" ] } // querying is easy db.products.find( { "categories": ”handheld" } ); // can be indexed db.products.ensureIndex( { "categories”: 1 } );
  • 14. The Tao of MongoDB { _id : ObjectId(), maker : “Nokia” name : “Lumia”, categories : [ "electronics", "handheld", "smart phone" ] } // Updates are easy db.products.update( { "categories": "electronics"}, { $set: { "categories.$" : "consumer electronics" } } );
  • 15. The Tao of MongoDB { _id : ObjectId(), maker : “Nokia” name : “Lumia”, categories : [ "electronics", "handheld", "smart phone" ] } db.products.aggregate( { $unwind : "$categories" }, { $group : { "_id" : "$categories", "counts" : { "$sum" : 1 } } } );
  • 16. The Tao of MongoDB { _id : ObjectId(), maker : “Nokia” name : “Lumia”, categories : [ "electronics", "handheld", "smart phone" ] } db.products.aggregate( { $unwind : "$categories" }, { $group : { "_id" : "$categories", "counts" : { "$sum" : 1 } } } ); Unwind the array
  • 17. The Tao of MongoDB { _id : ObjectId(), maker : “Nokia” name : “Lumia”, categories : [ "electronics", "handheld", "smart phone" ] } db.products.aggregate( { $unwind : "$categories" }, { $group : { "_id" : "$categories", "counts" : { "$sum" : 1 } } } ); Unwind the array Tally the occurrences
  • 18. The Tao of MongoDB "result" : [ { "_id" : "smart phone”, "counts" : 1589 }, { "_id" : "handheld”, "counts" : 2403 }, { "_id" : "electronics”, "counts" : 4767 } ] db.products.aggregate( { $unwind : "$categories" }, { $group : { "_id" : "$categories", "counts" : { "$sum" : 1 } } } );
  • 19. Meh, big deal…. Right? Aren’t nested structures just a pre-joined schema? • I could use an adjacency list • I could use an intersection table
  • 20. Goals of Normalization • Model data an understandable form • Reduce fact redundancy and data inconsistency • Enforce integrity constraints Performance is not a primary goal
  • 21. Normalize or Denormalize Commonly held that denormalization is faster
  • 22. Normalize or Denormalize Commonly held that denormalization is faster • Normalization can be fast, right?
  • 23. Normalize or Denormalize Commonly held that denormalization is faster • Normalization can be fast, right? Requires proper indexing, indexing effects write performance
  • 24. Normalize or Denormalize Commonly held that denormalization is faster • Normalization can be fast, right? Requires proper indexing, indexing effects write performance • Does denormalization commit me to a join strategy?
  • 25. Normalize or Denormalize Commonly held that denormalization is faster • Normalization can be fast, right? Requires proper indexing, indexing effects write performance • Does denormalization commit me to a join strategy? Indexing overhead is a commitment too
  • 26. Normalize or Denormalize Commonly held that denormalization is faster • Normalization can be fast, right? Requires proper indexing, indexing effects write performance • Does denormalization commit me to a join strategy? Indexing overhead is a commitment too • Does denormalizaiton improve a finite set of queries at the cost of several others?
  • 27. Normalize or Denormalize Commonly held that denormalization is faster • Normalization can be fast, right? Requires proper indexing, indexing effects write performance • Does denormalization commit me to a join strategy? Indexing overhead is a commitment too • Does denormalizaiton improve a finite set of queries at the cost of several others? MongoDB works best in service to an application
  • 28. Object–Relational Impedance Mismatch • Inheritance hierarchies • Polymorphic associations
  • 30. Table Per Subclass Vehicles - electric - car - bus - motorcycle - internal combustion -motorcycle - aircraft - human powered - bicycle - skateboard -horsedrawn
  • 31. Table Per Concrete Class • Each class is mapped to a separate table • Inherited fields are present in each class’ table • Can’t support polymorphic relationships
  • 32. Table Per Concrete Class • Each class is mapped to a separate table • Inherited fields are present in each class’ table • Can’t support polymorphic relationships SELECT maker FROM Motorcycles WHERE Motorcycles.country = "Italy" UNION SELECT maker FROM Automobiles WHERE Automobiles.country = "Italy"
  • 33. Table Per Class Family • Classes mapped to a single table Name F4 A104 Triton 95 Type sportbike helicopter submarine Vehicle_id 1234 5678 91011 Maker M.V Agusta M.V. Agusta Triton
  • 34. Table Per Class Family • Classes mapped to a single table • Discriminator column to identify class discriminator Name F4 A104 Triton 95 Type sportbike helicopter submarine Vehicle_id 1234 5678 91011 Maker M.V Agusta M.V. Agusta Triton
  • 35. Table Per Class Family • Classes mapped to a single table • Discriminator column to identify class • Many empty columns, nullability issues Name F4 A104 Triton 95 Type sportbike helicopter submarine Vehicle_id 1234 5678 91011 Maker M.V Agusta M.V. Agusta Triton
  • 36. Table Per Class Family • Classes mapped to a single table • Discriminator column to identify class • Many empty columns, nullability issues maker = “M.V. Agusta”, type = “sportbike”, num_doors = 0, wing_area = 0, maximum_depth = 0 ???Name F4 A104 Triton 95 Type sportbike helicopter submarine Vehicle_id 1234 5678 91011 Maker M.V Agusta M.V. Agusta Triton
  • 37. The Tao of MongoDB { maker : "M.V. Agusta", type : sportsbike, engine : { type : ”internal combustion", cylinders: 4, displacement : 750 }, rake : 7, trail : 3.93 } { maker : "M.V. Agusta", type : Helicopter engine : { type : "turboshaft" layout : "axial”, massflow : 1318 }, Blades : 4 undercarriage : "fixed" }
  • 38. The Tao of MongoDB { maker : "M.V. Agusta", type : sportsbike, engine : { type : ”internal combustion", cylinders: 4, displacement : 750 }, rake : 7, trail : 3.93 } { maker : "M.V. Agusta", type : Helicopter, engine : { type : "turboshaft" layout : "axial”, massflow : 1318 }, Blades : 4, undercarriage : "fixed" } Discriminator column
  • 39. The Tao of MongoDB { maker : "M.V. Agusta", type : sportsbike, engine : { type : ”internal combustion", cylinders: 4, displacement : 750 }, rake : 7, trail : 3.93 } { maker : "M.V. Agusta", type : Helicopter engine : { type : "turboshaft" layout : "axial”, massflow : 1318 }, Blades : 4, undercarriage : "fixed" } Shared indexing strategy
  • 40. The Tao of MongoDB { maker : "M.V. Agusta", type : sportsbike, engine : { type : ”internal combustion", cylinders: 4, displacement : 750 }, rake : 7, trail : 3.93 } { maker : "M.V. Agusta", type : Helicopter engine : { type : "turboshaft" layout : "axial”, massflow : 1318 }, Blades : 4 undercarriage : "fixed" } Polymorphic attributes
  • 41. Relaxed ACID • Atomic operations at the Document level
  • 42. Relaxed ACID • Atomic operations at the Document level • Consistency – strong / eventual
  • 44. Relaxed ACID • Atomic operations at the Document level • Consistency – strong / eventual • Isolation - read lock, write lock / logical database
  • 45. Relaxed ACID • Atomic operations at the Document level • Consistency – strong / eventual • Isolation - read lock, write lock / logical database • Durability – write ahead journal, replication
  • 46. The Tao of MongoDB • Document database • Flexible schema • Relaxed ACID This favors denormalization. What’s the consequence?
  • 48. Partitioning • User defines shard key • Shard key defines range of data • Key space is like points on a line • Range is a segment of that line
  • 49. The Mechanism of Sharding Complete Data Set Define shard key on vehicle id 3456 56781234 45672345
  • 50. The Mechanism of Sharding Chunk Chunk Define shard key on title 3456 56781234 45672345
  • 51. The Mechanism of Sharding Chunk Chunk ChunkChunk Define shard key on vehicle id 3456 56781234 45672345
  • 52. Chunk Chunk ChunkChunk Shard 1 Shard 2 Shard 3 Shard 4 3456 56781234 45672345 Define shard key on vehicle id
  • 53. Shard 1 Shard 2 Shard 3 Shard 4 Targeted Operations Client mongos
  • 54. Shard 1 Shard 2 Shard 3 Shard 4 Data Growth
  • 55. Shard 1 Shard 2 Shard 3 Shard 4 Load Balancing
  • 56. Relational if you need to • Enforce data constraints • Service a broad set of queries • Minimize redundancy
  • 57. The Tao of MongoDB • Avoid ad-hoc queries • Model data for use, not storage • Index effectively, index efficiently

Notas del editor

  1. 1970’s design normalization
  2. Base class mapped to separate tableSupports polymorphic relationshipsRequires joinsIsn’t practical to map every class to the parent
  3. If the hierarchy grows joins on every derived classIsn’t practical to map every class to the parent
  4. Closer to denormalizationUNION required to cover the entire inheritance
  5. Closer to denormalizationUNION required to cover the entire inheritance
  6. Independent node operations
  7. Independent node operations
  8. Independent node operations
  9. Independent node operations
  10. Independent node operations
  11. Multi-row documentation