Does NoSQL feel like a bunch of NoSense to you? If so, you don’t want to miss this webinar!
In Back to Basics, we’ll teach you the fundamentals of the world’s most popular NoSQL database, MongoDB.
We'll start with a brief overview of how data is stored in MongoDB and compare that to the legacy table-based (relational) structure you may be used to. After that, we will dive deep into a demo! The demo will include:
- How to create a MongoDB database using MongoDB Atlas (for free!)
- A walk through the basic CRUD (create, read, update, and delete) operations
- Some tips and tricks for better efficiency/productivity
After this webinar, you'll be able to confidently use MongoDB to build your next app.
41. #BackToBasics #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
42. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. MongoDB terms & concepts
2. Free MongoDB Atlas Cluster
3. CRUD operations
4. Tips & tricks
5. $100 Atlas credits
43.
44.
45. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. MongoDB terms & concepts
2. Free MongoDB Atlas Cluster
3. CRUD operations
4. Tips & tricks
5. $100 Atlas credits
46.
47.
48. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
The story of this workshop is that
it’s about MongoDB
1. MongoDB terms & concepts
2. Free MongoDB Atlas Cluster
3. CRUD operations
4. Tips & tricks
5. $100 Atlas credits
49.
50.
51. #BackToBasics #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
52. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
Indexes support the efficient
execution of queries in MongoDB.
Use Indexes for Read Speed
53. #BackToBasics #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
54. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
Model Data Using Schema Design Patterns
• Different way of modeling from the legacy database
paradigm.
• Schema Design is important.
55. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
Why Do We Create Models?
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
57. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
Add a field to track the
schema version number, per
document
Does not have to exist for
version 1
Pattern: Schema Versioning
58. #BackToBasics #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
Schema Versioning Pattern
Use cases:
Practically any database that will go to production
59. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
Solution:
Have a field keeping track of the schema version
Schema Versioning Pattern –
Solution
Benefits:
Don't need to update all the documents at once
May not have to update documents until their next modification
60. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
Reduce Aggravations with the
Aggregation Framework
• Use whenever possible
• Operations are done server-side
• Order of stages matters
75. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
4. Tips & tricks
• Use Indexes for Read Speed
• Model Data Using Schema Design Patterns
• Reduce Aggravation with the Aggregation Pipeline
77. Don’t be Ron Swanson
(in this particular case)
#MongoDB @KenWAlger @Lauren_Schaefer#BackToBasics
78. Change your mindset &
get the full value of MongoDB
Don’t be Ron Swanson
#MongoDB @KenWAlger @Lauren_Schaefer#BackToBasics
79. #BackToBasics #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!)
80. #BackToBasics #MongoDB @KenWAlger @Lauren_Schaefer
Additional resources
• The MongoDB Docs
• Quick Start blog series in a variety of programming
languages
• JSON Schema Validation – Locking down your model the
smart way
• JSON Schema Validation - Checking Your Arrays
• M121: The MongoDB Aggregation Framework
81. 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
#MongoDB @KenWAlger @Lauren_Schaefer#BackToBasics