SlideShare a Scribd company logo
1 of 41
Download to read offline
Designing MongoDB solutions for
the Internet of Things and Big Data
INNOVATION COMPANY
Roberto Contiero
r.contiero@zero12.it
@contieroroberto
“Learn quickly and Think Well!”
Stefano Dindo
s.dindo@zero12.it
@stefanodindo
“We are an Innovation Company. We design
and develop cutting edge software to drive
our customers’ digital transformation,
through Agile Methodologies and continuous
delivery”
WE HELP OUR CUSTOMERS TO
DESIGN
IDEA
CREATE
PRODUCTS
EXTRACT VALUE
FROM DATA
We get powerful ideas
to market fast
We design and develop
innovative and better
software solutions
We collect and analyze
data to help your
decisions
Discover Experiment Delivery
MVP
Continuous Design 

&
Integration
OUR APPROACH
MVP
MVP
MVP
?
?
? ?
? ?
?
End UsersIdeaCustomer & zero12
collaboration meeting 

( CanvUX )
Customer feedback
Today
we are dealing with
“Internet Of Things”
“Internet of Things is a neologism
referring to the extension of the
Internet to the world of objects
and concrete places.”
2020 IoT Market Share
4
Billion
Connected People
$4
Trillion
Business 

Opportunity
25+
Billion
Integrated systems
connected to the Web
50
Trillion
50GBs of data
Fonte: IDC
Broker
MQTT
Authentication
API
Business Logic
API
Predictive

Engine
API
Application
Frontend
MongoDB
IoT Architecture:
Users
Things
Predictive Algorithm
Data Operation
User Interaction
Authentication
MongoDB
for GIANT Ideas
What is MongoDB?
General Purpose Document Database Open Source
MongoDB
General Info
SQL - like MongoDB World
Database Database
Table Collection
Row Document
Column Field
What’s a document?
{

	 "name": "John",

	 "surname": "Doe",

	 "email": "jdoe@gmail.com",

	 "cell": 3281432896,

	 "sport": ["swimming", "football"]

}
{
_id: ‘ObjectId(“4b2b9…”)’,
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, … }
]
}
Comparison Relational vs Document
Document
{
_id: ‘ObjectId(“4b2b9…”)’,
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, … }
]
}
Example Data Type
Null
Boolean
Number
String
Date
Array
Embedded documents
{ x: null }
{ x: true }
{ x: 3.14 } { x: 3 }
{ x: “zero12” }
{ x: new Date() }
{ x: [“a”,”b”, “c”] }
{ x: {y: “a” } }
Aggregation
op1 op2 opn……
{
"name": "John",
"surname": "Doe",
"email": "jdoe@gmail.com"
}
Pipeline stages Documents
Main Operator
• $project
• $match
• $limit
• $skip
• $sort
• $unwind
• $group
Join ?
Yes, use
$lookup
operator
MongoDB
3.2
MongoDB Compass 3 Storage Engine
• WiredTiger
• NMAPv1.1
• In-Memory ( beta )
Data Encryption
Business Intelligence 

Connectors
$lookup operator
Document Validation
MongoDB
Architectures
Node 1
Secondary
Node 2
Secondary
Node 3
Primary
Heartbeat
Replica Replica
ReplicaSet Configuration
Sharding Configuration
How to Use MongoDB in IoT Area
Time Series
Definition
Set of values of a variable detected at different timestamps.
Time
t0 t1 t2 t3
f ( t0 )
f ( t1 )
f ( t2 )
f ( t3 )
Time Series Data is Everywhere
1. Financial markets pricing
2. Sensors (temperature, pressure, proximity)
3. Industrial Fleets (Location, velocity, operational)
4. Social Networks (status update)
5. System (server logs, application logs)
6. Mobile devices (calls, texts)
Time Series Data at a Higher Level
1. Widely applicable data model

2. Various schema and modeling options

3. Application requirements drive schema
design
Time Series - Schema Design
How to Use MongoDB in IoT Area
Designing for writing and reading
1. One document per event
2. One document per minute (average)
3. One document per minute (second)
4. One document per hour
One document per event
{
server: "server1",

load: 92,

ts: ISODate("2014-10-16T22:07:38.000-0500")
}
1. Relational-centric approach
2. Insert-driven workload
3. Aggregations computed at application-level
One document per minute (average)
{
server: "server1",

load_num: 92,

load_sum: 4500,

ts: ISODate("2014-10-16T22:07:00.000-0500")
}
1. Pre-aggregation to compute average per minute more easily
2. Update-driven workload
3. Minute-level resolution
One document per minute ( second )
{
server: "server1",

load: { 0: 15, 1: 20, ..., 58: 45, 59: 40 }

ts: ISODate("2014-10-16T22:07:00.000-0500")
}
1. Store per second data at minute level
2. Update-driven workload
3. Pre-allocate structure to avoid document moves
One document per hour ( by second )
{

server: "server1",

load: { 0: 15, 1: 20, ..., 3598: 45, 3599: 40 } 

ts: ISODate("2014-10-16T22:00:00.000-0500")
}
1. Store per second data at hourly level
2. Update driven workload
3. Pre-allocate structure to avoid document moves
4. Updating the last second requires 3599 steps
One document per hour ( by second )
{
server: "server1", 

load: {
0: {0: 15, ..., 59: 45}, ....

59: {0: 25, ..., 59: 75}
}
ts: ISODate("2014-10-16T22:00:00.000-0500")
}
1. Store per second data at hourly level with nesting
2. Update-driven workload
3. Pre-allocate structure to avoid document moves
4. Updating the last second requires 59+59 steps
Writing operation analysis
1. Example: data generated every second
2. Capturing data per minute requires:

- One document per event: 60 writes

- One document per minute: 1 write, 59 updates
3. Transition from “insert-driven” to “update-driven”
- Individual writes are smaller

- Performance and concurrency benefits
1. Example: data generated every second
2. Reading data for a single hours requires:

- One document per event: 3600 reads 

- One document per minute: 60 reads
3. Read performance is greatly improved:

- Fewer disk seeks

- Optimization with tuned block sizes and read ahead
Read operation analysis
Live Demo
http://www.zero12.it/lab-festivalict/
E’ possibile scaricare semplici esercizi realizzati per il Lab da:

More Related Content

What's hot

Boundary Front end tech talk: how it works
Boundary Front end tech talk: how it worksBoundary Front end tech talk: how it works
Boundary Front end tech talk: how it works
Boundary
 
MongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes PlatformMongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes Platform
MongoDB
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
MongoDB
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
MongoDB
 

What's hot (20)

MongoDB.local Paris Keynote
MongoDB.local Paris KeynoteMongoDB.local Paris Keynote
MongoDB.local Paris Keynote
 
NoSQL Infrastructure
NoSQL InfrastructureNoSQL Infrastructure
NoSQL Infrastructure
 
Weather of the Century: Design and Performance
Weather of the Century: Design and PerformanceWeather of the Century: Design and Performance
Weather of the Century: Design and Performance
 
Boundary Front end tech talk: how it works
Boundary Front end tech talk: how it worksBoundary Front end tech talk: how it works
Boundary Front end tech talk: how it works
 
Omnibus database machine
Omnibus database machineOmnibus database machine
Omnibus database machine
 
Python and MongoDB as a Market Data Platform by James Blackburn
Python and MongoDB as a Market Data Platform by James BlackburnPython and MongoDB as a Market Data Platform by James Blackburn
Python and MongoDB as a Market Data Platform by James Blackburn
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
 
MongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes PlatformMongoDB and Web Scrapping with the Gyes Platform
MongoDB and Web Scrapping with the Gyes Platform
 
MongoDB and Play! Framework workshop
MongoDB and Play! Framework workshopMongoDB and Play! Framework workshop
MongoDB and Play! Framework workshop
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
 
Liquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web ServersLiquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web Servers
 
Mongo db updatedocumentusecases
Mongo db updatedocumentusecasesMongo db updatedocumentusecases
Mongo db updatedocumentusecases
 
Full-Stack Reactivity with Milo.js
Full-Stack Reactivity with Milo.jsFull-Stack Reactivity with Milo.js
Full-Stack Reactivity with Milo.js
 
Building mobile apps with Realm for React Native
Building mobile apps with Realm for React NativeBuilding mobile apps with Realm for React Native
Building mobile apps with Realm for React Native
 
Gmails Quota Secrets
Gmails Quota SecretsGmails Quota Secrets
Gmails Quota Secrets
 
MongoDB.local DC 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Applic...
MongoDB.local DC 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Applic...MongoDB.local DC 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Applic...
MongoDB.local DC 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Applic...
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
 
A new capacity achieving private information retrieval scheme with (almost) o...
A new capacity achieving private information retrieval scheme with (almost) o...A new capacity achieving private information retrieval scheme with (almost) o...
A new capacity achieving private information retrieval scheme with (almost) o...
 
Keynote: New in MongoDB: Atlas, Charts, and Stitch
Keynote: New in MongoDB: Atlas, Charts, and StitchKeynote: New in MongoDB: Atlas, Charts, and Stitch
Keynote: New in MongoDB: Atlas, Charts, and Stitch
 
MongoDB + GeoServer
MongoDB + GeoServerMongoDB + GeoServer
MongoDB + GeoServer
 

Similar to Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of Things e Big Data - by Zero12 - festival ICT 2015

MongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
MongoDB
 

Similar to Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of Things e Big Data - by Zero12 - festival ICT 2015 (20)

Codemotion Milano 2014 - MongoDB and the Internet of Things
Codemotion Milano 2014 - MongoDB and the Internet of ThingsCodemotion Milano 2014 - MongoDB and the Internet of Things
Codemotion Milano 2014 - MongoDB and the Internet of Things
 
MongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
 
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
 
ClickHouse Paris Meetup. ClickHouse Analytical DBMS, Introduction. By Alexand...
ClickHouse Paris Meetup. ClickHouse Analytical DBMS, Introduction. By Alexand...ClickHouse Paris Meetup. ClickHouse Analytical DBMS, Introduction. By Alexand...
ClickHouse Paris Meetup. ClickHouse Analytical DBMS, Introduction. By Alexand...
 
MongoDB for Time Series Data
MongoDB for Time Series DataMongoDB for Time Series Data
MongoDB for Time Series Data
 
Reactive Stream Processing Using DDS and Rx
Reactive Stream Processing Using DDS and RxReactive Stream Processing Using DDS and Rx
Reactive Stream Processing Using DDS and Rx
 
MongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
 
How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouseApplication Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
 
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
 
MongoDB Days Silicon Valley: Jumpstart: The Right and Wrong Use Cases for Mon...
MongoDB Days Silicon Valley: Jumpstart: The Right and Wrong Use Cases for Mon...MongoDB Days Silicon Valley: Jumpstart: The Right and Wrong Use Cases for Mon...
MongoDB Days Silicon Valley: Jumpstart: The Right and Wrong Use Cases for Mon...
 
Metaverse and Digital Twins on Enterprise-Public.pdf
Metaverse and Digital Twins on Enterprise-Public.pdfMetaverse and Digital Twins on Enterprise-Public.pdf
Metaverse and Digital Twins on Enterprise-Public.pdf
 
Azure Stream Analytics : Analyse Data in Motion
Azure Stream Analytics  : Analyse Data in MotionAzure Stream Analytics  : Analyse Data in Motion
Azure Stream Analytics : Analyse Data in Motion
 
Timeseries - data visualization in Grafana
Timeseries - data visualization in GrafanaTimeseries - data visualization in Grafana
Timeseries - data visualization in Grafana
 
Capacity Planning for Linux Systems
Capacity Planning for Linux SystemsCapacity Planning for Linux Systems
Capacity Planning for Linux Systems
 
MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...
MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...
MongoDB IoT City Tour LONDON: Managing the Database Complexity, by Arthur Vie...
 
MongoDB IoT City Tour STUTTGART: Managing the Database Complexity, by Arthur ...
MongoDB IoT City Tour STUTTGART: Managing the Database Complexity, by Arthur ...MongoDB IoT City Tour STUTTGART: Managing the Database Complexity, by Arthur ...
MongoDB IoT City Tour STUTTGART: Managing the Database Complexity, by Arthur ...
 
MongoDB for Developers
MongoDB for DevelopersMongoDB for Developers
MongoDB for Developers
 

More from festival ICT 2016

More from festival ICT 2016 (20)

Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...
Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...
Migliorare il cash flow della propria azienda e dei propri clienti: i benefic...
 
Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...
Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...
Criticità per la protezione dei dati personali connesse all’utilizzo di dispo...
 
Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015
Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015
Lo Zen e l'arte dell'UX Design Mobile - by Synesthesia - festival ICT 2015
 
The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...
The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...
The Web Advisor: restare vivi e aggiornati nel business digitale - festival I...
 
Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...
Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...
Favorire lo sviluppo di applicazioni native Cloud: lo Smart SaaS Program - by...
 
I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...
I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...
I vantaggi di un’infrastruttura unica nell’erogazione dei servizi IT networke...
 
LibreOffice: software libero e formati standard - by LibreItalia - festival I...
LibreOffice: software libero e formati standard - by LibreItalia - festival I...LibreOffice: software libero e formati standard - by LibreItalia - festival I...
LibreOffice: software libero e formati standard - by LibreItalia - festival I...
 
Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015
Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015
Come rendere più collaborative le tue riunioni - by Epson - festival ICT 2015
 
Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...
Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...
Case Study TWT: North Sails ha rivoluzionato il modo di lavorare - by TWT - f...
 
Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015
Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015
Il mio ufficio è sempre con me. E il tuo? - by TWT - festival ICT 2015
 
Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015
Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015
Non adeguatevi al Cloud - by Clouditalia - festival ICT 2015
 
Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...
Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...
Impatto privacy della video analisi nei sistemi di video sorveglianza intelli...
 
Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015
Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015
Web reputation, le verità nascoste dell’identità digitale - festival ICT 2015
 
Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...
Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...
Privacy e non profit online: profilazioni digitali di donatori e aderenti nel...
 
L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...
L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...
L'importanza del controllo nelle operazioni di Data Wiping - Sprint Computer ...
 
Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...
Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...
Il dato è tratto: il lato B della mobilità tra privacy e reati informatici - ...
 
Web e privacy, le nuove regole per i cookies - festival ICT 2015
Web e privacy, le nuove regole per i cookies - festival ICT 2015Web e privacy, le nuove regole per i cookies - festival ICT 2015
Web e privacy, le nuove regole per i cookies - festival ICT 2015
 
Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...
Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...
Il paradigma UCaaS: come migliorare i processi di business dell’azienda attra...
 
Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution...
 Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution... Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution...
Nuvole e metallo: Infrastruttura e servizi Cloud based - by Hosting Solution...
 
Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...
Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...
Definire, configurare ed implementare soluzioni scalabili su sistemi di Cloud...
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of Things e Big Data - by Zero12 - festival ICT 2015

  • 1. Designing MongoDB solutions for the Internet of Things and Big Data
  • 2. INNOVATION COMPANY Roberto Contiero r.contiero@zero12.it @contieroroberto “Learn quickly and Think Well!” Stefano Dindo s.dindo@zero12.it @stefanodindo
  • 3. “We are an Innovation Company. We design and develop cutting edge software to drive our customers’ digital transformation, through Agile Methodologies and continuous delivery”
  • 4. WE HELP OUR CUSTOMERS TO DESIGN IDEA CREATE PRODUCTS EXTRACT VALUE FROM DATA We get powerful ideas to market fast We design and develop innovative and better software solutions We collect and analyze data to help your decisions
  • 5. Discover Experiment Delivery MVP Continuous Design 
 & Integration OUR APPROACH MVP MVP MVP ? ? ? ? ? ? ? End UsersIdeaCustomer & zero12 collaboration meeting 
 ( CanvUX ) Customer feedback
  • 6. Today we are dealing with “Internet Of Things”
  • 7. “Internet of Things is a neologism referring to the extension of the Internet to the world of objects and concrete places.”
  • 8. 2020 IoT Market Share 4 Billion Connected People $4 Trillion Business 
 Opportunity 25+ Billion Integrated systems connected to the Web 50 Trillion 50GBs of data Fonte: IDC
  • 12.
  • 13. General Purpose Document Database Open Source MongoDB
  • 14. General Info SQL - like MongoDB World Database Database Table Collection Row Document Column Field
  • 15. What’s a document? { "name": "John", "surname": "Doe", "email": "jdoe@gmail.com", "cell": 3281432896, "sport": ["swimming", "football"] }
  • 16. { _id: ‘ObjectId(“4b2b9…”)’, 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, … } ] } Comparison Relational vs Document
  • 17. Document { _id: ‘ObjectId(“4b2b9…”)’, 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, … } ] } Example Data Type Null Boolean Number String Date Array Embedded documents { x: null } { x: true } { x: 3.14 } { x: 3 } { x: “zero12” } { x: new Date() } { x: [“a”,”b”, “c”] } { x: {y: “a” } }
  • 18. Aggregation op1 op2 opn…… { "name": "John", "surname": "Doe", "email": "jdoe@gmail.com" } Pipeline stages Documents
  • 19.
  • 20. Main Operator • $project • $match • $limit • $skip • $sort • $unwind • $group
  • 23. MongoDB 3.2 MongoDB Compass 3 Storage Engine • WiredTiger • NMAPv1.1 • In-Memory ( beta ) Data Encryption Business Intelligence 
 Connectors $lookup operator Document Validation
  • 25. Node 1 Secondary Node 2 Secondary Node 3 Primary Heartbeat Replica Replica ReplicaSet Configuration
  • 27.
  • 28. How to Use MongoDB in IoT Area Time Series
  • 29. Definition Set of values of a variable detected at different timestamps. Time t0 t1 t2 t3 f ( t0 ) f ( t1 ) f ( t2 ) f ( t3 )
  • 30. Time Series Data is Everywhere 1. Financial markets pricing 2. Sensors (temperature, pressure, proximity) 3. Industrial Fleets (Location, velocity, operational) 4. Social Networks (status update) 5. System (server logs, application logs) 6. Mobile devices (calls, texts)
  • 31. Time Series Data at a Higher Level 1. Widely applicable data model
 2. Various schema and modeling options
 3. Application requirements drive schema design
  • 32. Time Series - Schema Design How to Use MongoDB in IoT Area
  • 33. Designing for writing and reading 1. One document per event 2. One document per minute (average) 3. One document per minute (second) 4. One document per hour
  • 34. One document per event { server: "server1",
 load: 92,
 ts: ISODate("2014-10-16T22:07:38.000-0500") } 1. Relational-centric approach 2. Insert-driven workload 3. Aggregations computed at application-level
  • 35. One document per minute (average) { server: "server1",
 load_num: 92,
 load_sum: 4500,
 ts: ISODate("2014-10-16T22:07:00.000-0500") } 1. Pre-aggregation to compute average per minute more easily 2. Update-driven workload 3. Minute-level resolution
  • 36. One document per minute ( second ) { server: "server1",
 load: { 0: 15, 1: 20, ..., 58: 45, 59: 40 }
 ts: ISODate("2014-10-16T22:07:00.000-0500") } 1. Store per second data at minute level 2. Update-driven workload 3. Pre-allocate structure to avoid document moves
  • 37. One document per hour ( by second ) {
 server: "server1",
 load: { 0: 15, 1: 20, ..., 3598: 45, 3599: 40 } 
 ts: ISODate("2014-10-16T22:00:00.000-0500") } 1. Store per second data at hourly level 2. Update driven workload 3. Pre-allocate structure to avoid document moves 4. Updating the last second requires 3599 steps
  • 38. One document per hour ( by second ) { server: "server1", 
 load: { 0: {0: 15, ..., 59: 45}, ....
 59: {0: 25, ..., 59: 75} } ts: ISODate("2014-10-16T22:00:00.000-0500") } 1. Store per second data at hourly level with nesting 2. Update-driven workload 3. Pre-allocate structure to avoid document moves 4. Updating the last second requires 59+59 steps
  • 39. Writing operation analysis 1. Example: data generated every second 2. Capturing data per minute requires:
 - One document per event: 60 writes
 - One document per minute: 1 write, 59 updates 3. Transition from “insert-driven” to “update-driven” - Individual writes are smaller
 - Performance and concurrency benefits
  • 40. 1. Example: data generated every second 2. Reading data for a single hours requires:
 - One document per event: 3600 reads 
 - One document per minute: 60 reads 3. Read performance is greatly improved:
 - Fewer disk seeks
 - Optimization with tuned block sizes and read ahead Read operation analysis
  • 41. Live Demo http://www.zero12.it/lab-festivalict/ E’ possibile scaricare semplici esercizi realizzati per il Lab da: