SlideShare a Scribd company logo
MongoDB .local Chicago 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
CHICAGO
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
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-series Data
THANK YOU
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-series Data

More Related Content

What's hot (20)

PDF
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB
 
PDF
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB
 
PPTX
Jumpstart: Introduction to Schema Design
MongoDB
 
PPTX
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
PPTX
Jumpstart: Introduction to MongoDB
MongoDB
 
PDF
MongoDB Launchpad 2016: What’s New in the 3.4 Server
MongoDB
 
PPTX
Data Analytics: Understanding Your MongoDB Data
MongoDB
 
PPTX
[MongoDB.local Bengaluru 2018] Just in Time Validation with JSON Schema
MongoDB
 
PDF
MongoDB .local Munich 2019: Managing a Heterogeneous Stack with MongoDB & SQL
MongoDB
 
PDF
MongoDB Europe 2016 - MongoDB 3.4 preview and introduction to MongoDB Atlas
MongoDB
 
PPTX
IOOF IT System Modernisation
MongoDB
 
PDF
MongoDB .local Munich 2019: A Complete Methodology to Data Modeling for MongoDB
MongoDB
 
PPTX
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
MongoDB
 
PDF
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
PDF
When to Use MongoDB
MongoDB
 
PDF
MongoDB Meetup
Maxime Beugnet
 
PDF
Getting to Insights Faster with the MongoDB Connector for BI
MongoDB
 
KEY
Introduction to Restkit
petertmarks
 
PPTX
N1QL workshop: Indexing & Query turning.
Keshav Murthy
 
PDF
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
FIWARE
 
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB
 
Jumpstart: Introduction to Schema Design
MongoDB
 
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
Jumpstart: Introduction to MongoDB
MongoDB
 
MongoDB Launchpad 2016: What’s New in the 3.4 Server
MongoDB
 
Data Analytics: Understanding Your MongoDB Data
MongoDB
 
[MongoDB.local Bengaluru 2018] Just in Time Validation with JSON Schema
MongoDB
 
MongoDB .local Munich 2019: Managing a Heterogeneous Stack with MongoDB & SQL
MongoDB
 
MongoDB Europe 2016 - MongoDB 3.4 preview and introduction to MongoDB Atlas
MongoDB
 
IOOF IT System Modernisation
MongoDB
 
MongoDB .local Munich 2019: A Complete Methodology to Data Modeling for MongoDB
MongoDB
 
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
MongoDB
 
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
When to Use MongoDB
MongoDB
 
MongoDB Meetup
Maxime Beugnet
 
Getting to Insights Faster with the MongoDB Connector for BI
MongoDB
 
Introduction to Restkit
petertmarks
 
N1QL workshop: Indexing & Query turning.
Keshav Murthy
 
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
FIWARE
 

Similar to MongoDB .local Chicago 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...
MongoDB
 
PDF
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
MongoDB
 
PDF
MongoDB .local Houston 2019: Best Practices for Working with IoT and Time-ser...
MongoDB
 
PDF
MongoDB and the Internet of Things
MongoDB
 
PDF
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
Marcin Bielak
 
PDF
Tugdual Grall - Real World Use Cases: Hadoop and NoSQL in Production
Codemotion
 
PPTX
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
MongoDB
 
PPTX
MongoDB for Time Series Data: Setting the Stage for Sensor Management
MongoDB
 
PDF
Apache Spark and MongoDB - Turning Analytics into Real-Time Action
João Gabriel Lima
 
PDF
MongoDB_Spark
Mat Keep
 
PDF
Big Data : Risks and Opportunities
Kenny Huang Ph.D.
 
PDF
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...
Spark Summit
 
PDF
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
festival ICT 2016
 
PDF
MongoDB Solution for Internet of Things and Big Data
Stefano Dindo
 
PPTX
When to Use MongoDB
MongoDB
 
PPTX
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
PDF
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
Altinity Ltd
 
PDF
Time Series Databases for IoT (On-premises and Azure)
Ivo Andreev
 
PPTX
IOT DATA AND BIG DATA
Vellore institute of technology, Vellore
 
PPTX
Webinar: MongoDB Use Cases within the Oil, Gas, and Energy Industries
MongoDB
 
MongoDB .local London 2019: Best Practices for Working with IoT and Time-seri...
MongoDB
 
MongoDB .local Paris 2020: Les bonnes pratiques pour travailler avec les donn...
MongoDB
 
MongoDB .local Houston 2019: Best Practices for Working with IoT and Time-ser...
MongoDB
 
MongoDB and the Internet of Things
MongoDB
 
IoT databases - review and challenges - IoT, Hardware & Robotics meetup - onl...
Marcin Bielak
 
Tugdual Grall - Real World Use Cases: Hadoop and NoSQL in Production
Codemotion
 
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
MongoDB
 
MongoDB for Time Series Data: Setting the Stage for Sensor Management
MongoDB
 
Apache Spark and MongoDB - Turning Analytics into Real-Time Action
João Gabriel Lima
 
MongoDB_Spark
Mat Keep
 
Big Data : Risks and Opportunities
Kenny Huang Ph.D.
 
Using Spark and Riak for IoT Apps—Patterns and Anti-Patterns: Spark Summit Ea...
Spark Summit
 
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
festival ICT 2016
 
MongoDB Solution for Internet of Things and Big Data
Stefano Dindo
 
When to Use MongoDB
MongoDB
 
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Gianfranco Palumbo
 
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
Altinity Ltd
 
Time Series Databases for IoT (On-premises and Azure)
Ivo Andreev
 
Webinar: MongoDB Use Cases within the Oil, Gas, and Energy Industries
MongoDB
 
Ad

More from MongoDB (20)

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

Recently uploaded (20)

DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 

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