SlideShare a Scribd company logo
1 of 48
An Introduction to Document
Databases with MongoDB
Brett Gray, Senior Consulting Engineer, MongoDB
Why am I here?
About a decade ago, three guys with a lot of industry experience got together and thought
“There must be a better way”. A better way to store data, that was more intuitive and more
natural…
Agenda
What is MongoDB?
Document Model
Query Language
Resiliency
MongoDB Ecosystem
Demo
Brett Gray
Senior Consulting Engineer
About Me
I’m a Senior Consulting Engineer in the Professional Services team at MongoDB.
In a previous life, I served on Submarines in the Royal Australian Navy and was a Principal Engineer at
Puppet…….I also have a Graduate Diploma of Brewing.
What is MongoDB?
What is MongoDB?
MongoDB is a cross-platform and open-source document-oriented general purpose database. As a document
database, MongoDB doesn’t use table-based structure, rather it uses JSON-like documents that have dynamic
schemas which it calls BSON.
Please keep in mind that NoSQL does not mean no relationships!
What is MongoDB?
Server written in C++ and C
Tools written in C++, C, Go, Java, and JavaScript
Binary packages are available for download at mongodb.com/downloads
Source code for the server is available at github.com/mongodb
Ready for deployment in the cloud, on VMs or on bare metal
What is MongoDB?
MongoDB was written to make it simple to store data.
• {"Key": "Value"}
Documents map naturally to common data structures in most popular programming languages
Schemas are dynamic. There’s no need for expensive migrations.
As new data is encountered, just store it. If the shape of data needs to change, then change it.
We are schema-flexible, but it is important to be consistent
What is MongoDB?
MongoDB is an ecosystem of products, including a database, visual data explorer, platform, and analytics tools to
make it easier than ever to develop your applications.
Document Model
Document Model
Not just key-
valueMongoDB’s document model is not just a key-value
store.
Rich document composition is possible, and
encouraged.
Store embedded objects, arrays, rich data types, and
more.
{
"title": "The Martian",
"year": 2015,
"runtime": 130,
"released": ISODate("2015-10-
02T00:00:00Z"),
"cast": [
"Kate Mara",
"Matt Damon",
"Jessica Chastain",
"Kristen Wiig"
]
}
Document Model
MongoDB RDBMS
Database Database
Collection Table
Index Index
Document Row
Field Column
Embedding, Linking, $lookup Join
…using a SQL Model
…using a Document Model
Document Model
It’s a natural way to think about data, and maps incredibly well to patterns we know and common types and
structures we use daily.
The schema should be modelled from how you access your data.
As highlighted, the schema is flexible, but you can use schema validation within in your application and within the
database to enforce your schema.
Query Language
MQL and Aggregation
Query Language
CREATE TABLE movies (
id MEDIUMINT NOT NULL
AUTO_INCREMENT,
title Varchar(30),
year Number,
rating Number,
PRIMARY KEY (id)
)
db.createCollection("movies")
Query Language
INSERT INTO movies(title,
year, rating) VALUES ("The
Shawshank Redemption", 10,
1994)
db.movies.insertOne({title:
"The Shawshank Redemption",
year: 1994, rating: 10})
Query Language
ALTER TABLE movies ADD cast
ARRAY
UPDATE movies SET cast =
["Morgan Freeman", "Tim
Robbins"] WHERE title = "The
Shawshank Redemption"
db.movies.updateOne(
{title: "The Shawshank
Redemption"},
{$set: { "cast": ["Morgan
Freeman", "Tim Robbins" ] } }
)
Query Language
ALTER TABLE movies ADD cast
ARRAY
UPDATE movies SET cast =
["Morgan Freeman", "Tim
Robbins"] WHERE title = "The
Shawshank Redemption"
db.movies.updateOne(
{title: "The Shawshank
Redemption"},
{$set: { "cast": ["Morgan
Freeman", "Tim Robbins" ] } }
)
Query Language
SELECT * FROM movies
SELECT * FROM movies WHERE
rating > 7
SELECT * FROM movies WHERE
rating > 7 LIMIT 1
SELECT * FROM movies WHERE
rating > 7 AND year > 1990
??
db.movies.find()
db.movies.find({rating: { $gt:
7 }})
db.movies.findOne({rating: {
$gt: 7 }}).limit(1)
db.movies.find({rating: { $gt:
7 }, year: { $gt: 1990 } })
db.movies.find({cast: "Morgan
Freeman"})
Query Language
CREATE INDEX
idx_movie_rating_desc ON
movies(rating DESC)
db.movies.createIndex({ rating:
-1 })
Query Language - Performance
Indexes support the efficient execution of queries in MongoDB.
Many index types
• Single Field
• Multikey
• Text
• Geospatial
• Hashed
• Compound
Query Language - Aggregation
A framework for data aggregation modelled on the concept of data processing pipelines.
Documents enter a multi-stage pipeline that transforms the documents into aggregated results.
Reduce the CPU cycles in processing your app, let MongoDB handle aggregation.
Results produced from aggregation lower in total byte size of your data, saving bandwidth.
Query Language - Aggregation
A framework for data aggregation modeled on the concept of data processing pipelines.
Documents enter a multi-stage pipeline that transforms the documents into aggregated results.
Query Language
Expressive
Intuitive
Logical
Resiliency
Resiliency – The Replica Set
Resiliency – The Replica Set
Your application talks to MongoDB through the
driver, which is constantly monitoring your replica
set health.
Internally, the replica set is monitoring health as
well, ready to react in case of emergency.
Resiliency - Reacting
Resiliency – The Replica Set
Your application talks to MongoDB through the
driver, which is constantly monitoring your replica
set health.
Internally, the replica set is monitoring health as
well, ready to react in case of emergency.
MongoDB Ecosystem
MongoDB Ecosystem
Compass
Atlas
Stitch
Charts
Ops Manager
Cloud Manager
Ecosystem - Compass
MongoDB’s GUI to explore and interact with your data.
Ecosystem - Atlas
Atlas – Infrastructure
Infrastructure managed by MongoDB
Updated with zero downtime
Available in AWS, GCP, and Azure
Atlas – Built in Security
TLS/SSL
Authentication and Authorization
IP Whitelists
User roles
VPC Peering (AWS and GCP)
AES-256 hardware encryption
Atlas – Graphs and Metrics
MongoDB
Hardware
Utilization
Performance
Atlas – Real Time Performance
Atlas – So Much More
Monitoring and Alerting
• Supports Third-Party integration
• Webhooks
• Email
• SMS
• PagerDuty
• Slack
Live Migration
Backups and Recovery
BI Connector
Ecosystem - Stitch
Ecosystem - Charts
Live Coding
Typing accuracy and mental faculty guaranteed to reduce by 37%!
Thank You!
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB

More Related Content

What's hot

MongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business InsightsMongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business Insights
MongoDB
 

What's hot (20)

Mongo db report
Mongo db reportMongo db report
Mongo db report
 
MongoDB World 2016: Poster Sessions eBook
MongoDB World 2016: Poster Sessions eBookMongoDB World 2016: Poster Sessions eBook
MongoDB World 2016: Poster Sessions eBook
 
Mongodb
MongodbMongodb
Mongodb
 
MongoDB Evenings Dallas: What's the Scoop on MongoDB & Hadoop
MongoDB Evenings Dallas: What's the Scoop on MongoDB & HadoopMongoDB Evenings Dallas: What's the Scoop on MongoDB & Hadoop
MongoDB Evenings Dallas: What's the Scoop on MongoDB & Hadoop
 
Mongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in BangaloreMongodb Training Tutorial in Bangalore
Mongodb Training Tutorial in Bangalore
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
 
Mango Database - Web Development
Mango Database - Web DevelopmentMango Database - Web Development
Mango Database - Web Development
 
mongodb_Introduction
mongodb_Introductionmongodb_Introduction
mongodb_Introduction
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?
MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?
MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business InsightsMongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business Insights
 
MongoDB World 2019: Raiders of the Anti-patterns: A Journey Towards Fixing Sc...
MongoDB World 2019: Raiders of the Anti-patterns: A Journey Towards Fixing Sc...MongoDB World 2019: Raiders of the Anti-patterns: A Journey Towards Fixing Sc...
MongoDB World 2019: Raiders of the Anti-patterns: A Journey Towards Fixing Sc...
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
MongoDB World 2019: MongoDB in Data Science: How to Build a Scalable Product ...
MongoDB World 2019: MongoDB in Data Science: How to Build a Scalable Product ...MongoDB World 2019: MongoDB in Data Science: How to Build a Scalable Product ...
MongoDB World 2019: MongoDB in Data Science: How to Build a Scalable Product ...
 
MongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and ImplicationsMongoDB Schema Design: Practical Applications and Implications
MongoDB Schema Design: Practical Applications and Implications
 
Accelerate Pharmaceutical R&D with Big Data and MongoDB
Accelerate Pharmaceutical R&D with Big Data and MongoDBAccelerate Pharmaceutical R&D with Big Data and MongoDB
Accelerate Pharmaceutical R&D with Big Data and MongoDB
 
Webinar: Elevate Your Enterprise Architecture with In-Memory Computing
Webinar: Elevate Your Enterprise Architecture with In-Memory ComputingWebinar: Elevate Your Enterprise Architecture with In-Memory Computing
Webinar: Elevate Your Enterprise Architecture with In-Memory Computing
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 

Similar to MongoDB.local Sydney: An Introduction to Document Databases with MongoDB

Everything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptxEverything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptx
75waytechnologies
 

Similar to MongoDB.local Sydney: An Introduction to Document Databases with MongoDB (20)

Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
 
Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answers
 
Everything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptxEverything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptx
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
how_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdfhow_can_businesses_address_storage_issues_using_mongodb.pdf
how_can_businesses_address_storage_issues_using_mongodb.pdf
 
how_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptxhow_can_businesses_address_storage_issues_using_mongodb.pptx
how_can_businesses_address_storage_issues_using_mongodb.pptx
 
Introduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQLIntroduction to MongoDB Basics from SQL to NoSQL
Introduction to MongoDB Basics from SQL to NoSQL
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptx
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
 
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYCHands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
 
Elasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparisonElasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparison
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
 
Techorama - Evolvable Application Development with MongoDB
Techorama  - Evolvable Application Development with MongoDBTechorama  - Evolvable Application Development with MongoDB
Techorama - Evolvable Application Development with MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
When to Use MongoDB
When to Use MongoDBWhen to Use MongoDB
When to Use MongoDB
 
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDBMongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Database Workshop Slides
Database Workshop SlidesDatabase Workshop Slides
Database Workshop Slides
 
Dataweek-Talk-2014
Dataweek-Talk-2014Dataweek-Talk-2014
Dataweek-Talk-2014
 

More from MongoDB

More from MongoDB (20)

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

Recently uploaded

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Recently uploaded (20)

Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
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
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
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
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
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
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 

MongoDB.local Sydney: An Introduction to Document Databases with MongoDB

  • 1.
  • 2. An Introduction to Document Databases with MongoDB Brett Gray, Senior Consulting Engineer, MongoDB
  • 3. Why am I here? About a decade ago, three guys with a lot of industry experience got together and thought “There must be a better way”. A better way to store data, that was more intuitive and more natural…
  • 4. Agenda What is MongoDB? Document Model Query Language Resiliency MongoDB Ecosystem Demo
  • 6. About Me I’m a Senior Consulting Engineer in the Professional Services team at MongoDB. In a previous life, I served on Submarines in the Royal Australian Navy and was a Principal Engineer at Puppet…….I also have a Graduate Diploma of Brewing.
  • 8. What is MongoDB? MongoDB is a cross-platform and open-source document-oriented general purpose database. As a document database, MongoDB doesn’t use table-based structure, rather it uses JSON-like documents that have dynamic schemas which it calls BSON. Please keep in mind that NoSQL does not mean no relationships!
  • 9. What is MongoDB? Server written in C++ and C Tools written in C++, C, Go, Java, and JavaScript Binary packages are available for download at mongodb.com/downloads Source code for the server is available at github.com/mongodb Ready for deployment in the cloud, on VMs or on bare metal
  • 10. What is MongoDB? MongoDB was written to make it simple to store data. • {"Key": "Value"} Documents map naturally to common data structures in most popular programming languages Schemas are dynamic. There’s no need for expensive migrations. As new data is encountered, just store it. If the shape of data needs to change, then change it. We are schema-flexible, but it is important to be consistent
  • 11. What is MongoDB? MongoDB is an ecosystem of products, including a database, visual data explorer, platform, and analytics tools to make it easier than ever to develop your applications.
  • 14. Not just key- valueMongoDB’s document model is not just a key-value store. Rich document composition is possible, and encouraged. Store embedded objects, arrays, rich data types, and more. { "title": "The Martian", "year": 2015, "runtime": 130, "released": ISODate("2015-10- 02T00:00:00Z"), "cast": [ "Kate Mara", "Matt Damon", "Jessica Chastain", "Kristen Wiig" ] }
  • 15. Document Model MongoDB RDBMS Database Database Collection Table Index Index Document Row Field Column Embedding, Linking, $lookup Join
  • 16. …using a SQL Model
  • 18. Document Model It’s a natural way to think about data, and maps incredibly well to patterns we know and common types and structures we use daily. The schema should be modelled from how you access your data. As highlighted, the schema is flexible, but you can use schema validation within in your application and within the database to enforce your schema.
  • 19. Query Language MQL and Aggregation
  • 20. Query Language CREATE TABLE movies ( id MEDIUMINT NOT NULL AUTO_INCREMENT, title Varchar(30), year Number, rating Number, PRIMARY KEY (id) ) db.createCollection("movies")
  • 21. Query Language INSERT INTO movies(title, year, rating) VALUES ("The Shawshank Redemption", 10, 1994) db.movies.insertOne({title: "The Shawshank Redemption", year: 1994, rating: 10})
  • 22. Query Language ALTER TABLE movies ADD cast ARRAY UPDATE movies SET cast = ["Morgan Freeman", "Tim Robbins"] WHERE title = "The Shawshank Redemption" db.movies.updateOne( {title: "The Shawshank Redemption"}, {$set: { "cast": ["Morgan Freeman", "Tim Robbins" ] } } )
  • 23. Query Language ALTER TABLE movies ADD cast ARRAY UPDATE movies SET cast = ["Morgan Freeman", "Tim Robbins"] WHERE title = "The Shawshank Redemption" db.movies.updateOne( {title: "The Shawshank Redemption"}, {$set: { "cast": ["Morgan Freeman", "Tim Robbins" ] } } )
  • 24. Query Language SELECT * FROM movies SELECT * FROM movies WHERE rating > 7 SELECT * FROM movies WHERE rating > 7 LIMIT 1 SELECT * FROM movies WHERE rating > 7 AND year > 1990 ?? db.movies.find() db.movies.find({rating: { $gt: 7 }}) db.movies.findOne({rating: { $gt: 7 }}).limit(1) db.movies.find({rating: { $gt: 7 }, year: { $gt: 1990 } }) db.movies.find({cast: "Morgan Freeman"})
  • 25. Query Language CREATE INDEX idx_movie_rating_desc ON movies(rating DESC) db.movies.createIndex({ rating: -1 })
  • 26. Query Language - Performance Indexes support the efficient execution of queries in MongoDB. Many index types • Single Field • Multikey • Text • Geospatial • Hashed • Compound
  • 27. Query Language - Aggregation A framework for data aggregation modelled on the concept of data processing pipelines. Documents enter a multi-stage pipeline that transforms the documents into aggregated results. Reduce the CPU cycles in processing your app, let MongoDB handle aggregation. Results produced from aggregation lower in total byte size of your data, saving bandwidth.
  • 28. Query Language - Aggregation A framework for data aggregation modeled on the concept of data processing pipelines. Documents enter a multi-stage pipeline that transforms the documents into aggregated results.
  • 31. Resiliency – The Replica Set
  • 32. Resiliency – The Replica Set Your application talks to MongoDB through the driver, which is constantly monitoring your replica set health. Internally, the replica set is monitoring health as well, ready to react in case of emergency.
  • 34. Resiliency – The Replica Set Your application talks to MongoDB through the driver, which is constantly monitoring your replica set health. Internally, the replica set is monitoring health as well, ready to react in case of emergency.
  • 37. Ecosystem - Compass MongoDB’s GUI to explore and interact with your data.
  • 39. Atlas – Infrastructure Infrastructure managed by MongoDB Updated with zero downtime Available in AWS, GCP, and Azure
  • 40. Atlas – Built in Security TLS/SSL Authentication and Authorization IP Whitelists User roles VPC Peering (AWS and GCP) AES-256 hardware encryption
  • 41. Atlas – Graphs and Metrics MongoDB Hardware Utilization Performance
  • 42. Atlas – Real Time Performance
  • 43. Atlas – So Much More Monitoring and Alerting • Supports Third-Party integration • Webhooks • Email • SMS • PagerDuty • Slack Live Migration Backups and Recovery BI Connector
  • 46. Live Coding Typing accuracy and mental faculty guaranteed to reduce by 37%!

Editor's Notes

  1. We have community and enterprise editions Works on Linux 64bit, Windows 64bit, and macOS Open-source, you can find the source code on Github Document-oriented….we go into this further. Uses BSON, which is binary-enclosed presentation of JSON that provides further data types, ordering etc There are still relationships!
  2. Think about hashtables, dictionaries etc
  3. Mongodb Compass Charts BI Connector
  4. Basic Relational schema…….how many tables do I need to join to see a what makes and models of cars a person owns? Point out that a multiple people can belong to multiple professions. And multiple people can own multiple cars (joint ownership) This gets compared to a document schema in the next slide
  5. Notice the order of our insert is different….because we do not care!
  6. Some RDMS do have array support The next slide just shows that some RDBMS will not handle ARRAYs (or objects for that matter)
  7. Using Aussie spelling here…. The conveyor belt image is next
  8. Output of one stage is the input for the next stage Use Compass to see examples of how to use Aggregation
  9. Highlight that people have different meanings for High Availability and Resiliency……..and it is not sharding Resiliency, not scaling!