SlideShare a Scribd company logo
1 of 78
Intro to MongoDB
Lauren Schaefer Ken Alger
@Lauren_Schaefer @KenWAlger
While you’re waiting, get
out your laptop and
connect to the Wi-Fi
with pw ato2019!
Bonus points for
following us on
Twitter
Parks and Recreation, Season 6, Episode 14
Parks and Recreation, Season 6, Episode 14
Intro to MongoDB
Lauren Schaefer Ken Alger
@Lauren_Schaefer @KenWAlger
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. Create a MongoDB cluster
2. Map terms & concepts from
SQL to MongoDB
3. Load sample data
4. Execute the CRUD operations
5. Tips & tricks
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. Create a MongoDB cluster
2. Map terms & concepts from
SQL to MongoDB
3. Load sample data
4. Execute the CRUD operations
5. Tips & tricks
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Sign up for MongoDB Atlas
http://bit.ly/MDB_Atlas
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Build a cluster
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Add discount code: ATOPEN100
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. Create a MongoDB cluster
2. Map terms & concepts from
SQL to MongoDB
3. Load sample data
4. Execute the CRUD operations
5. Tips & tricks
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
MongoDB stores data in documents
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Modeling data in MongoDB vs
SQL
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Modeling data in MongoDB vs
SQL
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
ID first_name surname cell city location_x location_y
1 Paul Miller 447557505611 London 45.123 47.232
Users
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Modeling data in MongoDB vs
SQL
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
ID first_name surname cell city location_x location_y
1 Paul Miller 447557505611 London 45.123 47.232
Users
ID user_id profession
10 1 banking
11 1 finance
12 1 trader
Professions
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Modeling data in MongoDB vs
SQL
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
ID user_id profession
10 1 banking
11 1 finance
12 1 trader
Professions
ID user_id model year
20 1 Bentley 1973
21 1 Rolls Royce 1965
Cars
ID first_name surname cell city location_x location_y
1 Paul Miller 447557505611 London 45.123 47.232
Users
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Modeling data in MongoDB vs
SQL
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
ID user_id profession
10 1 banking
11 1 finance
12 1 trader
Professions
ID user_id model year
20 1 Bentley 1973
21 1 Rolls Royce 1965
Cars
ID first_name surname cell city location_x location_y
1 Paul Miller 447557505611 London 45.123 47.232
Users
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Collections vs Tables
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
{
first_name: ”Lauren",
surname: ”Schaefer",
cell: ”1235552222",
city: ”Lancaster",
profession: [”software engineer", ”developer advocate"],
}
{
first_name: ”Sydney",
surname: ”Schaefer",
city: ”Lancaster",
school: ”Daisy’s Daycare”
}
ID first_name surname cell city location_x location_y
1 Paul Miller 447557505611 London 45.123 47.232
2 Lauren Schaefer 1235552222 Lancaster NULL NULL
3 Sydney Schaefer NULL Lancaster NULL NULL
UsersUsers
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
ID first_name surname cell city location_x location_y
1 Paul Miller 447557505611 London 45.123 47.232
2 Lauren Schaefer 1235552222 Lancaster NULL NULL
3 Sydney Schaefer NULL Lancaster NULL NULL
Collections vs Tables
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
{
first_name: ”Lauren",
surname: ”Schaefer",
cell: ”1235552222",
city: ”Lancaster",
profession: [”software engineer", ”developer advocate"],
}
{
first_name: ”Sydney",
surname: ”Schaefer",
city: ”Lancaster",
school: ”Daisy’s Daycare”
}
UsersUsers
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Collections vs Tables
ID first_name surname cell city location_x location_y
1 Paul Miller 447557505611 London 45.123 47.232
2 Lauren Schaefer 1235552222 Lancaster NULL NULL
3 Sydney Schaefer NULL Lancaster NULL NULL
{
first_name: "Paul",
surname: "Miller",
cell: "447557505611",
city: "London",
location: [45.123,47.232],
profession: ["banking", "finance", "trader"],
cars: [
{
model: "Bentley",
year: 1973
},
{
model: "Rolls Royce",
year: 1965
}
]
}
{
first_name: ”Lauren",
surname: ”Schaefer",
cell: ”1235552222",
city: ”Lancaster",
profession: [”software engineer", ”developer advocate"],
}
{
first_name: ”Sydney",
surname: ”Schaefer",
city: ”Lancaster",
school: ”Daisy’s Daycare”
}
UsersUsers
Schemaless
database
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Schemaless
database
Don’t panic!
Use schema validation.
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. Create a MongoDB cluster
2. Map terms & concepts from
SQL to MongoDB
3. Load sample data
4. Execute the CRUD operations
5. Tips & tricks
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Load the sample dataset
Document Row
{
...
a: “b”
...
}
ID a ...
1 b ...
2 ... ...
3 ... ...
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Document Row(s)
{
...
a: “b”
...
}
ID a ...
1 b ...
2 ... ...
3 ... ...
... ... ...
... ... ...
... ... ...
... ... ...
... ... ...
... ... ...
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Field Column
ID a ...
1 b ...
2 c ...
3 ... ...
{
...
a: “b”
...
}
{
...
a: “c”
...
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Collection Table
{
...
}
... ... ...
... ... ...
... ... ...
... ... ...
{
...
}
{
...
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Database Database
... ... ...
... ... ...
... ... ...
... ... ...
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
... ... ...
... ... ...
... ... ...
... ... ...
... ... ...
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Index Index
{
...
}
{
...
}
{
...
}
{
...
}
... ... ...
... ... ...
... ... ...
... ... ...
... ... ...
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
View View
{
...
}
... ... ...
... ... ...
... ... ...
... ... ...
{
...
}
{
...
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Embedding Join
{
...
a: “b”,
...
c: {
d: “e”
...
},
...
}
ID a ...
1 b ...
2 ... ...
3 ... ...
... d ...
1 e ...
... ... ...
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Database References Join
ID ... ...
1 ... ...
2 ... ...
3 ... ...
... ... ...
1 ... ...
... ... ...
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
$lookup
(Aggregation Pipeline)
Left Outer Join
ID ... ...
1 ... ...
2 ... ...
3 ... ...
... ... ...
1 ... ...
4 ... ...
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
$graphLookup
(Aggregation Pipeline)
Recursive Common
Table Expressions
{
...
}
... ... ...
... ... ...
... ... ...
... ... ...
{
...
}
{
...
}
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Multi-Document ACID
Transaction
Multi-Record ACID
Transaction
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
{
...
}
... ... ...
... ... ...
... ... ...
... ... ...
... ... ...
... ... ...
... ... ...
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Term mapping summary
x
Row Column Table Database Index Join Join
Left Outer
Join
Recursive
Common Table
Expressions
View Transaction
Document Field Collection Database Index Embedding
Database
References
$lookup $graphLookup View Transaction
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. Create a MongoDB cluster
2. Map terms & concepts from
SQL to MongoDB
3. Load sample data
4. Execute the CRUD operations
5. Tips & tricks
3. Navigate to https://jupyter.org/try
4. Click “Try JupyterLab”
5. Import the notebook you just downloaded
from GitHub
6. Execute all steps in “Set up”
Prepare for CRUD
1. Navigate to
http://bit.ly/ATO_MongoDB_Notebook
2. Save the file with pynb extension (NOT
txt)
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. Create a MongoDB cluster
2. Map terms & concepts from
SQL to MongoDB
3. Load sample data
4. Execute the CRUD operations
5. Tips & tricks
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Use Indexes for Read Speed
• Very important for reads.
• However, they come with overhead.
• New in MongoDB 4.2, Wildcard Indexes
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Indexes support the efficient
execution of queries in MongoDB.
Use Indexes for Read Speed
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Index Types in MongoDB
Single Field { karma: 1}
Compound Field { karma: 1, user_id: -1 }
Multikey { “address.postal_code”: 1 }
Geospatial
Text
Hashed
Wildcard
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Model Data Using Schema Design
Patterns
• Different way of modeling from the legacy database
paradigm.
• Schema Design is important.
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Why Do We CreateModels?
Ensure:
• Good performance
• Scalability
despite constraints
Hardware
• RAM faster than Disk
• Disk cheaper than RAM
• Network latency
• Reduce costs $$$
Database Server
• Maximum size for a document
Data set
• Size of data
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
• Frequency of Access
• Subset
• Approximation
• Extended Reference
Patterns byCategory
• Grouping
• Computed
• Bucket
• Outlier
• Representation
• Attribute
• Schema Versioning
• Document Versioning
• Tree
• Polymorphism
• Pre-Allocation
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Add a field to track the
schema version number, per
document
Does not have to exist for
version 1
Pattern:SchemaVersioning
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Problem:
Updating the schema of a database is:
• Not atomic
• Long operation
• May not want to update all documents, only do it on updates
SchemaVersioning Pattern
Use cases:
Practically any database that will go to production
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Solution:
Have a field keeping track of the schema version
SchemaVersioning Pattern –
Solution
Benefits:
Don't need to update all the documents at once
May not have to update documents until their next modification
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Reduce Aggravations with the
Aggregation Framework
• Use whenever possible
• Operations are done server-side
• Order of stages matters
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Aggregation
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
PIPELINE
ps ax | grep mongod | head 1
*nix command line pipe
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
PIPELINE
$match $group | $sort|
Input stream {} {} {} {} Result {} {} ...
MongoDB document pipeline
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. Create a MongoDB cluster
2. Map terms & concepts from
SQL to MongoDB
3. Load sample data
4. Execute the CRUD operations
5. Tips & tricks
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
1. Create a MongoDB cluster using
Atlas
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
2. Map terms from SQL to
MongoDB
x
Row Column Table Database Index Join Join
Left Outer
Join
Recursive
Common Table
Expressions
View Transaction
Document Field Collection Database Index Embedding
Database
References
$lookup $graphLookup View Transaction
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
3. Load sample data
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
4. Execute the CRUD operations
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
5. Tips & tricks
• Use Indexes for Read Speed
• Model Data Using Schema Design Patterns
• Reduce Aggravation with the Aggregation Pipeline
Don’t be Ron Swanson
(in this particular case)
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Change your mindset &
get the full value of MongoDB
Don’t be Ron Swanson
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Additional resources on data
modeling patterns
• Advanced Schema Design Patterns (webinar)
• Building with Patterns: A Summary (blog series)
• M320: Data Modeling (MongoDB University Course –
brand new!)
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Additional resources
• The MongoDB Docs
• JSON Schema Validation – Locking down your model
the smart way
• JSON Schema Validation - Checking Your Arrays
• M121: The MongoDB Aggregation Framework
Don’t be Ron Swanson
(in this particular case)
Change your mindset and get the
full value of MongoDB
Change your mindset &
get the full value of MongoDB
Get the slides on our Twitter
pages:
@KenWAlger
@Lauren_Schaefer
#AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
Please rate this
session in the
app!
Check out the
workshop at
2:15 today!

More Related Content

Similar to Intro to MongoDB (Extended Session)

MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & StitchMongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & StitchMongoDB
 
MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018Maxime Beugnet
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema DesignJoe Drumgoole
 
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant IdeasMongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant IdeasMongoDB
 
Jumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema DesignJumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema DesignMongoDB
 
Webinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsWebinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsMongoDB
 
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
 
OrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudOrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudLuigi Dell'Aquila
 
An Introduction to Mongo DB
An Introduction to Mongo DBAn Introduction to Mongo DB
An Introduction to Mongo DBWeAreEsynergy
 
QCon 2014 - How Shutl delivers even faster with Neo4j
QCon 2014 - How Shutl delivers even faster with Neo4jQCon 2014 - How Shutl delivers even faster with Neo4j
QCon 2014 - How Shutl delivers even faster with Neo4jVolker Pacher
 
Webinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops TeamsWebinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops TeamsMongoDB
 
Webinar: MongoDB and Analytics: Building Solutions with the MongoDB BI Connector
Webinar: MongoDB and Analytics: Building Solutions with the MongoDB BI ConnectorWebinar: MongoDB and Analytics: Building Solutions with the MongoDB BI Connector
Webinar: MongoDB and Analytics: Building Solutions with the MongoDB BI ConnectorMongoDB
 
The Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDBThe Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDBMongoDB
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbMongoDB
 
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And WhentranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And WhenDavid Peyruc
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your GraphVMware Tanzu
 
Webinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to BasicsWebinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to BasicsMongoDB
 
MongoDB and Spring - Two leaves of a same tree
MongoDB and Spring - Two leaves of a same treeMongoDB and Spring - Two leaves of a same tree
MongoDB and Spring - Two leaves of a same treeMongoDB
 

Similar to Intro to MongoDB (Extended Session) (20)

MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & StitchMongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
 
MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema Design
 
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant IdeasMongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
 
Jumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema DesignJumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema Design
 
Webinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsWebinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to Basics
 
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
 
OrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudOrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero Cloud
 
An Introduction to Mongo DB
An Introduction to Mongo DBAn Introduction to Mongo DB
An Introduction to Mongo DB
 
QCon 2014 - How Shutl delivers even faster with Neo4j
QCon 2014 - How Shutl delivers even faster with Neo4jQCon 2014 - How Shutl delivers even faster with Neo4j
QCon 2014 - How Shutl delivers even faster with Neo4j
 
Neotys conference
Neotys conferenceNeotys conference
Neotys conference
 
Webinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops TeamsWebinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops Teams
 
Webinar: MongoDB and Analytics: Building Solutions with the MongoDB BI Connector
Webinar: MongoDB and Analytics: Building Solutions with the MongoDB BI ConnectorWebinar: MongoDB and Analytics: Building Solutions with the MongoDB BI Connector
Webinar: MongoDB and Analytics: Building Solutions with the MongoDB BI Connector
 
The Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDBThe Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDB
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodb
 
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And WhentranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your Graph
 
Webinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to BasicsWebinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to Basics
 
MongoDB and Spring - Two leaves of a same tree
MongoDB and Spring - Two leaves of a same treeMongoDB and Spring - Two leaves of a same tree
MongoDB and Spring - Two leaves of a same tree
 
MongoDB + Spring
MongoDB + SpringMongoDB + Spring
MongoDB + Spring
 

More from All Things Open

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityAll Things Open
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best PracticesAll Things Open
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public PolicyAll Things Open
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...All Things Open
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashAll Things Open
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptAll Things Open
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?All Things Open
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractAll Things Open
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlowAll Things Open
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and SuccessAll Things Open
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with BackgroundAll Things Open
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblyAll Things Open
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksAll Things Open
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptAll Things Open
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramAll Things Open
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceAll Things Open
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamAll Things Open
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in controlAll Things Open
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsAll Things Open
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...All Things Open
 

More from All Things Open (20)

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of Observability
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best Practices
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil Nash
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScript
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and Success
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssembly
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in Haystacks
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit Intercept
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship Program
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache Beam
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
 

Recently uploaded

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 

Recently uploaded (20)

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 

Intro to MongoDB (Extended Session)

  • 1. Intro to MongoDB Lauren Schaefer Ken Alger @Lauren_Schaefer @KenWAlger While you’re waiting, get out your laptop and connect to the Wi-Fi with pw ato2019! Bonus points for following us on Twitter
  • 2. Parks and Recreation, Season 6, Episode 14
  • 3.
  • 4.
  • 5.
  • 6. Parks and Recreation, Season 6, Episode 14
  • 7. Intro to MongoDB Lauren Schaefer Ken Alger @Lauren_Schaefer @KenWAlger
  • 8. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer The story of this workshop is that it’s about MongoDB 1. Create a MongoDB cluster 2. Map terms & concepts from SQL to MongoDB 3. Load sample data 4. Execute the CRUD operations 5. Tips & tricks #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 9. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer The story of this workshop is that it’s about MongoDB 1. Create a MongoDB cluster 2. Map terms & concepts from SQL to MongoDB 3. Load sample data 4. Execute the CRUD operations 5. Tips & tricks #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 10. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Sign up for MongoDB Atlas http://bit.ly/MDB_Atlas
  • 11. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Build a cluster
  • 12. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Add discount code: ATOPEN100
  • 13. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer The story of this workshop is that it’s about MongoDB 1. Create a MongoDB cluster 2. Map terms & concepts from SQL to MongoDB 3. Load sample data 4. Execute the CRUD operations 5. Tips & tricks
  • 14. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents
  • 15. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 16. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 17. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 18. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 19. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 20. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 21. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 22. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer MongoDB stores data in documents { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 23. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Modeling data in MongoDB vs SQL { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] }
  • 24. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Modeling data in MongoDB vs SQL { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] } ID first_name surname cell city location_x location_y 1 Paul Miller 447557505611 London 45.123 47.232 Users
  • 25. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Modeling data in MongoDB vs SQL { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] } ID first_name surname cell city location_x location_y 1 Paul Miller 447557505611 London 45.123 47.232 Users ID user_id profession 10 1 banking 11 1 finance 12 1 trader Professions
  • 26. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Modeling data in MongoDB vs SQL { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] } ID user_id profession 10 1 banking 11 1 finance 12 1 trader Professions ID user_id model year 20 1 Bentley 1973 21 1 Rolls Royce 1965 Cars ID first_name surname cell city location_x location_y 1 Paul Miller 447557505611 London 45.123 47.232 Users
  • 27. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Modeling data in MongoDB vs SQL { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] } ID user_id profession 10 1 banking 11 1 finance 12 1 trader Professions ID user_id model year 20 1 Bentley 1973 21 1 Rolls Royce 1965 Cars ID first_name surname cell city location_x location_y 1 Paul Miller 447557505611 London 45.123 47.232 Users
  • 28. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Collections vs Tables { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] } { first_name: ”Lauren", surname: ”Schaefer", cell: ”1235552222", city: ”Lancaster", profession: [”software engineer", ”developer advocate"], } { first_name: ”Sydney", surname: ”Schaefer", city: ”Lancaster", school: ”Daisy’s Daycare” } ID first_name surname cell city location_x location_y 1 Paul Miller 447557505611 London 45.123 47.232 2 Lauren Schaefer 1235552222 Lancaster NULL NULL 3 Sydney Schaefer NULL Lancaster NULL NULL UsersUsers
  • 29. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer ID first_name surname cell city location_x location_y 1 Paul Miller 447557505611 London 45.123 47.232 2 Lauren Schaefer 1235552222 Lancaster NULL NULL 3 Sydney Schaefer NULL Lancaster NULL NULL Collections vs Tables { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] } { first_name: ”Lauren", surname: ”Schaefer", cell: ”1235552222", city: ”Lancaster", profession: [”software engineer", ”developer advocate"], } { first_name: ”Sydney", surname: ”Schaefer", city: ”Lancaster", school: ”Daisy’s Daycare” } UsersUsers
  • 30. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Collections vs Tables ID first_name surname cell city location_x location_y 1 Paul Miller 447557505611 London 45.123 47.232 2 Lauren Schaefer 1235552222 Lancaster NULL NULL 3 Sydney Schaefer NULL Lancaster NULL NULL { first_name: "Paul", surname: "Miller", cell: "447557505611", city: "London", location: [45.123,47.232], profession: ["banking", "finance", "trader"], cars: [ { model: "Bentley", year: 1973 }, { model: "Rolls Royce", year: 1965 } ] } { first_name: ”Lauren", surname: ”Schaefer", cell: ”1235552222", city: ”Lancaster", profession: [”software engineer", ”developer advocate"], } { first_name: ”Sydney", surname: ”Schaefer", city: ”Lancaster", school: ”Daisy’s Daycare” } UsersUsers
  • 32. Schemaless database Don’t panic! Use schema validation. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 33. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer The story of this workshop is that it’s about MongoDB 1. Create a MongoDB cluster 2. Map terms & concepts from SQL to MongoDB 3. Load sample data 4. Execute the CRUD operations 5. Tips & tricks
  • 34. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Load the sample dataset
  • 35. Document Row { ... a: “b” ... } ID a ... 1 b ... 2 ... ... 3 ... ... #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 36. Document Row(s) { ... a: “b” ... } ID a ... 1 b ... 2 ... ... 3 ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 37. Field Column ID a ... 1 b ... 2 c ... 3 ... ... { ... a: “b” ... } { ... a: “c” ... } #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 38. Collection Table { ... } ... ... ... ... ... ... ... ... ... ... ... ... { ... } { ... } #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 39. Database Database ... ... ... ... ... ... ... ... ... ... ... ... { ... } { ... } { ... } { ... } { ... } { ... } { ... } ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 40. Index Index { ... } { ... } { ... } { ... } ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 41. View View { ... } ... ... ... ... ... ... ... ... ... ... ... ... { ... } { ... } #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 42. Embedding Join { ... a: “b”, ... c: { d: “e” ... }, ... } ID a ... 1 b ... 2 ... ... 3 ... ... ... d ... 1 e ... ... ... ... #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 43. Database References Join ID ... ... 1 ... ... 2 ... ... 3 ... ... ... ... ... 1 ... ... ... ... ... { ... } { ... } { ... } { ... } { ... } { ... } { ... } #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 44. $lookup (Aggregation Pipeline) Left Outer Join ID ... ... 1 ... ... 2 ... ... 3 ... ... ... ... ... 1 ... ... 4 ... ... { ... } { ... } { ... } { ... } { ... } { ... } { ... } #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 45. $graphLookup (Aggregation Pipeline) Recursive Common Table Expressions { ... } ... ... ... ... ... ... ... ... ... ... ... ... { ... } { ... } #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 46. Multi-Document ACID Transaction Multi-Record ACID Transaction { ... } { ... } { ... } { ... } { ... } { ... } { ... } ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 47. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Term mapping summary x Row Column Table Database Index Join Join Left Outer Join Recursive Common Table Expressions View Transaction Document Field Collection Database Index Embedding Database References $lookup $graphLookup View Transaction
  • 48. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer The story of this workshop is that it’s about MongoDB 1. Create a MongoDB cluster 2. Map terms & concepts from SQL to MongoDB 3. Load sample data 4. Execute the CRUD operations 5. Tips & tricks
  • 49.
  • 50.
  • 51. 3. Navigate to https://jupyter.org/try 4. Click “Try JupyterLab” 5. Import the notebook you just downloaded from GitHub 6. Execute all steps in “Set up” Prepare for CRUD 1. Navigate to http://bit.ly/ATO_MongoDB_Notebook 2. Save the file with pynb extension (NOT txt) #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 52. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer The story of this workshop is that it’s about MongoDB 1. Create a MongoDB cluster 2. Map terms & concepts from SQL to MongoDB 3. Load sample data 4. Execute the CRUD operations 5. Tips & tricks
  • 53.
  • 54.
  • 55. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Use Indexes for Read Speed • Very important for reads. • However, they come with overhead. • New in MongoDB 4.2, Wildcard Indexes
  • 56. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Indexes support the efficient execution of queries in MongoDB. Use Indexes for Read Speed
  • 57. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Index Types in MongoDB Single Field { karma: 1} Compound Field { karma: 1, user_id: -1 } Multikey { “address.postal_code”: 1 } Geospatial Text Hashed Wildcard
  • 58. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Model Data Using Schema Design Patterns • Different way of modeling from the legacy database paradigm. • Schema Design is important.
  • 59. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Why Do We CreateModels? Ensure: • Good performance • Scalability despite constraints Hardware • RAM faster than Disk • Disk cheaper than RAM • Network latency • Reduce costs $$$ Database Server • Maximum size for a document Data set • Size of data
  • 60. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer • Frequency of Access • Subset • Approximation • Extended Reference Patterns byCategory • Grouping • Computed • Bucket • Outlier • Representation • Attribute • Schema Versioning • Document Versioning • Tree • Polymorphism • Pre-Allocation
  • 61. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Add a field to track the schema version number, per document Does not have to exist for version 1 Pattern:SchemaVersioning
  • 62. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Problem: Updating the schema of a database is: • Not atomic • Long operation • May not want to update all documents, only do it on updates SchemaVersioning Pattern Use cases: Practically any database that will go to production
  • 63. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Solution: Have a field keeping track of the schema version SchemaVersioning Pattern – Solution Benefits: Don't need to update all the documents at once May not have to update documents until their next modification
  • 64. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Reduce Aggravations with the Aggregation Framework • Use whenever possible • Operations are done server-side • Order of stages matters
  • 65. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Aggregation
  • 66. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer PIPELINE ps ax | grep mongod | head 1 *nix command line pipe
  • 67. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer PIPELINE $match $group | $sort| Input stream {} {} {} {} Result {} {} ... MongoDB document pipeline
  • 68. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer The story of this workshop is that it’s about MongoDB 1. Create a MongoDB cluster 2. Map terms & concepts from SQL to MongoDB 3. Load sample data 4. Execute the CRUD operations 5. Tips & tricks
  • 69. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer 1. Create a MongoDB cluster using Atlas
  • 70. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer 2. Map terms from SQL to MongoDB x Row Column Table Database Index Join Join Left Outer Join Recursive Common Table Expressions View Transaction Document Field Collection Database Index Embedding Database References $lookup $graphLookup View Transaction
  • 71. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer 3. Load sample data
  • 72. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer 4. Execute the CRUD operations
  • 73. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer 5. Tips & tricks • Use Indexes for Read Speed • Model Data Using Schema Design Patterns • Reduce Aggravation with the Aggregation Pipeline
  • 74. Don’t be Ron Swanson (in this particular case) #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 75. Change your mindset & get the full value of MongoDB Don’t be Ron Swanson #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer
  • 76. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Additional resources on data modeling patterns • Advanced Schema Design Patterns (webinar) • Building with Patterns: A Summary (blog series) • M320: Data Modeling (MongoDB University Course – brand new!)
  • 77. #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Additional resources • The MongoDB Docs • JSON Schema Validation – Locking down your model the smart way • JSON Schema Validation - Checking Your Arrays • M121: The MongoDB Aggregation Framework
  • 78. Don’t be Ron Swanson (in this particular case) Change your mindset and get the full value of MongoDB Change your mindset & get the full value of MongoDB Get the slides on our Twitter pages: @KenWAlger @Lauren_Schaefer #AllThingsOpen #MongoDB @KenWAlger @Lauren_Schaefer Please rate this session in the app! Check out the workshop at 2:15 today!

Editor's Notes

  1. Parks N Rec Season 6, episode 14
  2. http://www.breathtakingandinappropriate.com/2014/09/ron-swanson-has-no-time-for-frozen.html
  3. http://www.breathtakingandinappropriate.com/2014/09/ron-swanson-has-no-time-for-frozen.html
  4. http://www.breathtakingandinappropriate.com/2014/09/ron-swanson-has-no-time-for-frozen.html
  5. 3 problems Snail mail is way slower than posting the review to yelp where it will be instantly available The business he’s reviewing may never open the review No one else will benefit from the review
  6. At a high level, a cluster is a set of nodes where copies of your database will be stored.
  7. Download the MongoDB Server, run it, and manage it yourself. MongoDB Atlas – full managed database as a service
  8. JavaScript Object Notation MongoDB’s document model is not just a key-value store.
  9. Fields
  10. Field values
  11. Field values Strings
  12. 32-bit integer Double, longs, and decimals
  13. Geo-location.
  14. Fields can contain arrays. Here we see an array of Strings
  15. Fields can contain an array of subdocuments The value of a field can be a variety of types including objects, booleans, dates, and timestamps among others.
  16. When people talk about MongoDB, they’ll often use the term nonrelational. But that doesn’t mean we don’t store relationships. We just do it in a different way. Let’s walk through an example of how you would model this same data we have in the document on the left in SQL tables
  17. We store documents together in Collections. Collections roughly map to SQL tables.
  18. Not all documents have to have the same shape. We use the term polymorphic for this. As you can see, the Lauren document doesn’t have fields for location or cars, which is completely ok. We simply omit the fields from the document. In the SQL world, all rows in a table must have the same fields. Since we don’t have location data for Lauren, we have to use NULL values, which is typically discouraged.
  19. Now let’s take a look at the Sydney document. In this case, Sydney is a kid. She doesn’t have a lot of the data that Paul did. She’s missing a cell phone, location, profession, and car data. If we take a look at the Users table on the right, we can see that she has NULL values in her row just like Lauren did. Since Sydney is a kid, she has an extra field that neither the Paul document nor the Lauren document had. She has a school field. When you’re using documents, this is not a problem. You can simply add the field as we did here. Now when we look at the SQL table on the right, things get a bit more complicated. What do we have to do to store this data? We need to convince our DBA to add the field, take our database down, add the school column, add NULL values for every row that doesn’t have a value for school, and bring the database back up. It’s a bit messier.
  20. http://gph.is/28MrIOY
  21. http://gph.is/28MrIOY
  22. There are a few different ways to handle joins in MongoDB. In general, we recommend just embedding the information in a subdocument or an array that you would put in a separate tabled. The rule of thumb is that data that is accessed together should be stored together. So, if you’ll be accessing the information that you would have put in separate tables together most of the time, you should likely just embed it.
  23. As I just said, for many use cases, embedding in a single document is optimal. In some cases, it makes sense to store related information in separate documents, typically in different collections or databases. I’m not going to get into the details here of how to do this, but basically, you can create a reference from one document to another—very similar to how you would use foreign keys in SQL.
  24. Another option is to use $lookup. You can use $lookup when you are using the Aggregation Pipeline. $lookup is roughly equivalent to a left outer join. Again, I’m not going to get into the details of how $lookup works, but I want you to be aware that $lookup exists. Caveats Unsharded collection in the same database
  25. Model an org chart
  26. In MongoDB 4.0, transactions work across a replica set. Check out the keynote tomorrow for some exciting announcements around transactions. (MongoDB 4.2 extend support to transactions across a sharded deployment*)
  27. http://gph.is/1ZTM9ct 4 advantages in no particular order
  28. http://gph.is/1ZTM9ct 4 advantages in no particular order
  29. People pick up MongoDB and try to use it as a relational DB are the ones who fail and struggle. You can’t keep doing things in the same way. http://gph.is/XK6p3t Be explicit these are 3 things in no particular order.
  30. People pick up MongoDB and try to use it as a relational DB are the ones who fail and struggle. You can’t keep doing things in the same way. http://gph.is/XK6p3t Be explicit these are 3 things in no particular order.
  31. A database index is a data structure which improves the speed of data retrieval operations on a database. MongoDB supports a wide variety of indexes, which I’ll get into further here shortly. One question I get a lot is, “If indexes improve the speed of queries, why don’t I just index every field?” Well, indexes come at a cost. Remember that I said that an index is a data structure. Indexes are not free as they have to be updated when new data is added. However, they greatly enhance the query performance, so there’s a balance to be struck there. If an appropriate index exists for a query, MongoDB can use the index to limit the number of documents it must inspect.
  32. Single Field – in addition to the _id field, user-defined asc/desc index can be created. Compound Field – user-defined indexes on multiple fields. Order is important. { karma: 1, user_id: -1} sorts the index first by Karma, then within each Karma score, sorts by user_id. Multikey – used to index on content stored inside arrays Geospatial – geospatial coordinate data indexes to provide efficient queries, such as ”Show me all restaurants within three miles of my office.” Text – support for searching for string content in a collection. Indexes do not store language specific stop words, like “the”, “a”, “or” and only store root words. Hashed – support for hashed bashed sharding. Wildcard – New in 4.2 supports queries against unknown or arbitrary fields
  33. Performance & scalability, "air" Before we get going, let's just answer why we create models. In a perfect world, you don't really have to model. I mean if everything is super fast and resources are abundant, you really don't care where and how data is stored Every day I get up I don't make plans on how I will breathe air. However if you go to space or under water, you will need a "design" that will let you get the amount of air you need.
  34. Instead of using a "version" field, we could discover the version number based on fields
  35. - Few million references would not even fit into an embedded array. And if it did, you would not want to construct a query by passing a million values to the $in operator.
  36. The Aggregation Pipeline is similar in concept to a funnel. A bunch of documents start at the top of the funnel, or left side here, a series of operations are performed on the documents, and the results come out at the end. In this example, we have a bunch of different documents on the left, we do a match for all documents that have red diamonds, which reduces our dataset. We do a project stage which allows us to reshape our documents. In this example we’re reshaping the snow flake and triangle to be a square, regardless of color of those shapes. Then we do a $lookup stage, which is a JOIN operation. Finally in this example, we do a group stage and group items based on the color of the square.
  37. This is similar in concept to the Unix pipeline. Here we’re getting the running processes, searching for the mongod process, and printing out the first line of the data.
  38. In the MongoDB Aggregation Framework, and it’s pipeline, instead of *nix commands, it's stages and what's going through them are documents. We’ll take a look at some of the stages today, but this is a big topic overall.
  39. http://gph.is/XK6p3t
  40. https://giphy.com/gifs/dancing-parks-and-recreation-ron-swanson-iOz3p2txHIo4U
  41. https://giphy.com/gifs/dancing-parks-and-recreation-ron-swanson-iOz3p2txHIo4U