SlideShare a Scribd company logo
1 of 46
MongoDBEurope2016
Old Billingsgate, London
15th November
mongodb.com/europe
egistratevi con il codice massimobrignoli20 per il 20% di scon
Massimo Brignoli
Principal Solution Architect, EMEA
@massimobrignoli
Back to Basics 2016 : Webinar 5
Introduzione all’Aggregation Framework
Riassunto
• Webinar 1 – Introduzione a NoSQL
– I diversi tipi di database NoSQL
– MongoDB come document database
• Webinar 2 – La nostra prima applicazione
– Creazione di database e collectione
– CRUD, indici e explain
• Webinar 3 – Schema Design
– Schema dinamico
– Approcci all’Embedding
• Webinar 4 –Indici Full-Text e geospaziali
L’Aggregation Framework
• Motore anallitico per MongoDB
• Pensate ai due tipi di database: OLTP e OLAP
• OLTP : Online Transaction Processing
– Prenotazione voli,
– Bancomat,
– Prenotazione taxi
• OLAP : Online Analytical Processing
– Quale biglietto ci fa guadagnare di più?
– Quando dobbiam ricaricare il bancomat?
– Di quanti taxi abbiamo bisogno per effettuare il servizio ad est di Milano?
Cosa vi sembra?
OLTP OLAP
OLAP - There Be (Hadoop) Dragons Here
• Query OLAP sono spesso scansioni di tabelle
• L’output delle query è spesso strutturato per analisi future e
comparazioni
• Molti clienti stanno guardando a Spark e Hadoop ma:
– La complessità è astronomica
– Focus sugli algoritmi di analisi dei dati (dovete scrivere un programma)
– Richiede una certa conoscenza di algoritmi paralleli
• L’aggregation framework è un tool molto più ”gentile”
• L’obiettivo è di fare quello che volete fare in meno temppo
Analytics on MongoDB Data
• Extract data from MongoDB and
perform complex analytics with
Hadoop
– Batch rather than real-time
– Extra nodes to manage
• Direct access to MongoDB from
SPARK
• MongoDB BI Connector
– Direct SQL Access from BI Tools
• MongoDB aggregation pipeline
– Real-time
– Live, operational data set
– Narrower feature set
Hadoop
Connector
MapReduce & HDFS
SQL
Connector
What is an Aggregation Pipeline?
• Una serie di trasformazioni di documenti
– Eseguita in stage
– L’input iniziale è una collection
– L’output può essere un cursorse o una collection
• Ricca libreria di funzioni
– Filter, compute, group e summarize data
– L’output di uno stage è l’input dello stage successivo
– Le operazioni sono eseguite in ordine sequenziale
Operatori della Pipeline
• $match
Filter documents
• $geoNear
Geospherical query
• $project
Reshape documents
• $lookup
New – Left-outer equi joins
• $unwind
Expand documents
• $group
Summarize documents
• $sample
New – Randomly selects a subset of
documents
• $sort
Order documents
• $skip
Jump over a number of documents
• $limit
Limit number of documents
• $redact
Restrict documents
• $out
Sends results to a new collection
Aggregation Pipeline
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
Aggregation Pipeline
$match
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds} {}
Aggregation Pipeline
$match
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds} {}
{★ds}
{★ds}
{★ds}
Aggregation Pipeline
$match $project
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds} {}
{★ds}
{★ds}
{★ds}
{=d+s}
Aggregation Pipeline
$match $project
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds} {}
{★ds}
{★ds}
{★ds}
{★}
{★}
{★}
{=d+s}
Aggregation Pipeline
$match $project $lookup
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds} {}
{★ds}
{★ds}
{★ds}
{★}
{★}
{★}
{★}
{★}
{★}
{★}
{=d+s}
Aggregation Pipeline
$match $project $lookup
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds} {}
{★ds}
{★ds}
{★ds}
{★}
{★}
{★}
{★}
{★}
{★}
{★}
{=d+s}
{★[]}
{★[]}
{★}
Aggregation Pipeline
$match $project $lookup $group
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds}
{★ds} {}
{★ds}
{★ds}
{★ds}
{★}
{★}
{★}
{★}
{★}
{★}
{★}
{=d+s}
{
Σ λ σ}
{
Σ λ σ}
{
Σ λ σ}
{★[]}
{★[]}
{★}
Esempio: US Census Data
• Census data dal 1990, 2000, 2010
• Domande:
– Quale US Division è la densità con il piu alto tasso di crescita?
– Division = a group of US States
– Population density = Area of division/# of people
– Data is provided at the state level
US Regions and Divisions
Document Model
{ "_id" : ObjectId("54e23c7b28099359f5661525"),
"name" : "California",
"region" : "West",
"data" : [
{ "totalPop" : 33871648,
"totalHouse" : 12214549,
"occHouse" : 11502870,
"year" : 2000},
{ "totalPop" : 37253956,
"totalHouse" : 13680081,
"occHouse" : 12577498,
"year" : 2010},
{ "totalPop" : 29760021,
"totalHouse" : 11182882,
"occHouse" : 29008161,
"year" : 1990}
],
…
}
Area US Totale
db.cData.aggregate([
{"$group" : {
"_id" : null,
"totalArea" : {$sum : "$areaM"},
”avgArea" : {$avg : "$areaM"}
}}
])
$group
• Raggruppa i documenti per valore
– Field reference, object, constant
– Calcoli altri campi di output
• $max, $min, $avg, $sum
• $addToSet, $push
• $first, $last
– Processa tutti i dati in memoria di default
Area per Regione
db.cData.aggregate([
{"$group" : {
"_id" : "$region",
"totalArea" : {$sum : "$areaM"},
"avgArea" : {$avg : "$areaM"},
"numStates" : {$sum : 1},
"states" : {$push : "$name"}
}
}
])
Calcola l’Area media degli Stati per Regione
{state: ”New York",
areaM: 218,
region: “North East"
}
{state: ”New Jersey",
areaM: 90,
region: “North East”
}
{state: “California",
area: 300,
region: “West"
}
{ $group: {
_id: "$region",
avgAreaM: {$avg: ”$areaM" }
}}
{ _id: ”North East",
avgAreaM: 154}
{_id: “West",
avgAreaM: 300}
Popolazione US Totale per Anno
db.cData.aggregate([
{$unwind : "$data"},
{$group : {
"_id" : "$data.year",
"totalPop" : {$sum :"$data.totalPop"}}},
{$sort : {"totalPop" : 1}}
])
$unwind
• Opera su un campo array
– Crea documenti dagli elementi dell’array
• Gli Array sono sostituiti dal valore degli elementi
• Se il campo array manca → no output
• Se il campo non è un array → errore
– Pipe a $group per aggregare
$unwind
{ state: ”New York",
census: [1990, 2000, 2010]}
{ state: ”New Jersey",
census: [1990, 2000]}
{ state: “California",
census: [1980, 1990, 2000, 2010]}
{ state: ”Delaware",
census: [1990, 2000]}
{ $unwind: $census }
{ state: “New York”, census: 1990}
{ state: “New York”, census: 2000}
{ state: “New York”, census: 2010}
{ state: “New Jersey”, census: 1990}
{ state: “New Jersey”, census: 2000}
$match
• Filtra I documenti
– Usa la stessa sintassi del .find()
$match
{state: ”New York",
areaM: 218,
region: “North East"
}
{state: ”Oregon",
areaM: 245,
region: “West”
}
{state: “California",
areaM: 300,
region: “West"
}
{state: ”Oregon", areaM: 245,
region:“West”}
{state: “California", areaM: 300,
region: “West"}
{ $match:
{ “region” : “West” }
}
Delta Popolazione per Stato dal 1990 al 2010
db.cData.aggregate([
{$unwind : "$data"},
{$sort : {"data.year" : 1}},
{$group : { "_id" : "$name",
"pop1990" : {"$first" : "$data.totalPop"},
"pop2010" : {"$last" : "$data.totalPop"}}},
{$project : {"_id" : 0,
"name" : "$_id",
"delta" : {"$subtract" : ["$pop2010", "$pop1990"]},
"pop1990" : 1,
"pop2010” : 1}
}])
$sort, $limit, $skip
• Ordina I documenti per uno o più campi
– Stessa sintassi dei cursori
– Aspetta la piepeline precedente
– In-memory se non all’inizio della pipeline e indicizzato
• Limit e skip stesso comportamento dei
cursori
Includere e Escludere Campi
{
"_id" : "Virginia”,
"pop1990" : 453588,
"pop2010" : 3725789
}
{
"_id" : "South Dakota",
"pop1990" : 453588,
"pop2010" : 3725789
}
{ $project:
{ “_id” : 0,
“pop1990” : 1,
“pop2010” : 1}
}
{"pop1990" : 453588,
"pop2010" : 3725789}
{"pop1990" : 453588,
"pop2010" : 3725789}
Rinominare e Calcolare Campi
{ $project:
{ “_id” : 0,
“pop1990” : 0,
“pop2010” : 0,
“name” : “$_id”,
"delta" :
{"$subtract" :
["$pop2010",
"$pop1990"]}}
}
{
"_id" : "Virginia”,
"pop1990" : 6187358,
"pop2010" : 8001024
}
{
"_id" : "South Dakota",
"pop1990" : 696004,
"pop2010" : 814180
} {”name" : “Virginia”,
”delta" : 1813666}
{“name" : “South Dakota”,
“delta" : 118176}
$geoNear
• Ordina/Filtra Documenti per posizione
– Richiede un indice geospaziale
– L’Output include la distanza fisica
– Deve essere il primo stage di aggregazione
$geoNear
{"_id" : "Virginia”,
"pop1990" : 6187358,
"pop2010" : 8001024,
“center” :
{“type” : “Point”,
“coordinates” :
[78.6, 37.5]}}
{ "_id" : ”Tennessee",
"pop1990" : 4877185,
"pop2010" : 6346105,
“center” :
{“type” : “Point”,
“coordinates” :
[86.6, 37.8]}}
{"_id" : ”Tennessee",
"pop1990" : 4877185,
"pop2010" : 6346105,
“center” :
{“type” : “Point”,
“coordinates” :
[86.6, 37.8]}}
{$geoNear : {
"near”: {"type”: "Point",
"coordinates”:
[90, 35]},
maxDistance : 500000,
spherical : true }}
Opzioni di Aggregate
db.cData.aggregate([<pipeline stages>],
{‘explain’ : false
'allowDiskUse' : true,
'cursor' : {'batchSize' : 5}})
• explain – simile a find().explain()
• allowDiskUse – Abilita l’uso del disco
• cursor – specifica la taglia del risultato iniziale
Sharding
• Carico diviso tra gli shard
– Shard eseguono la pipeline fino
ad un certo punto
– Lo shard primario unisce I
cursori e continua il processing
– Usate explain per analizzare lo
split della pipeline
– $match inziale può escludere
alcuni shard inutili
*Prior to v2.6 second stage pipeline processing was
done by mongos
Alternative Esistenti alle Join
{ "_id": 10000,
"items": [
{ "productName": "laptop",
"unitPrice": 1000,
"weight": 1.2,
"remainingStock": 23},
{ "productName": "mouse",
"unitPrice": 20,
"weight": 0.2,
"remainingStock": 276}],
…
}
• Option 1: Includere tutti I dati
di un ordine nello stesso
documento
– Fast read
• Una find ritorna tutti I dati richiesti
– Consuma spazio extra
• I dettagli di ogni prodotti sono in tanti
ordini
– Complesso da mantenere
• Un cambiamento di un attrobuto di un
prodotto deve essere propagato all’interno
degli ordini
orders
Alternative Esistenti alle Join
{
"_id": 10000,
"items": [
12345,
54321
],
...
}
• Option 2: Il documento degli
ordini referenzia I documenti
dei prodotti
– Read piu lente
• Multiple trips al database
– Efficiente uso dello spazio
• I dettagli dei prodotti sono memorizzati una
volta sola
– Perde point-in-time snapshot di tutto il record
– Logica nell’applicazione
• Deve iterare sull’ID prodotto per trovare
tutti I documenti dei prodotti
• RDBMS automatizza con unaJOIN
orders
{
"_id": 12345,
"productName": "laptop",
"unitPrice": 1000,
"weight": 1.2,
"remainingStock": 23
}
{
"_id": 54321,
"productName": "mouse",
"unitPrice": 20,
"weight": 0.2,
"remainingStock": 276
}
products
Il vincitore?
• In generale, Opzione 1 vince
– Performance e il contenere tutto in un solo posto batte l’efficienza dello
spazio e la normalizzazione
– Ci sono eccezioni
• e.g. Commenti in un blog post -> unbounded size
• Tuttavia l’Analytics può beneficiare del combinare I dati di
diverse collection
$lookup
• Left-outer join
– Include tutti I documenti della
collection di sinistra
– Per ogni documenti della
collection di sinistra trova I
documenti corrispondenti dalla
collection di destra e li
incapsula
Left Collection Right Collection
$lookup
db.leftCollection.aggregate([{
$lookup:
{
from: “rightCollection”,
localField: “leftVal”,
foreignField: “rightVal”,
as: “embeddedData”
}
}])
Left Collection Right Collection
BI Connector
MongoDB
BI
Connector
Mapping meta-data Application data
{name:
“Andrew”,
address:
{street:…
}}
DocumentTableAnalytics & visualization
Sommario
• A pipeline di operazioni
• Select, project, group, sort
• $out deve essere l’ultimo operatore
• Ci sono vari tipi di accumulatori (guardate la documentazione
di $group)
• Sistema molto potente per analizzare e trasformare i dati
• Shard aware per avere il massimo del guadagno dai grandi
cluster
Questions?
Back to Basics, webinar 5: Introduzione ad Aggregation Framework

More Related Content

What's hot

Session 02 - schema design e architettura
Session 02 - schema design e architetturaSession 02 - schema design e architettura
Session 02 - schema design e architetturaMongoDB
 
MongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework MeetingMongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework Meetingguest67beeb9
 
MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009Massimiliano Dessì
 
Advanced Database Models and Architectures: Big Data: MySQL VS MongoDB
Advanced Database Models and Architectures: Big Data: MySQL VS MongoDBAdvanced Database Models and Architectures: Big Data: MySQL VS MongoDB
Advanced Database Models and Architectures: Big Data: MySQL VS MongoDBLuca Marignati
 
MongoDB SpringFramework Meeting september 2009
MongoDB SpringFramework Meeting september 2009MongoDB SpringFramework Meeting september 2009
MongoDB SpringFramework Meeting september 2009Massimiliano Dessì
 
How to develop modern web application - With no money and no Javascript
How to develop modern web application - With no money and no JavascriptHow to develop modern web application - With no money and no Javascript
How to develop modern web application - With no money and no JavascriptAndrea Tosato
 
Programmazione web libera dai framework
Programmazione web libera dai frameworkProgrammazione web libera dai framework
Programmazione web libera dai frameworkFrancesca1980
 
Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)
Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)
Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)MongoDB
 
MongoDB User Group Padova - Overviews iniziale su MongoDB
MongoDB User Group Padova - Overviews iniziale su MongoDBMongoDB User Group Padova - Overviews iniziale su MongoDB
MongoDB User Group Padova - Overviews iniziale su MongoDBStefano Dindo
 

What's hot (10)

Session 02 - schema design e architettura
Session 02 - schema design e architetturaSession 02 - schema design e architettura
Session 02 - schema design e architettura
 
MongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework MeetingMongoDb and Scala SpringFramework Meeting
MongoDb and Scala SpringFramework Meeting
 
MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009MongoDB Scala Roma SpringFramework Meeting2009
MongoDB Scala Roma SpringFramework Meeting2009
 
Advanced Database Models and Architectures: Big Data: MySQL VS MongoDB
Advanced Database Models and Architectures: Big Data: MySQL VS MongoDBAdvanced Database Models and Architectures: Big Data: MySQL VS MongoDB
Advanced Database Models and Architectures: Big Data: MySQL VS MongoDB
 
MongoDB SpringFramework Meeting september 2009
MongoDB SpringFramework Meeting september 2009MongoDB SpringFramework Meeting september 2009
MongoDB SpringFramework Meeting september 2009
 
How to develop modern web application - With no money and no Javascript
How to develop modern web application - With no money and no JavascriptHow to develop modern web application - With no money and no Javascript
How to develop modern web application - With no money and no Javascript
 
Programmazione web libera dai framework
Programmazione web libera dai frameworkProgrammazione web libera dai framework
Programmazione web libera dai framework
 
Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)
Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)
Back to Basics 4: Introduzione al partizionamento orizzontale (sharding)
 
Franco Caporale Couchbase Milano
Franco Caporale Couchbase MilanoFranco Caporale Couchbase Milano
Franco Caporale Couchbase Milano
 
MongoDB User Group Padova - Overviews iniziale su MongoDB
MongoDB User Group Padova - Overviews iniziale su MongoDBMongoDB User Group Padova - Overviews iniziale su MongoDB
MongoDB User Group Padova - Overviews iniziale su MongoDB
 

Viewers also liked

《少,但是更好》專書讀書會 20160727
《少,但是更好》專書讀書會 20160727 《少,但是更好》專書讀書會 20160727
《少,但是更好》專書讀書會 20160727 grace-to-faith
 
Back to Basics Webinar 5: Introduction to the Aggregation Framework
Back to Basics Webinar 5: Introduction to the Aggregation FrameworkBack to Basics Webinar 5: Introduction to the Aggregation Framework
Back to Basics Webinar 5: Introduction to the Aggregation FrameworkMongoDB
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesBack to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesMongoDB
 
Beautiful picture (2)
Beautiful picture (2)Beautiful picture (2)
Beautiful picture (2)KHayashi
 
Romantic atmosphere
Romantic atmosphereRomantic atmosphere
Romantic atmosphereRenny
 
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...festival ICT 2016
 
人生的秘訣只有6個字
人生的秘訣只有6個字人生的秘訣只有6個字
人生的秘訣只有6個字KHayashi
 
2013 01-12 明慧-飲食有節-不時不食、不時不植
2013 01-12 明慧-飲食有節-不時不食、不時不植2013 01-12 明慧-飲食有節-不時不食、不時不植
2013 01-12 明慧-飲食有節-不時不食、不時不植yangmarissa
 
Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Andrew Morgan
 
Securing Your MongoDB Implementation
Securing Your MongoDB ImplementationSecuring Your MongoDB Implementation
Securing Your MongoDB ImplementationMongoDB
 
Webinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDBWebinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDBMongoDB
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in DocumentsMongoDB
 
Back to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production DeploymentBack to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production DeploymentMongoDB
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationMongoDB
 
MongoDB for Time Series Data
MongoDB for Time Series DataMongoDB for Time Series Data
MongoDB for Time Series DataMongoDB
 
MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...
MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...
MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...MongoDB
 
Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLMongoDB
 

Viewers also liked (20)

《少,但是更好》專書讀書會 20160727
《少,但是更好》專書讀書會 20160727 《少,但是更好》專書讀書會 20160727
《少,但是更好》專書讀書會 20160727
 
Back to Basics Webinar 5: Introduction to the Aggregation Framework
Back to Basics Webinar 5: Introduction to the Aggregation FrameworkBack to Basics Webinar 5: Introduction to the Aggregation Framework
Back to Basics Webinar 5: Introduction to the Aggregation Framework
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial IndexesBack to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
 
Beautiful picture (2)
Beautiful picture (2)Beautiful picture (2)
Beautiful picture (2)
 
20150823Words
20150823Words20150823Words
20150823Words
 
Romantic atmosphere
Romantic atmosphereRomantic atmosphere
Romantic atmosphere
 
20150118Words
20150118Words20150118Words
20150118Words
 
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
Lab pratico per la progettazione di soluzioni MongoDB in ambito Internet of T...
 
人生的秘訣只有6個字
人生的秘訣只有6個字人生的秘訣只有6個字
人生的秘訣只有6個字
 
2013 01-12 明慧-飲食有節-不時不食、不時不植
2013 01-12 明慧-飲食有節-不時不食、不時不植2013 01-12 明慧-飲食有節-不時不食、不時不植
2013 01-12 明慧-飲食有節-不時不食、不時不植
 
Document validation in MongoDB 3.2
Document validation in MongoDB 3.2Document validation in MongoDB 3.2
Document validation in MongoDB 3.2
 
Securing Your MongoDB Implementation
Securing Your MongoDB ImplementationSecuring Your MongoDB Implementation
Securing Your MongoDB Implementation
 
Webinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDBWebinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDB
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in Documents
 
Back to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production DeploymentBack to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production Deployment
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
 
MongoDB for Time Series Data
MongoDB for Time Series DataMongoDB for Time Series Data
MongoDB for Time Series Data
 
MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...
MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...
MongoDB for Time Series Data Part 2: Analyzing Time Series Data Using the Agg...
 
Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQL
 

Similar to Back to Basics, webinar 5: Introduzione ad Aggregation Framework

I Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utentiI Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utentiThinkOpen
 
Introduzione ai Big Data e alla scienza dei dati - Exploratory Data Analysis
Introduzione ai Big Data e alla scienza dei dati - Exploratory Data AnalysisIntroduzione ai Big Data e alla scienza dei dati - Exploratory Data Analysis
Introduzione ai Big Data e alla scienza dei dati - Exploratory Data AnalysisVincenzo Manzoni
 
Web GIS, statistical geospatial data visualization and real time monitoring
Web GIS, statistical geospatial data visualization and real time monitoringWeb GIS, statistical geospatial data visualization and real time monitoring
Web GIS, statistical geospatial data visualization and real time monitoringALESSANDRO CAPEZZUOLI
 
Couchbase Meetup - "Introduzione a NoSQL e Couchbase"
Couchbase Meetup - "Introduzione a NoSQL e Couchbase"Couchbase Meetup - "Introduzione a NoSQL e Couchbase"
Couchbase Meetup - "Introduzione a NoSQL e Couchbase"Franco Caporale
 
Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)PgTraining
 
scipy e rpy per l'analisi degli acquisti della pubblica amministrazione
scipy e rpy per l'analisi degli acquisti della pubblica amministrazionescipy e rpy per l'analisi degli acquisti della pubblica amministrazione
scipy e rpy per l'analisi degli acquisti della pubblica amministrazioneFrancesco Cavazzana
 
OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...
OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...
OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...giovannibiallo
 
2014 it - app dev series - 04 - indicizzazione
2014   it - app dev series - 04 - indicizzazione2014   it - app dev series - 04 - indicizzazione
2014 it - app dev series - 04 - indicizzazioneMongoDB
 
SQL Saturday 2019 - Event Processing with Spark
SQL Saturday 2019 - Event Processing with SparkSQL Saturday 2019 - Event Processing with Spark
SQL Saturday 2019 - Event Processing with SparkAlessio Biasiutti
 
SQL Server Modern Query Processing
SQL Server Modern Query ProcessingSQL Server Modern Query Processing
SQL Server Modern Query ProcessingGianluca Hotz
 
Introduzione ai Big Data e alla scienza dei dati - Big Data
Introduzione ai Big Data e alla scienza dei dati - Big DataIntroduzione ai Big Data e alla scienza dei dati - Big Data
Introduzione ai Big Data e alla scienza dei dati - Big DataVincenzo Manzoni
 
Webinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance Tuning
Webinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance TuningWebinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance Tuning
Webinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance TuningMongoDB
 
Le novita di MongoDB 3.6
Le novita di MongoDB 3.6Le novita di MongoDB 3.6
Le novita di MongoDB 3.6MongoDB
 
OpenStreetMap - una panoramica
OpenStreetMap - una panoramicaOpenStreetMap - una panoramica
OpenStreetMap - una panoramicaEduard Natale
 
Reccomandation engine with GraphDB
Reccomandation engine with GraphDBReccomandation engine with GraphDB
Reccomandation engine with GraphDBPiero Bozzolo
 
OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa
OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa
OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa OpenCoesione
 
La proposta di SAS e Sistemi Territoriali per l'Open Government
La proposta di SAS e Sistemi Territoriali per l'Open GovernmentLa proposta di SAS e Sistemi Territoriali per l'Open Government
La proposta di SAS e Sistemi Territoriali per l'Open GovernmentAlessandro Greco
 

Similar to Back to Basics, webinar 5: Introduzione ad Aggregation Framework (20)

I Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utentiI Graph Database: analisi del comportamento degli utenti
I Graph Database: analisi del comportamento degli utenti
 
Introduzione ai Big Data e alla scienza dei dati - Exploratory Data Analysis
Introduzione ai Big Data e alla scienza dei dati - Exploratory Data AnalysisIntroduzione ai Big Data e alla scienza dei dati - Exploratory Data Analysis
Introduzione ai Big Data e alla scienza dei dati - Exploratory Data Analysis
 
Web GIS, statistical geospatial data visualization and real time monitoring
Web GIS, statistical geospatial data visualization and real time monitoringWeb GIS, statistical geospatial data visualization and real time monitoring
Web GIS, statistical geospatial data visualization and real time monitoring
 
Couchbase Meetup - "Introduzione a NoSQL e Couchbase"
Couchbase Meetup - "Introduzione a NoSQL e Couchbase"Couchbase Meetup - "Introduzione a NoSQL e Couchbase"
Couchbase Meetup - "Introduzione a NoSQL e Couchbase"
 
Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)
 
scipy e rpy per l'analisi degli acquisti della pubblica amministrazione
scipy e rpy per l'analisi degli acquisti della pubblica amministrazionescipy e rpy per l'analisi degli acquisti della pubblica amministrazione
scipy e rpy per l'analisi degli acquisti della pubblica amministrazione
 
OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...
OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...
OpenGeoData Italia 2014 - Emanuele Geri "Secondo modulo del corso: esperienza...
 
2014 it - app dev series - 04 - indicizzazione
2014   it - app dev series - 04 - indicizzazione2014   it - app dev series - 04 - indicizzazione
2014 it - app dev series - 04 - indicizzazione
 
SQL Saturday 2019 - Event Processing with Spark
SQL Saturday 2019 - Event Processing with SparkSQL Saturday 2019 - Event Processing with Spark
SQL Saturday 2019 - Event Processing with Spark
 
SQL Server Modern Query Processing
SQL Server Modern Query ProcessingSQL Server Modern Query Processing
SQL Server Modern Query Processing
 
Introduzione ai Big Data e alla scienza dei dati - Big Data
Introduzione ai Big Data e alla scienza dei dati - Big DataIntroduzione ai Big Data e alla scienza dei dati - Big Data
Introduzione ai Big Data e alla scienza dei dati - Big Data
 
Webinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance Tuning
Webinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance TuningWebinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance Tuning
Webinar Italiano: Back-to-Basics: Sessione 8 - Monitoraggio e Performance Tuning
 
Le novita di MongoDB 3.6
Le novita di MongoDB 3.6Le novita di MongoDB 3.6
Le novita di MongoDB 3.6
 
OpenStreetMap - una panoramica
OpenStreetMap - una panoramicaOpenStreetMap - una panoramica
OpenStreetMap - una panoramica
 
Reccomandation engine with GraphDB
Reccomandation engine with GraphDBReccomandation engine with GraphDB
Reccomandation engine with GraphDB
 
OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa
OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa
OpenCoesione DJD 2012 - Rappresentare i dati di OpenCoesione su una mappa
 
OrientDB & Big Data
OrientDB & Big DataOrientDB & Big Data
OrientDB & Big Data
 
Ortocloud l'applicazione per fare orto su Bluemix
Ortocloud l'applicazione per fare orto su BluemixOrtocloud l'applicazione per fare orto su Bluemix
Ortocloud l'applicazione per fare orto su Bluemix
 
Oai Data Adapter
Oai Data AdapterOai Data Adapter
Oai Data Adapter
 
La proposta di SAS e Sistemi Territoriali per l'Open Government
La proposta di SAS e Sistemi Territoriali per l'Open GovernmentLa proposta di SAS e Sistemi Territoriali per l'Open Government
La proposta di SAS e Sistemi Territoriali per l'Open Government
 

More from MongoDB

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 AtlasMongoDB
 
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
 
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
 
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 MongoDBMongoDB
 
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
 
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 DataMongoDB
 
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 StartMongoDB
 
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
 
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.2MongoDB
 
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
 
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
 
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 MindsetMongoDB
 
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 JumpstartMongoDB
 
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
 
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
 
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
 
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 DiveMongoDB
 
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 & GolangMongoDB
 
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
 
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...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...
 

Back to Basics, webinar 5: Introduzione ad Aggregation Framework

  • 1. MongoDBEurope2016 Old Billingsgate, London 15th November mongodb.com/europe egistratevi con il codice massimobrignoli20 per il 20% di scon
  • 2. Massimo Brignoli Principal Solution Architect, EMEA @massimobrignoli Back to Basics 2016 : Webinar 5 Introduzione all’Aggregation Framework
  • 3. Riassunto • Webinar 1 – Introduzione a NoSQL – I diversi tipi di database NoSQL – MongoDB come document database • Webinar 2 – La nostra prima applicazione – Creazione di database e collectione – CRUD, indici e explain • Webinar 3 – Schema Design – Schema dinamico – Approcci all’Embedding • Webinar 4 –Indici Full-Text e geospaziali
  • 4. L’Aggregation Framework • Motore anallitico per MongoDB • Pensate ai due tipi di database: OLTP e OLAP • OLTP : Online Transaction Processing – Prenotazione voli, – Bancomat, – Prenotazione taxi • OLAP : Online Analytical Processing – Quale biglietto ci fa guadagnare di più? – Quando dobbiam ricaricare il bancomat? – Di quanti taxi abbiamo bisogno per effettuare il servizio ad est di Milano?
  • 6. OLAP - There Be (Hadoop) Dragons Here • Query OLAP sono spesso scansioni di tabelle • L’output delle query è spesso strutturato per analisi future e comparazioni • Molti clienti stanno guardando a Spark e Hadoop ma: – La complessità è astronomica – Focus sugli algoritmi di analisi dei dati (dovete scrivere un programma) – Richiede una certa conoscenza di algoritmi paralleli • L’aggregation framework è un tool molto più ”gentile” • L’obiettivo è di fare quello che volete fare in meno temppo
  • 7. Analytics on MongoDB Data • Extract data from MongoDB and perform complex analytics with Hadoop – Batch rather than real-time – Extra nodes to manage • Direct access to MongoDB from SPARK • MongoDB BI Connector – Direct SQL Access from BI Tools • MongoDB aggregation pipeline – Real-time – Live, operational data set – Narrower feature set Hadoop Connector MapReduce & HDFS SQL Connector
  • 8. What is an Aggregation Pipeline? • Una serie di trasformazioni di documenti – Eseguita in stage – L’input iniziale è una collection – L’output può essere un cursorse o una collection • Ricca libreria di funzioni – Filter, compute, group e summarize data – L’output di uno stage è l’input dello stage successivo – Le operazioni sono eseguite in ordine sequenziale
  • 9. Operatori della Pipeline • $match Filter documents • $geoNear Geospherical query • $project Reshape documents • $lookup New – Left-outer equi joins • $unwind Expand documents • $group Summarize documents • $sample New – Randomly selects a subset of documents • $sort Order documents • $skip Jump over a number of documents • $limit Limit number of documents • $redact Restrict documents • $out Sends results to a new collection
  • 15. Aggregation Pipeline $match $project $lookup {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {} {★ds} {★ds} {★ds} {★} {★} {★} {★} {★} {★} {★} {=d+s}
  • 16. Aggregation Pipeline $match $project $lookup {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {} {★ds} {★ds} {★ds} {★} {★} {★} {★} {★} {★} {★} {=d+s} {★[]} {★[]} {★}
  • 17. Aggregation Pipeline $match $project $lookup $group {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {★ds} {} {★ds} {★ds} {★ds} {★} {★} {★} {★} {★} {★} {★} {=d+s} { Σ λ σ} { Σ λ σ} { Σ λ σ} {★[]} {★[]} {★}
  • 18. Esempio: US Census Data • Census data dal 1990, 2000, 2010 • Domande: – Quale US Division è la densità con il piu alto tasso di crescita? – Division = a group of US States – Population density = Area of division/# of people – Data is provided at the state level
  • 19. US Regions and Divisions
  • 20. Document Model { "_id" : ObjectId("54e23c7b28099359f5661525"), "name" : "California", "region" : "West", "data" : [ { "totalPop" : 33871648, "totalHouse" : 12214549, "occHouse" : 11502870, "year" : 2000}, { "totalPop" : 37253956, "totalHouse" : 13680081, "occHouse" : 12577498, "year" : 2010}, { "totalPop" : 29760021, "totalHouse" : 11182882, "occHouse" : 29008161, "year" : 1990} ], … }
  • 21. Area US Totale db.cData.aggregate([ {"$group" : { "_id" : null, "totalArea" : {$sum : "$areaM"}, ”avgArea" : {$avg : "$areaM"} }} ])
  • 22. $group • Raggruppa i documenti per valore – Field reference, object, constant – Calcoli altri campi di output • $max, $min, $avg, $sum • $addToSet, $push • $first, $last – Processa tutti i dati in memoria di default
  • 23. Area per Regione db.cData.aggregate([ {"$group" : { "_id" : "$region", "totalArea" : {$sum : "$areaM"}, "avgArea" : {$avg : "$areaM"}, "numStates" : {$sum : 1}, "states" : {$push : "$name"} } } ])
  • 24. Calcola l’Area media degli Stati per Regione {state: ”New York", areaM: 218, region: “North East" } {state: ”New Jersey", areaM: 90, region: “North East” } {state: “California", area: 300, region: “West" } { $group: { _id: "$region", avgAreaM: {$avg: ”$areaM" } }} { _id: ”North East", avgAreaM: 154} {_id: “West", avgAreaM: 300}
  • 25. Popolazione US Totale per Anno db.cData.aggregate([ {$unwind : "$data"}, {$group : { "_id" : "$data.year", "totalPop" : {$sum :"$data.totalPop"}}}, {$sort : {"totalPop" : 1}} ])
  • 26. $unwind • Opera su un campo array – Crea documenti dagli elementi dell’array • Gli Array sono sostituiti dal valore degli elementi • Se il campo array manca → no output • Se il campo non è un array → errore – Pipe a $group per aggregare
  • 27. $unwind { state: ”New York", census: [1990, 2000, 2010]} { state: ”New Jersey", census: [1990, 2000]} { state: “California", census: [1980, 1990, 2000, 2010]} { state: ”Delaware", census: [1990, 2000]} { $unwind: $census } { state: “New York”, census: 1990} { state: “New York”, census: 2000} { state: “New York”, census: 2010} { state: “New Jersey”, census: 1990} { state: “New Jersey”, census: 2000}
  • 28. $match • Filtra I documenti – Usa la stessa sintassi del .find()
  • 29. $match {state: ”New York", areaM: 218, region: “North East" } {state: ”Oregon", areaM: 245, region: “West” } {state: “California", areaM: 300, region: “West" } {state: ”Oregon", areaM: 245, region:“West”} {state: “California", areaM: 300, region: “West"} { $match: { “region” : “West” } }
  • 30. Delta Popolazione per Stato dal 1990 al 2010 db.cData.aggregate([ {$unwind : "$data"}, {$sort : {"data.year" : 1}}, {$group : { "_id" : "$name", "pop1990" : {"$first" : "$data.totalPop"}, "pop2010" : {"$last" : "$data.totalPop"}}}, {$project : {"_id" : 0, "name" : "$_id", "delta" : {"$subtract" : ["$pop2010", "$pop1990"]}, "pop1990" : 1, "pop2010” : 1} }])
  • 31. $sort, $limit, $skip • Ordina I documenti per uno o più campi – Stessa sintassi dei cursori – Aspetta la piepeline precedente – In-memory se non all’inizio della pipeline e indicizzato • Limit e skip stesso comportamento dei cursori
  • 32. Includere e Escludere Campi { "_id" : "Virginia”, "pop1990" : 453588, "pop2010" : 3725789 } { "_id" : "South Dakota", "pop1990" : 453588, "pop2010" : 3725789 } { $project: { “_id” : 0, “pop1990” : 1, “pop2010” : 1} } {"pop1990" : 453588, "pop2010" : 3725789} {"pop1990" : 453588, "pop2010" : 3725789}
  • 33. Rinominare e Calcolare Campi { $project: { “_id” : 0, “pop1990” : 0, “pop2010” : 0, “name” : “$_id”, "delta" : {"$subtract" : ["$pop2010", "$pop1990"]}} } { "_id" : "Virginia”, "pop1990" : 6187358, "pop2010" : 8001024 } { "_id" : "South Dakota", "pop1990" : 696004, "pop2010" : 814180 } {”name" : “Virginia”, ”delta" : 1813666} {“name" : “South Dakota”, “delta" : 118176}
  • 34. $geoNear • Ordina/Filtra Documenti per posizione – Richiede un indice geospaziale – L’Output include la distanza fisica – Deve essere il primo stage di aggregazione
  • 35. $geoNear {"_id" : "Virginia”, "pop1990" : 6187358, "pop2010" : 8001024, “center” : {“type” : “Point”, “coordinates” : [78.6, 37.5]}} { "_id" : ”Tennessee", "pop1990" : 4877185, "pop2010" : 6346105, “center” : {“type” : “Point”, “coordinates” : [86.6, 37.8]}} {"_id" : ”Tennessee", "pop1990" : 4877185, "pop2010" : 6346105, “center” : {“type” : “Point”, “coordinates” : [86.6, 37.8]}} {$geoNear : { "near”: {"type”: "Point", "coordinates”: [90, 35]}, maxDistance : 500000, spherical : true }}
  • 36. Opzioni di Aggregate db.cData.aggregate([<pipeline stages>], {‘explain’ : false 'allowDiskUse' : true, 'cursor' : {'batchSize' : 5}}) • explain – simile a find().explain() • allowDiskUse – Abilita l’uso del disco • cursor – specifica la taglia del risultato iniziale
  • 37. Sharding • Carico diviso tra gli shard – Shard eseguono la pipeline fino ad un certo punto – Lo shard primario unisce I cursori e continua il processing – Usate explain per analizzare lo split della pipeline – $match inziale può escludere alcuni shard inutili *Prior to v2.6 second stage pipeline processing was done by mongos
  • 38. Alternative Esistenti alle Join { "_id": 10000, "items": [ { "productName": "laptop", "unitPrice": 1000, "weight": 1.2, "remainingStock": 23}, { "productName": "mouse", "unitPrice": 20, "weight": 0.2, "remainingStock": 276}], … } • Option 1: Includere tutti I dati di un ordine nello stesso documento – Fast read • Una find ritorna tutti I dati richiesti – Consuma spazio extra • I dettagli di ogni prodotti sono in tanti ordini – Complesso da mantenere • Un cambiamento di un attrobuto di un prodotto deve essere propagato all’interno degli ordini orders
  • 39. Alternative Esistenti alle Join { "_id": 10000, "items": [ 12345, 54321 ], ... } • Option 2: Il documento degli ordini referenzia I documenti dei prodotti – Read piu lente • Multiple trips al database – Efficiente uso dello spazio • I dettagli dei prodotti sono memorizzati una volta sola – Perde point-in-time snapshot di tutto il record – Logica nell’applicazione • Deve iterare sull’ID prodotto per trovare tutti I documenti dei prodotti • RDBMS automatizza con unaJOIN orders { "_id": 12345, "productName": "laptop", "unitPrice": 1000, "weight": 1.2, "remainingStock": 23 } { "_id": 54321, "productName": "mouse", "unitPrice": 20, "weight": 0.2, "remainingStock": 276 } products
  • 40. Il vincitore? • In generale, Opzione 1 vince – Performance e il contenere tutto in un solo posto batte l’efficienza dello spazio e la normalizzazione – Ci sono eccezioni • e.g. Commenti in un blog post -> unbounded size • Tuttavia l’Analytics può beneficiare del combinare I dati di diverse collection
  • 41. $lookup • Left-outer join – Include tutti I documenti della collection di sinistra – Per ogni documenti della collection di sinistra trova I documenti corrispondenti dalla collection di destra e li incapsula Left Collection Right Collection
  • 42. $lookup db.leftCollection.aggregate([{ $lookup: { from: “rightCollection”, localField: “leftVal”, foreignField: “rightVal”, as: “embeddedData” } }]) Left Collection Right Collection
  • 43. BI Connector MongoDB BI Connector Mapping meta-data Application data {name: “Andrew”, address: {street:… }} DocumentTableAnalytics & visualization
  • 44. Sommario • A pipeline di operazioni • Select, project, group, sort • $out deve essere l’ultimo operatore • Ci sono vari tipi di accumulatori (guardate la documentazione di $group) • Sistema molto potente per analizzare e trasformare i dati • Shard aware per avere il massimo del guadagno dai grandi cluster