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.
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!

More Related Content

Similar to Intro to MongoDB Workshop

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
 
Jumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema DesignJumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema DesignMongoDB
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema DesignJoe Drumgoole
 
MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018Maxime Beugnet
 
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
 
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
 
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
 
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
 
OrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudOrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudLuigi Dell'Aquila
 
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
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbMongoDB
 
An Introduction to Mongo DB
An Introduction to Mongo DBAn Introduction to Mongo DB
An Introduction to Mongo DBWeAreEsynergy
 
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
 
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
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your GraphVMware Tanzu
 
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
 
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
 
Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBMongoDB
 

Similar to Intro to MongoDB Workshop (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
 
Jumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema DesignJumpstart: Introduction to Schema Design
Jumpstart: Introduction to Schema Design
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema Design
 
MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018
 
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
 
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
 
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
 
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
 
OrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudOrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero Cloud
 
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
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodb
 
An Introduction to Mongo DB
An Introduction to Mongo DBAn Introduction to Mongo DB
An Introduction to Mongo DB
 
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
 
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
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your Graph
 
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
 
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
 
Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDB
 

More from Lauren Hayward Schaefer

7 Ways to Build an API that Developers Will Hate
7 Ways to Build an API that Developers Will Hate7 Ways to Build an API that Developers Will Hate
7 Ways to Build an API that Developers Will HateLauren Hayward Schaefer
 
Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...
Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...
Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...Lauren Hayward Schaefer
 
10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...
10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...
10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...Lauren Hayward Schaefer
 
Intro to Technical Writing: Creating Content that Google and Readers will Love
Intro to Technical Writing: Creating Content that Google and Readers will LoveIntro to Technical Writing: Creating Content that Google and Readers will Love
Intro to Technical Writing: Creating Content that Google and Readers will LoveLauren Hayward Schaefer
 
Level Up Your Technical Career by Writing
Level Up Your Technical Career by WritingLevel Up Your Technical Career by Writing
Level Up Your Technical Career by WritingLauren Hayward Schaefer
 
5 Things I Learned While Modeling Data in MongoDB
5 Things I Learned While Modeling Data in MongoDB5 Things I Learned While Modeling Data in MongoDB
5 Things I Learned While Modeling Data in MongoDBLauren Hayward Schaefer
 
How to Raise Your Profile as a Developer (And Why You Should Bother!)
How to Raise Your Profile as a Developer (And Why You Should Bother!)How to Raise Your Profile as a Developer (And Why You Should Bother!)
How to Raise Your Profile as a Developer (And Why You Should Bother!)Lauren Hayward Schaefer
 
Building CI/CD Pipelines for MongoDB Realm Apps
Building CI/CD Pipelines for MongoDB Realm AppsBuilding CI/CD Pipelines for MongoDB Realm Apps
Building CI/CD Pipelines for MongoDB Realm AppsLauren Hayward Schaefer
 
From Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database MindsetFrom Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database MindsetLauren Hayward Schaefer
 
DevOps + MongoDB Realm Serverless Functions = 🤩
DevOps + MongoDB Realm Serverless Functions = 🤩DevOps + MongoDB Realm Serverless Functions = 🤩
DevOps + MongoDB Realm Serverless Functions = 🤩Lauren Hayward Schaefer
 
Stop! Don't make these mistakes in your document database!
Stop! Don't make these mistakes in your document database!Stop! Don't make these mistakes in your document database!
Stop! Don't make these mistakes in your document database!Lauren Hayward Schaefer
 
From Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database MindsetFrom Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database MindsetLauren Hayward Schaefer
 
From Tables to Documents -- Changing Your Database Mindset
From Tables to Documents -- Changing Your Database MindsetFrom Tables to Documents -- Changing Your Database Mindset
From Tables to Documents -- Changing Your Database MindsetLauren Hayward Schaefer
 
Look, Ma! No servers! Serverless application development with MongoDB Stitch
Look, Ma! No servers! Serverless application development with MongoDB StitchLook, Ma! No servers! Serverless application development with MongoDB Stitch
Look, Ma! No servers! Serverless application development with MongoDB StitchLauren Hayward Schaefer
 

More from Lauren Hayward Schaefer (20)

7 Ways to Build an API that Developers Will Hate
7 Ways to Build an API that Developers Will Hate7 Ways to Build an API that Developers Will Hate
7 Ways to Build an API that Developers Will Hate
 
Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...
Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...
Developer Advocacy: A Career Path for Those With a Passion for Code, Communit...
 
10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...
10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...
10 Best Practices for Writing Documentation (For Those Who Would Rather Do An...
 
Intro to Technical Writing: Creating Content that Google and Readers will Love
Intro to Technical Writing: Creating Content that Google and Readers will LoveIntro to Technical Writing: Creating Content that Google and Readers will Love
Intro to Technical Writing: Creating Content that Google and Readers will Love
 
Level Up Your Technical Career by Writing
Level Up Your Technical Career by WritingLevel Up Your Technical Career by Writing
Level Up Your Technical Career by Writing
 
How to Raise Your Profile Worksheet
How to Raise Your Profile WorksheetHow to Raise Your Profile Worksheet
How to Raise Your Profile Worksheet
 
5 Things I Learned While Modeling Data in MongoDB
5 Things I Learned While Modeling Data in MongoDB5 Things I Learned While Modeling Data in MongoDB
5 Things I Learned While Modeling Data in MongoDB
 
How to Raise Your Profile as a Developer (And Why You Should Bother!)
How to Raise Your Profile as a Developer (And Why You Should Bother!)How to Raise Your Profile as a Developer (And Why You Should Bother!)
How to Raise Your Profile as a Developer (And Why You Should Bother!)
 
Building CI/CD Pipelines for MongoDB Realm Apps
Building CI/CD Pipelines for MongoDB Realm AppsBuilding CI/CD Pipelines for MongoDB Realm Apps
Building CI/CD Pipelines for MongoDB Realm Apps
 
From Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database MindsetFrom Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database Mindset
 
NoSQL for Startups
NoSQL for StartupsNoSQL for Startups
NoSQL for Startups
 
Back to Basics 2021
Back to Basics 2021Back to Basics 2021
Back to Basics 2021
 
DevOps + MongoDB Realm Serverless Functions = 🤩
DevOps + MongoDB Realm Serverless Functions = 🤩DevOps + MongoDB Realm Serverless Functions = 🤩
DevOps + MongoDB Realm Serverless Functions = 🤩
 
Stop! Don't make these mistakes in your document database!
Stop! Don't make these mistakes in your document database!Stop! Don't make these mistakes in your document database!
Stop! Don't make these mistakes in your document database!
 
From Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database MindsetFrom Tables to Documents—Changing Your Database Mindset
From Tables to Documents—Changing Your Database Mindset
 
From Tables to Documents -- Changing Your Database Mindset
From Tables to Documents -- Changing Your Database MindsetFrom Tables to Documents -- Changing Your Database Mindset
From Tables to Documents -- Changing Your Database Mindset
 
Making #RemoteWork Actually Work
Making #RemoteWork Actually WorkMaking #RemoteWork Actually Work
Making #RemoteWork Actually Work
 
DevOps + MongoDB Serverless = 
DevOps + MongoDB Serverless = DevOps + MongoDB Serverless = 
DevOps + MongoDB Serverless = 
 
Does remote work *really* work?
Does remote work *really* work?Does remote work *really* work?
Does remote work *really* work?
 
Look, Ma! No servers! Serverless application development with MongoDB Stitch
Look, Ma! No servers! Serverless application development with MongoDB StitchLook, Ma! No servers! Serverless application development with MongoDB Stitch
Look, Ma! No servers! Serverless application development with MongoDB Stitch
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Intro to MongoDB Workshop

  • 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. 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!

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