SlideShare a Scribd company logo
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-series Data
@
#MDBlocal
Best practices:
Working with IoT and Time-Series
Data
Robert Walters, Director of IoT, MongoDB
@RobsCranium
MUNICH
LinkedIn: https://www.linkedin.com/in/robwaltersprofile/
#MDBLocal
#MDBLocal
Agenda
Define time-series data
Review typical IoT Architecture
Designing time-series schemas
Query and visualize time-series data
#MDBLocal
What is time series data?
Data in an IoT Architecture
#MDBLocal
https://tinyurl.com/Mongodb-Houston-2019
https://www.mongodb.com/white-papers
#MDBLocal
Common IoT Architecture
#MDBLocal
Common IoT Architecture
#MDBLocal
Common IoT Architecture
#MDBLocal
Common IoT Architecture
#MDBLocal
Common IoT Architecture
#MDBLocal
Common IoT Architecture
#MDBLocal
MongoDB IoT Reference Architecture
#MDBLocal
Data at the edge
Designing time-series schemas
#MDBLocal
Breaking the relational mindset….
#MDBLocal
MongoDB Schema Design
for Time Series data
#MDBLocal
Effects on Document count
Per second vs Per Minute
#MDBLocal
Effects on data storage
Per second vs Per Minute
#MDBLocal
Effects on memory
Per second vs Per Minute
#MDBLocal
Sample code to add to the size based bucketMongoDB Schema Design
for Time Series data
#MDBLocal
Case Study:
https://www.ampcontrolgroup.com/
Leaders in industrial electrical and electronic
engineering
Selected MongoDB for Gas-Detection Mining Application
#MDBLocal
Case Study:
#MDBLocal
Case Study:
One Document per Device per Parameter per Hour
Pre-aggregated data updated for every update
After 3 months samples array removed
Data archived for 7 years
#MDBLocal
Keys to successful time series applications
Know your application requirements
Writes Reads Data Retention Security
#MDBLocal
What to do with old data
• Pre-aggregation
• Offline archival
• db.remove
• TTL Indexes
• Dropping the collection
• Online archival
• Queryable backups
• Sharding archival data
• Offload to data warehouse / S3
#MDBLocal
MongoDB Atlas Data Lake
Analyze data in any format on S3 using MongoDB Query Language
Archive IoT and Time-series data for long term storage and analysis
How to query and visualize
time-series data
#MDBLocal
Real-time Analytics
One database for operational and analytical
data
Easy to query unstructured data
MongoDB Query Language (MQL)
Aggregation Framework
#MDBLocal
Real-time Analytics
Easily query unstructured data with Aggregation Framework
#MDBLocal
Using MQL Demo
What is the largest value for a given sensor id?
db.SensorData.aggregate( [
{$match: { "sensorid":3003 }},
{$unwind: { path: '$samples' }},
{$group: { _id: '$day', MaxValue: { $max:
'$samples.val' } }},
{$sort: { "id": 1 }} ])
What is the largest value for a given sensor id?
db.SensorData.aggregate( [
{$match: { "sensorid":3003 }},
{$unwind: { path: '$samples' }},
{$group: { _id: '$day', MaxValue: { $max:
'$samples.val' } }},
{$sort: { "id": 1 }} ])
What is the largest value for a given sensor id?
db.SensorData.aggregate( [
{$match: { "sensorid":3003 }},
{$unwind: { path: '$samples' }},
{$group: { _id: '$day', MaxValue: { $max:
'$samples.val' } }},
{$sort: { "id": 1 }} ])
What is the largest value for a given sensor id?
db.SensorData.aggregate( [
{$match: { "sensorid":3003 }},
{$unwind: { path: '$samples' }},
{$group: { _id: '$day', MaxValue: { $max:
'$samples.val' } }},
{$sort: { "id": 1 }} ])
Cloud – Real-time Analytics
What is the largest value for a given sensor id?
db.SensorData.aggregate( [
{$match: { "sensorid":3003 }},
{$unwind: { path: '$samples' }},
{$group: { id: '$day', MaxValue: { $max:
'$samples.val' } }},
{$sort: { "id": 1 }} ])
{ "_id" : ISODate("2018-12-10T00:00:00Z"), "MaxValue" : 40.4 }
{ "_id" : ISODate("2018-12-11T00:00:00Z"), "MaxValue" : 40.43 }
{ "_id" : ISODate("2018-12-12T00:00:00Z"), "MaxValue" : 40.09 }
{ "_id" : ISODate("2018-12-13T00:00:00Z"), "MaxValue" : 39.7 }
…
#MDBLocal
Cloud – Visualization
MongoDB Charts
#MDBLocal
Cloud – Visualization
MongoDB BI Connector
#MDBLocal
Integration with
Why MongoDB for IoT and Time-
Series Data?
#MDBLocal
Why MongoDB for IoT Data?
#MDBLocal
Best practices summary
Know your requirements
1 sensor reading per document works but not the most efficient
Data retention policy
Data access requirements
For very large data consider multiple collections
Faster to archive/drop collections than db.remove()
Recommended design fixed-based schema
https://www.mongodb.com/collateral/time-series-best-practices
Archive data to S3 / Atlas Data Lake for long term storage and analysis
#MDBLocal
Resources
MongoDB IoT Reference Architecture
Time Series Data and MongoDB: Best Practices Guide
Get Started with your project in MongoDB Atlas.
Use code “IOT200” for $200 in credit!
Thinking about an IoT Solution?
Robert.Walters@MongoDB.COM
THANK YOU
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-series Data

More Related Content

PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
PDF
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PPTX
MongoDB 3.2 - Analytics
PPTX
Webinar: Back to Basics: Thinking in Documents
PPTX
Back to Basics: My First MongoDB Application
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Munich 2019: Still Haven't Found What You Are Looking For? Use...
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB 3.2 - Analytics
Webinar: Back to Basics: Thinking in Documents
Back to Basics: My First MongoDB Application

What's hot (20)

PDF
Webinar: Building Your First App with MongoDB and Java
PDF
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
PPTX
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
PPTX
Back to Basics Webinar 3: Schema Design Thinking in Documents
PPTX
Socialite, the Open Source Status Feed Part 2: Managing the Social Graph
PPTX
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
PPTX
Webinar: Schema Design
PDF
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...
PPTX
High Performance Applications with MongoDB
PDF
MongoDB Schema Design
KEY
Managing Social Content with MongoDB
PPTX
Back to Basics Webinar 2: Your First MongoDB Application
PPTX
Webinar: Transitioning from SQL to MongoDB
PPTX
2014 bigdatacamp asya_kamsky
PDF
MongoDB Launchpad 2016: What’s New in the 3.4 Server
KEY
Schema design
PPTX
Indexing Strategies to Help You Scale
PPTX
User Data Management with MongoDB
PPTX
Building a Scalable Inbox System with MongoDB and Java
PPTX
Building a Location-based platform with MongoDB from Zero.
Webinar: Building Your First App with MongoDB and Java
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
Back to Basics Webinar 3: Schema Design Thinking in Documents
Socialite, the Open Source Status Feed Part 2: Managing the Social Graph
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Webinar: Schema Design
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...
High Performance Applications with MongoDB
MongoDB Schema Design
Managing Social Content with MongoDB
Back to Basics Webinar 2: Your First MongoDB Application
Webinar: Transitioning from SQL to MongoDB
2014 bigdatacamp asya_kamsky
MongoDB Launchpad 2016: What’s New in the 3.4 Server
Schema design
Indexing Strategies to Help You Scale
User Data Management with MongoDB
Building a Scalable Inbox System with MongoDB and Java
Building a Location-based platform with MongoDB from Zero.
Ad

Similar to MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-series Data (20)

PDF
MongoDB .local London 2019: Best Practices for Working with IoT and Time-seri...
PDF
MongoDB .local Houston 2019: Best Practices for Working with IoT and Time-ser...
PDF
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
PDF
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
PPTX
How to leverage what's new in MongoDB 3.6
PDF
Simplifying & accelerating application development with MongoDB's intelligent...
PPTX
Eagle6 mongo dc revised
PPTX
Eagle6 Enterprise Situational Awareness
PDF
Analytics with MongoDB Aggregation Framework and Hadoop Connector
PPTX
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
PPTX
Marc s01 e02-crud-database
PPTX
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
PPTX
Sharing about MongoDB Overview and Indexing in MongoDB
PDF
MongoDB Meetup
PPTX
S01 e01 schema-design
PPTX
Socialite, the Open Source Status Feed
PDF
Montreal Elasticsearch Meetup
PPTX
Using MongoDB As a Tick Database
PPTX
[MongoDB.local Bengaluru 2018] Keynote
PDF
MongoDB Solution for Internet of Things and Big Data
MongoDB .local London 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Houston 2019: Best Practices for Working with IoT and Time-ser...
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
How to leverage what's new in MongoDB 3.6
Simplifying & accelerating application development with MongoDB's intelligent...
Eagle6 mongo dc revised
Eagle6 Enterprise Situational Awareness
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Marc s01 e02-crud-database
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
Sharing about MongoDB Overview and Indexing in MongoDB
MongoDB Meetup
S01 e01 schema-design
Socialite, the Open Source Status Feed
Montreal Elasticsearch Meetup
Using MongoDB As a Tick Database
[MongoDB.local Bengaluru 2018] Keynote
MongoDB Solution for Internet of Things and Big Data
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
PDF
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
PDF
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
PDF
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
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: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
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: MongoDB Atlas Jumpstart
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: A Complete Methodology of Data Modeling fo...
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 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: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
A Presentation on Artificial Intelligence
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Mushroom cultivation and it's methods.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
Spectroscopy.pptx food analysis technology
Teaching material agriculture food technology
Programs and apps: productivity, graphics, security and other tools
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
cloud_computing_Infrastucture_as_cloud_p
A Presentation on Artificial Intelligence
SOPHOS-XG Firewall Administrator PPT.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
OMC Textile Division Presentation 2021.pptx
Assigned Numbers - 2025 - Bluetooth® Document
NewMind AI Weekly Chronicles - August'25-Week II
Mushroom cultivation and it's methods.pdf
1. Introduction to Computer Programming.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
A comparative study of natural language inference in Swahili using monolingua...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Heart disease approach using modified random forest and particle swarm optimi...
Spectroscopy.pptx food analysis technology

MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-series Data