SlideShare a Scribd company logo
1 of 30
Download to read offline
Problemi con il Database?

@matteocollina	


http://500px.com/photo/27874937
Chiami un consulente?

http://500px.com/photo/22823315
Costruisci il TUO
database con
Costruisci il TUO
database con

Level*
* Not a Database

Storia
Storia dei DB
•

1960s: Dai nastri ai dischi per raggiungere accesso condiviso e interattività	


•

Late 1960s: Navigational Databases, links	


•

Early 1970s: Modello relazionale, content	


•

Late 1970s: SQL	


•

Early 1980s: Un database sul mio Desktop	


•

Late 1980s: Object Oriented Database	


•

2000s: velocità e scalabilità, NoSQL	


•

Early 2010s: non perdiamo una bella astrazione, NewSQLs
La tirannia delle
belle astrazioni
Che cos’è un DB?
Uno strumento per interagire
con dati strutturati, all’esterno del
core della nostra Applicazione
Core DB features
•

Persistenza	


•

Prestazione	


•

Semplificazione dell’accesso ai dati
complessi
•

Small Core, vibrant community	


•

Extreme modularity	


•

Reimplement everything in Javascript
Il Node.js dei DB?
•

Small Core: LevelUp - http://npm.im/levelup	


•

TUTTO è un modulo, scaricabile da NPM	


•

Sperimentazione di molti aspetti sia della teorica che
della pratica dei database e dei sistemi distribuiti	


•

Soluzioni specifiche
http://500px.com/photo/50810860
LevelDB
•

Open-source, embedded key/value store di Google	


•

Chiavi ordinate	


•

Valori compressi da Snappy	


•

Operazioni basilari: Get(), Put(), Del()	


•

Batch() Atomica	


•

Iterazioni bi-direzionali
LevelDB
LevelUP
•

Ispirato da LevelDB	


•

Supportato da un a key/value store per dati arbitrari, ordinati per
chiave	


•

put(), get(), del()	


•

Scritture atomiche via batch()	


•

ReadStream: l’ingrediente segreto	


•

WriteStream: per comodità	


•

Encoding: UTF-8, HEX, Binary, JSON, Typewise, your encoding.
ReadStream
•

La primitiva essenziale per tutte le feature più
complesse, ad esempio LevelGraph la usa per realizzare i
JOIN.	


•

E’ la primitiva fondamentale per accedere ai dati ordinati. 	


•

E’ possibile limitare il range tramite start e end
ReadStream
db.createReadStream({ start: 'Bol', end: 'Bolxff' })
.on('data', function (entry) {
console.log(entry.key)
})
!

// → Bologna
// → Bolzano
Key Structure
•

L’ordinamento e il recupero delle chiavi richiede un key
design	


•

Le chiavi sono un descrittore gerarchico del contenuto:
'countries~Ireland'
'countries~Italy'
...
'towns~Italy~Bologna'
'towns~Italy~Bolzano'
...
'streets~Italy~Bologna~Via Indipendenza'
'streets~Italy~Bologna~Via Rizzoli'
http://npm.im/levelmeup
levelmeup @ nodeconf.eu
BDFL: @rvagg
Level* Committers
RocksDB
•

Rilasciato Open Source il 14 Novembre 2013.	


•

Il 14 Novembre 2013 è già disponibile il “driver” per
LevelUp, http://npm.im/rocksdb	


•

RocksDB è un fork di LevelDB per gestire terabyte di
dati
@matteocollina
LevelGraph
LevelGraph
db.join([{ subject: db.v(“a"), predicate: “friend",object: db.v(“x") }, {
subject: db.v(“x"), predicate: “friend", object: db.v(“y") }],
function(err, results) {
// this will print all the 'friend of a friend triples..'
});
- Francesco Fullone - Enrico Zimuel - Federico Galassi - Matteo Collina -

JavaScript
best practices

http://www.jsbestpractices.it/
@matteocollina	

@rvagg

More Related Content

Viewers also liked

Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Matteo Collina
 
Enter the app era with ruby on rails
Enter the app era with ruby on railsEnter the app era with ruby on rails
Enter the app era with ruby on railsMatteo Collina
 
The internet of things - Rails Girls Galway
The internet of things - Rails Girls GalwayThe internet of things - Rails Girls Galway
The internet of things - Rails Girls GalwayMatteo Collina
 
Making things that works with us - First Italian Internet of Things Day
Making things that works with us - First Italian Internet of Things DayMaking things that works with us - First Italian Internet of Things Day
Making things that works with us - First Italian Internet of Things DayMatteo Collina
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Matteo Collina
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Matteo Collina
 
Building a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejsBuilding a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejsMatteo Collina
 
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015Matteo Collina
 
L'universo dietro alle App
L'universo dietro alle AppL'universo dietro alle App
L'universo dietro alle AppMatteo Collina
 
Operational transformation
Operational transformationOperational transformation
Operational transformationMatteo Collina
 
Exposing M2M to the REST of us
Exposing M2M to the REST of usExposing M2M to the REST of us
Exposing M2M to the REST of usMatteo Collina
 
Making things that work with us - Distill
Making things that work with us - DistillMaking things that work with us - Distill
Making things that work with us - DistillMatteo Collina
 
Making your washing machine talk with a power plant
Making your washing machine talk with a power plantMaking your washing machine talk with a power plant
Making your washing machine talk with a power plantMatteo Collina
 

Viewers also liked (14)

Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)
 
CI-18n
CI-18nCI-18n
CI-18n
 
Enter the app era with ruby on rails
Enter the app era with ruby on railsEnter the app era with ruby on rails
Enter the app era with ruby on rails
 
The internet of things - Rails Girls Galway
The internet of things - Rails Girls GalwayThe internet of things - Rails Girls Galway
The internet of things - Rails Girls Galway
 
Making things that works with us - First Italian Internet of Things Day
Making things that works with us - First Italian Internet of Things DayMaking things that works with us - First Italian Internet of Things Day
Making things that works with us - First Italian Internet of Things Day
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...
 
Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...Designing and developing mobile web applications with Mockup, Sencha Touch an...
Designing and developing mobile web applications with Mockup, Sencha Touch an...
 
Building a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejsBuilding a multi protocol broker for the internet of things using nodejs
Building a multi protocol broker for the internet of things using nodejs
 
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
No. la sottile arte di trovare il tempo dove non esite - codemotion 2015
 
L'universo dietro alle App
L'universo dietro alle AppL'universo dietro alle App
L'universo dietro alle App
 
Operational transformation
Operational transformationOperational transformation
Operational transformation
 
Exposing M2M to the REST of us
Exposing M2M to the REST of usExposing M2M to the REST of us
Exposing M2M to the REST of us
 
Making things that work with us - Distill
Making things that work with us - DistillMaking things that work with us - Distill
Making things that work with us - Distill
 
Making your washing machine talk with a power plant
Making your washing machine talk with a power plantMaking your washing machine talk with a power plant
Making your washing machine talk with a power plant
 

Similar to Crea il TUO database con LevelDB e Node.js

Back to Basics webinar 1 IT 17 - Introduzione ai NoSQL
Back to Basics webinar 1 IT 17 - Introduzione ai NoSQLBack to Basics webinar 1 IT 17 - Introduzione ai NoSQL
Back to Basics webinar 1 IT 17 - Introduzione ai NoSQLMongoDB
 
Back to Basics, webinar 1: Introduzione a NoSQL
Back to Basics, webinar 1: Introduzione a NoSQLBack to Basics, webinar 1: Introduzione a NoSQL
Back to Basics, webinar 1: Introduzione a NoSQLMongoDB
 
Azure Synapse: data lake & modern data warehouse dalla A alla Z
Azure Synapse: data lake &  modern data warehouse dalla A alla ZAzure Synapse: data lake &  modern data warehouse dalla A alla Z
Azure Synapse: data lake & modern data warehouse dalla A alla ZRoberto Messora
 
iot Saturday 2019 - PoC iot in 1 ora
iot Saturday 2019 - PoC iot in 1 oraiot Saturday 2019 - PoC iot in 1 ora
iot Saturday 2019 - PoC iot in 1 oraAlessio Biasiutti
 
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
 
Creare un Information Radiator con Delphi
Creare un Information Radiator con DelphiCreare un Information Radiator con Delphi
Creare un Information Radiator con DelphiMarco Breveglieri
 
Introduzione mongodb
Introduzione mongodbIntroduzione mongodb
Introduzione mongodbMarco Buttolo
 
Koha 19 4_cavaggion
Koha 19 4_cavaggionKoha 19 4_cavaggion
Koha 19 4_cavaggionHyperborea
 
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
 
Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015Codemotion
 
JBoss Data Grid Tech Lab
JBoss Data Grid Tech LabJBoss Data Grid Tech Lab
JBoss Data Grid Tech LabUgo Landini
 
Curriculum di Marco Bruni
Curriculum di Marco BruniCurriculum di Marco Bruni
Curriculum di Marco BruniMarco Bruni
 
Sencha touch: Sviluppare un'app - 4° parte
Sencha touch: Sviluppare un'app - 4° parteSencha touch: Sviluppare un'app - 4° parte
Sencha touch: Sviluppare un'app - 4° parteGiuseppe Toto
 
Novità di SQL Server 2017
Novità di SQL Server 2017Novità di SQL Server 2017
Novità di SQL Server 2017Gianluca Hotz
 
Database project alla riscossa
Database project alla riscossaDatabase project alla riscossa
Database project alla riscossaGian Maria Ricci
 
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e ArduinoRealizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e Arduinofibasile
 

Similar to Crea il TUO database con LevelDB e Node.js (20)

Back to Basics webinar 1 IT 17 - Introduzione ai NoSQL
Back to Basics webinar 1 IT 17 - Introduzione ai NoSQLBack to Basics webinar 1 IT 17 - Introduzione ai NoSQL
Back to Basics webinar 1 IT 17 - Introduzione ai NoSQL
 
Back to Basics, webinar 1: Introduzione a NoSQL
Back to Basics, webinar 1: Introduzione a NoSQLBack to Basics, webinar 1: Introduzione a NoSQL
Back to Basics, webinar 1: Introduzione a NoSQL
 
Azure Synapse: data lake & modern data warehouse dalla A alla Z
Azure Synapse: data lake &  modern data warehouse dalla A alla ZAzure Synapse: data lake &  modern data warehouse dalla A alla Z
Azure Synapse: data lake & modern data warehouse dalla A alla Z
 
iot Saturday 2019 - PoC iot in 1 ora
iot Saturday 2019 - PoC iot in 1 oraiot Saturday 2019 - PoC iot in 1 ora
iot Saturday 2019 - PoC iot in 1 ora
 
PoC IoT in 1 ora
PoC IoT in 1 oraPoC IoT in 1 ora
PoC IoT in 1 ora
 
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
 
Presentazione bd2
Presentazione bd2Presentazione bd2
Presentazione bd2
 
Creare un Information Radiator con Delphi
Creare un Information Radiator con DelphiCreare un Information Radiator con Delphi
Creare un Information Radiator con Delphi
 
Introduzione mongodb
Introduzione mongodbIntroduzione mongodb
Introduzione mongodb
 
Koha 19 4_cavaggion
Koha 19 4_cavaggionKoha 19 4_cavaggion
Koha 19 4_cavaggion
 
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"
 
Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015
 
JBoss Data Grid Tech Lab
JBoss Data Grid Tech LabJBoss Data Grid Tech Lab
JBoss Data Grid Tech Lab
 
OrientDB & Big Data
OrientDB & Big DataOrientDB & Big Data
OrientDB & Big Data
 
Curriculum di Marco Bruni
Curriculum di Marco BruniCurriculum di Marco Bruni
Curriculum di Marco Bruni
 
Azure DocumentDb
Azure DocumentDbAzure DocumentDb
Azure DocumentDb
 
Sencha touch: Sviluppare un'app - 4° parte
Sencha touch: Sviluppare un'app - 4° parteSencha touch: Sviluppare un'app - 4° parte
Sencha touch: Sviluppare un'app - 4° parte
 
Novità di SQL Server 2017
Novità di SQL Server 2017Novità di SQL Server 2017
Novità di SQL Server 2017
 
Database project alla riscossa
Database project alla riscossaDatabase project alla riscossa
Database project alla riscossa
 
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e ArduinoRealizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
 

Crea il TUO database con LevelDB e Node.js