SlideShare a Scribd company logo
Massimo Brignoli
Senior Solutions Architect
MongoDB Inc.
massimo@mongodb.com
@massimobrignoli
MongoDB and
The Internet of Things
Who Am I?
• Solutions Architect/Evangelist in MongoDB Inc.
• 25 years of experience in databases and software
development
• Former MySQL and MariaDB employee
• Previous life: web, web, web
Document Data Model
Relational MongoDB
{
first_name: ‘Paul’,
surname: ‘Miller’,
city: ‘London’,
location:
[45.123,47.232],
cars: [
{ model: ‘Bentley’,
year: 1973,
value: 100000, … },
{ model: ‘Rolls Royce’,
year: 1965,
value: 330000, … }
]
}
Document Model Benefits
• Agility and flexibility
– Data models can evolve easily
– Companies can adapt to changes quickly
• Intuitive, natural data representation
– Developers are more productive
– Many types of applications are a good fit
• Reduces the need for joins, disk seeks
– Programming is more simple
– Performance can be delivered at scale
Developers are more productive
Developers are more productive
Internet of Things
The Problem
• If you're thinking about designing an ideal data
structure for your Internet of Things application, then
here's what you should do:
don't do it.
The Problem
• The Internet of Things requires a huge deal of
flexibility.
Why?
• Because there are billions of heterogeneus objects
that will begin interacting with each other in ways we
can't predict.
• The structured and rigid tables offered by traditional
databases won't help us because they require a pre-
defined set of properties and tables, which again,
we can't predict.
The Problem
• Let's say we want to measure water levels in a large
number of wells. A simplified data architecture for
this application would look like this:
The Problem
• This looks just fine and should work perfectly using
a relational database. But then, 2 years after the
system has been up and running, someone has an
idea:
"Hey, now that we bought these new Internet-enabled
diesel generators to power the water pumps, let's see
their live data!”
The Problem
• To make this change, we would have to add a new
table called "Power Plants" and a new column to the
table "Wells”:
The Solution
• A great way of handling IoT data is the document-
oriented approach
• Instead of fixed tables, columns, and rows, you have
documents describing each object.
MongoDB
Document
Database
Open-
Source
General
Purpose
Documents Are Core
Relational MongoDB
{
first_name: "Paul",
surname: "Miller",
city: "London",
location: [45.123,47.232],
cars: [
{ model: "Bentley",
year: 1973,
value: 100000, … },
{ model: "Rolls Royce",
year: 1965,
value: 330000, … }
]
}
Modeling time series data
in MongoDB
Time series schema design goal
• Store event data
• Support Analytical Queries
• Find best compromise of:
- Memory utilization
- Write performance
- Read/Analytical Query Performance
• Accomplish with realistic amount of hardware
Modeling time series data
• Document per event
• Document per minute (average)
• Document per minute (second)
• Document per hour
Document per event
• Relational-centric approach
• Insert-driven workload
{
deviceId: "Test123",
timestamp: ISODate("2014-07-03T22:07:38.000Z"),
temperature: 21
}
Document per minute (average)
• Pre-aggregate to compute average per minute
more easily
• Update-driven workload
• Resolution at the minute level
{
deviceId: "Test123",
timestamp: ISODate("2014-07-03T22:07:00.000Z"),
temperature_num: 18,
temperature_sum: 357
}
Document per minute (by second)
• Store per-second data at the minute level
• Update-driven workload
• Pre-allocate structure to avoid document moves
{
deviceId: "Test123",
timestamp: ISODate("2014-07-03T22:07:00.000Z"),
temperature: { 0: 18, 1: 18, …, 58: 21, 59: 21 }
}
Document per hour (by second)
• Store per-second data at the hourly level
• Update-driven workload
• Pre-allocate structure to avoid document moves
• Updating last second requires 3599 steps
{
deviceId: "Test123",
timestamp: ISODate("2014-07-03T22:00:00.000Z"),
temperature: { 0: 18, 1: 18, …, 3598: 20, 3599: 20 }
}
Document per hour (by second)
• Store per-second data at the hourly level with nesting
• Update-driven workload
• Pre-allocate structure to avoid document moves
• Updating last second requires 59 + 59 steps
{
deviceId: "Test123",
timestamp: ISODate("2014-07-03T22:00:00.000Z"),
temperature: {
0: { 0: 18, …, 59: 18 },
…,
59: { 0: 21, …, 59: 20 }
}
}
Demo
How to scale
Scaling Up
Scaling Out
First Edition (1771)
3 Volumes
Fifteenth Edition (2010)
32 Volumes
Shards and Shard Keys
Shard
Shard key
range
Why is MongoDB a good fit for IoT?
• IoT processes are real-time
• Relational technologies can simply not compete
on cost, performance, scalability, and
manageability
• IoT data can come in any format, structured or
unstructured, ranging from text and numbers to
audio, picture and video
• Time series data is a natural fit
• IoT applications often require geographically
distributed systems
MEAN Stack
MongoDB and the Internet of Things
Thank you!
MongoDB and the Internet of Things

More Related Content

PPTX
How the Italian Market is Embracing Alternatives to Relational Databases
PDF
MongoDB Solution for Internet of Things and Big Data
PDF
MongoDB and the Internet of Things
PPTX
IOT Paris Seminar 2015 - intro by Yann Aubry
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PPTX
Why Your Dad’s Database Won’t Work for IoT
PDF
Webinar: Building a Blockchain Database with MongoDB
PDF
Predictive Analytics for IoT Network Capacity Planning: Spark Summit East tal...
How the Italian Market is Embracing Alternatives to Relational Databases
MongoDB Solution for Internet of Things and Big Data
MongoDB and the Internet of Things
IOT Paris Seminar 2015 - intro by Yann Aubry
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
Why Your Dad’s Database Won’t Work for IoT
Webinar: Building a Blockchain Database with MongoDB
Predictive Analytics for IoT Network Capacity Planning: Spark Summit East tal...

What's hot (20)

PPTX
The Right (and Wrong) Use Cases for MongoDB
PDF
IOT Paris Seminar 2015 - Storage Challenges in IOT
PPTX
[MongoDB.local Bengaluru 2018] The Path to Truly Understanding Your MongoDB Data
PPTX
MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...
PDF
Interoperability issues and challenges for IoT Services and Resources
PDF
MongoDB and the Internet of Things
PDF
247 overviewmongodbevening-bangalore
PPTX
MongoDB as a Data Warehouse: Time Series and Device History Data (Medtronic)
PDF
Neanex - Semantic Construction with Graphs
PDF
MongoDB .local Paris 2020: Devenez explorateur de données avec MongoDB Charts
PDF
Startup Bootcamp - Intro to NoSQL/Big Data by DataZone
PDF
Building an IoT Kafka Pipeline in Under 5 Minutes
PDF
Webinar: Introducing the MongoDB Connector for BI 2.0 with Tableau
PDF
How Google Does Big Data - DevNexus 2014
PDF
VP of WW Partners by Alan Chhabra
PPTX
MongoDB BI Connector & Tableau
PPTX
MongoDB Days UK: Tales from the Field
PDF
Google BigQuery - Features & Benefits
PDF
MongoDB .local Toronto 2019: MongoDB – Powering the new age data demands
PDF
VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
The Right (and Wrong) Use Cases for MongoDB
IOT Paris Seminar 2015 - Storage Challenges in IOT
[MongoDB.local Bengaluru 2018] The Path to Truly Understanding Your MongoDB Data
MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...
Interoperability issues and challenges for IoT Services and Resources
MongoDB and the Internet of Things
247 overviewmongodbevening-bangalore
MongoDB as a Data Warehouse: Time Series and Device History Data (Medtronic)
Neanex - Semantic Construction with Graphs
MongoDB .local Paris 2020: Devenez explorateur de données avec MongoDB Charts
Startup Bootcamp - Intro to NoSQL/Big Data by DataZone
Building an IoT Kafka Pipeline in Under 5 Minutes
Webinar: Introducing the MongoDB Connector for BI 2.0 with Tableau
How Google Does Big Data - DevNexus 2014
VP of WW Partners by Alan Chhabra
MongoDB BI Connector & Tableau
MongoDB Days UK: Tales from the Field
Google BigQuery - Features & Benefits
MongoDB .local Toronto 2019: MongoDB – Powering the new age data demands
VoltDB and HPE Vertica Present: Building an IoT Architecture for Fast + Big Data
Ad

Similar to MongoDB and the Internet of Things (20)

PPTX
Codemotion Milano 2014 - MongoDB and the Internet of Things
PPTX
MongoDB IoT City Tour EINDHOVEN: Managing the Database Complexity
PPTX
MongoDB IoT City Tour STUTTGART: Managing the Database Complexity, by Arthur ...
PDF
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
PPTX
MongoDB Days Silicon Valley: Jumpstart: The Right and Wrong Use Cases for Mon...
PPTX
Business Jumpstart: The Right (and Wrong) Use Cases for MongoDB
PPTX
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
PDF
Confluent & MongoDB APAC Lunch & Learn
PPTX
MongoDB and the Internet of Things
PPTX
Common MongoDB Use Cases
PPTX
MongoDB for Time Series Data: Setting the Stage for Sensor Management
PPTX
MongoDB for Time Series Data
KEY
KEY
Mongodb intro
PDF
Data as Documents: Overview and intro to MongoDB
PDF
MongoDB.pdf
PPTX
MongoDB for Time Series Data: Schema Design
PPT
9. Document Oriented Databases
PPTX
Webinar: MongoDB Use Cases within the Oil, Gas, and Energy Industries
PPTX
Dev Jumpstart: Build Your First App with MongoDB
Codemotion Milano 2014 - MongoDB and the Internet of Things
MongoDB IoT City Tour EINDHOVEN: Managing the Database Complexity
MongoDB IoT City Tour STUTTGART: Managing the Database Complexity, by Arthur ...
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
MongoDB Days Silicon Valley: Jumpstart: The Right and Wrong Use Cases for Mon...
Business Jumpstart: The Right (and Wrong) Use Cases for MongoDB
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
Confluent & MongoDB APAC Lunch & Learn
MongoDB and the Internet of Things
Common MongoDB Use Cases
MongoDB for Time Series Data: Setting the Stage for Sensor Management
MongoDB for Time Series Data
Mongodb intro
Data as Documents: Overview and intro to MongoDB
MongoDB.pdf
MongoDB for Time Series Data: Schema Design
9. Document Oriented Databases
Webinar: MongoDB Use Cases within the Oil, Gas, and Energy Industries
Dev Jumpstart: Build Your First App with MongoDB
Ad

More from Sam_Francis (6)

PPTX
Webminar - Novedades de MongoDB 3.2
PPTX
Monet, an IoT Energy Management Platform based on MongoDB
PPTX
Authentication guides
PPTX
Complete SSL Solution assets
PPTX
Product webinars
PPTX
SSL shopper reviews
Webminar - Novedades de MongoDB 3.2
Monet, an IoT Energy Management Platform based on MongoDB
Authentication guides
Complete SSL Solution assets
Product webinars
SSL shopper reviews

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Big Data Technologies - Introduction.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MIND Revenue Release Quarter 2 2025 Press Release
Big Data Technologies - Introduction.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Network Security Unit 5.pdf for BCA BBA.
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools

MongoDB and the Internet of Things

  • 1. Massimo Brignoli Senior Solutions Architect MongoDB Inc. massimo@mongodb.com @massimobrignoli MongoDB and The Internet of Things
  • 2. Who Am I? • Solutions Architect/Evangelist in MongoDB Inc. • 25 years of experience in databases and software development • Former MySQL and MariaDB employee • Previous life: web, web, web
  • 3. Document Data Model Relational MongoDB { first_name: ‘Paul’, surname: ‘Miller’, city: ‘London’, location: [45.123,47.232], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] }
  • 4. Document Model Benefits • Agility and flexibility – Data models can evolve easily – Companies can adapt to changes quickly • Intuitive, natural data representation – Developers are more productive – Many types of applications are a good fit • Reduces the need for joins, disk seeks – Programming is more simple – Performance can be delivered at scale
  • 5. Developers are more productive
  • 6. Developers are more productive
  • 8. The Problem • If you're thinking about designing an ideal data structure for your Internet of Things application, then here's what you should do: don't do it.
  • 9. The Problem • The Internet of Things requires a huge deal of flexibility. Why? • Because there are billions of heterogeneus objects that will begin interacting with each other in ways we can't predict. • The structured and rigid tables offered by traditional databases won't help us because they require a pre- defined set of properties and tables, which again, we can't predict.
  • 10. The Problem • Let's say we want to measure water levels in a large number of wells. A simplified data architecture for this application would look like this:
  • 11. The Problem • This looks just fine and should work perfectly using a relational database. But then, 2 years after the system has been up and running, someone has an idea: "Hey, now that we bought these new Internet-enabled diesel generators to power the water pumps, let's see their live data!”
  • 12. The Problem • To make this change, we would have to add a new table called "Power Plants" and a new column to the table "Wells”:
  • 13. The Solution • A great way of handling IoT data is the document- oriented approach • Instead of fixed tables, columns, and rows, you have documents describing each object.
  • 15. Documents Are Core Relational MongoDB { first_name: "Paul", surname: "Miller", city: "London", location: [45.123,47.232], cars: [ { model: "Bentley", year: 1973, value: 100000, … }, { model: "Rolls Royce", year: 1965, value: 330000, … } ] }
  • 16. Modeling time series data in MongoDB
  • 17. Time series schema design goal • Store event data • Support Analytical Queries • Find best compromise of: - Memory utilization - Write performance - Read/Analytical Query Performance • Accomplish with realistic amount of hardware
  • 18. Modeling time series data • Document per event • Document per minute (average) • Document per minute (second) • Document per hour
  • 19. Document per event • Relational-centric approach • Insert-driven workload { deviceId: "Test123", timestamp: ISODate("2014-07-03T22:07:38.000Z"), temperature: 21 }
  • 20. Document per minute (average) • Pre-aggregate to compute average per minute more easily • Update-driven workload • Resolution at the minute level { deviceId: "Test123", timestamp: ISODate("2014-07-03T22:07:00.000Z"), temperature_num: 18, temperature_sum: 357 }
  • 21. Document per minute (by second) • Store per-second data at the minute level • Update-driven workload • Pre-allocate structure to avoid document moves { deviceId: "Test123", timestamp: ISODate("2014-07-03T22:07:00.000Z"), temperature: { 0: 18, 1: 18, …, 58: 21, 59: 21 } }
  • 22. Document per hour (by second) • Store per-second data at the hourly level • Update-driven workload • Pre-allocate structure to avoid document moves • Updating last second requires 3599 steps { deviceId: "Test123", timestamp: ISODate("2014-07-03T22:00:00.000Z"), temperature: { 0: 18, 1: 18, …, 3598: 20, 3599: 20 } }
  • 23. Document per hour (by second) • Store per-second data at the hourly level with nesting • Update-driven workload • Pre-allocate structure to avoid document moves • Updating last second requires 59 + 59 steps { deviceId: "Test123", timestamp: ISODate("2014-07-03T22:00:00.000Z"), temperature: { 0: { 0: 18, …, 59: 18 }, …, 59: { 0: 21, …, 59: 20 } } }
  • 24. Demo
  • 27. Scaling Out First Edition (1771) 3 Volumes Fifteenth Edition (2010) 32 Volumes
  • 28. Shards and Shard Keys Shard Shard key range
  • 29. Why is MongoDB a good fit for IoT? • IoT processes are real-time • Relational technologies can simply not compete on cost, performance, scalability, and manageability • IoT data can come in any format, structured or unstructured, ranging from text and numbers to audio, picture and video • Time series data is a natural fit • IoT applications often require geographically distributed systems

Editor's Notes

  • #6: IBM designed IMS with Rockwell and Caterpillar starting in 1966 for the Apollo program. IMS's challenge was to inventory the very large bill of materials (BOM) for the Saturn V moon rocket and Apollo space vehicle.
  • #8: Loading a paper tape reader on the KDF9 computer.
  • #9: Loading a paper tape reader on the KDF9 computer.
  • #21: Now that we understand some of the challenges you’re facing and where you’d like to get, perhaps I can tell you a bit about why MongoDB exists and where we might be able to help. Our founders observed some technological and business changes in the market. We built MongoDB to address the way the world is changing… Data [tie back to what you’ve heard from customer if possible] 90% data created in last 2 years 80% enterprise data is unstructured Unstructured data growing 2X rate of structured data Time [tie back to what you’ve heard from customer if possible] Development methods shifted from waterfall (12-24 months) to iterative Leading edge companies like Facebook + Etsy shipping code multiple times a day Risk [tie back to what you’ve heard from customer if possible] User bases shifted from internal (thousands) to external (millions) Can’t go down All across the globe Cost [tie back to what you’ve heard from customer if possible] Shift to open-source and SaaS business models to pay for value over time Ability to leverage cloud and commodity architectures to lower infrastructure costs
  • #22: Looking at the other technologies in the market… Relational databases laid the foundation for what you’d want out of your database Rich and fast access to the data, using an expressive query language and secondary indexes Strong consistency, so you know you’re always getting the most up to date version of the data But they weren’t built for the world we just talked about Built for waterfall dev cycles, structured data Built for internal users, not large numbers of users all across the global (From vendors who want large license fees upfront) --> So what they have in data access and consistency, they lack in flexibility, scalability and performance
  • #23: NoSQL databases have tried to address the new world… They all have relatively flexible data models They were all built to scale out horizontally And they were built for performance But in doing so, they have sacrificed the core database capabilities you’ve come to expect and rely on in order to build fully functional apps, like rich querying, secondary indexes and strong consistency
  • #24: MongoDB was built to address the way the world has changed while preserving the core database capabilities required to build functional apps MongoDB is the only database that harnesses the innovations of NoSQL and maintains the foundation of relational databases
  • #25: Here we have greatly reduced the relational data model for this application to two tables. In reality no database has two tables. It is much more common to have hundreds or thousands of tables. And as a developer where do you begin when you have a complex data model?? If you’re building an app you’re really thinking about just a hand full of common things, like products, and these can be represented in a document much more easily that a complex relational model where the data is broken up in a way that doesn’t really reflect the way you think about the data or write an application.
  • #28: Segue – Rich queries, text search, geospatial, aggregation, mapreduce are types of things you can build based on the richness of the query model. More on that in just a moment.