6 capítulos de grafo e colher editora anderson claytom ano 1970
Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta
-
Upload
codemotion -
Category
Technology
-
view
1.390 -
download
2
description
Transcript of Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta
![Page 1: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/1.jpg)
Dal modello Relazionale al Grafo: cosa cambia?
Alfonso Focareta
[email protected] – Pro-Netics S.p.A. – NuvolaBase ltdTwitter : @afocareta
![Page 2: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/2.jpg)
Nome speakerMail speaker – company or community
RDBMS Features
• Born in 1970• Slow• Commonly used• Support SQL language
![Page 3: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/3.jpg)
Nome speakerMail speaker – company or community
3
Graph Database (Property Graph)
Graph = (Vertex,Edge)
![Page 4: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/4.jpg)
Nome speakerMail speaker – company or community
4
Graph
![Page 5: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/5.jpg)
Nome speakerMail speaker – company or community
5
Graph
An object that contains vertices and edges.
![Page 6: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/6.jpg)
Nome speakerMail speaker – company or community
6
Vertex
An object that is connected to other objects by edges.
![Page 7: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/7.jpg)
Nome speakerMail speaker – company or community
7
Edge
An object that connects two vertices.
![Page 8: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/8.jpg)
Nome speakerMail speaker – company or community
8
Graph “Real” example
Love Love
![Page 9: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/9.jpg)
Nome speakerMail speaker – company or community
9
Graph “Real Example” 2
Love Love
Know
Know Know
Sell
![Page 10: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/10.jpg)
Nome speakerMail speaker – company or community
10
Property Graph
• Key/value-based• Directed• multi-relational
![Page 11: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/11.jpg)
Nome speakerMail speaker – company or community
11
2012:The year of Graph (blogs.forrester.com)
• social media analytics• marketing campaign optimization• customer experience fine-tuning
![Page 12: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/12.jpg)
Nome speakerMail speaker – company or community
12
GraphDb list
• OrientDB• Neo4j• Dex• GiraffeDB
![Page 13: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/13.jpg)
Nome speakerMail speaker – company or community
13
Document-Graph database with the support of ACID Transactions, SQL and Native Queries, Asynchronous Commands, Intents.
![Page 14: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/14.jpg)
Nome speakerMail speaker – company or community
14
OrientDb - Fast
150.000 documents per second
10 billions of documents per day
![Page 15: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/15.jpg)
Nome speakerMail speaker – company or community
15
OrientDB – Transactional
Supports ACID Transaction:• Atomicity• Consistency• Isolation• Durability
![Page 16: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/16.jpg)
Nome speakerMail speaker – company or community
16
OrientDB – SQL
Supports SQL language with extensions to handle relationships without JOINs, manage trees and graphs of connected documents
![Page 17: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/17.jpg)
Nome speakerMail speaker – company or community
17
OrientDB – Web Ready
• HTTP• RESTful • JSON
![Page 18: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/18.jpg)
Nome speakerMail speaker – company or community
18
OrientDb - Ø config
download, unzip, run!
cut & paste the db
![Page 19: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/19.jpg)
Nome speakerMail speaker – company or community
19
OrientDB – Portability
• Runs everywhere is available Java® JRE1.5+• Driver in JAVA, Javascript, C, Php, Ruby, .NET, Python …
![Page 20: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/20.jpg)
Nome speakerMail speaker – company or community
20
OrientDb – Hooks
similar to triggers catch events against records, database and transactions implement custom cascade deletion algorithm
enforce constraints
![Page 21: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/21.jpg)
Nome speakerMail speaker – company or community
21
OrientDB - Free
FREE for any use : Open Source License Apache 2.0
![Page 22: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/22.jpg)
Nome speakerMail speaker – company or community
22
Example
Classical Business domain : Billing
Objects: • Bill• Customer• Vendor• Products
![Page 23: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/23.jpg)
Nome speakerMail speaker – company or community
23
Example Domain
![Page 24: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/24.jpg)
Nome speakerMail speaker – company or community
24
OrientDB – Create vertexODocument product = database.createVertex();vertex.field(”id", ”1");vertex.field(”price", 10000);
Vertex.field(“vat type”,10)vertex.save();
![Page 25: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/25.jpg)
Nome speakerMail speaker – company or community
25
OrientDB create EdgeODocument product= database.createVertex();vertex.field(”id", ”1");vertex.field(”price", 10000);
Vertex.field(“vat type”,10)
ODocument bill = database.createVertex();vertex2.field(”id", ”1");
ODocument edge = database.createEdge( product, bill);edge.field(”number", ”20");edge.save();
![Page 26: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/26.jpg)
Nome speakerMail speaker – company or community
26
OrientDB – remove Edge / delete Vertex
database.removeEdge( edge )
database.removeVertex( vertex )
![Page 27: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/27.jpg)
Nome speakerMail speaker – company or community
27
Demo
![Page 28: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/28.jpg)
Nome speakerMail speaker – company or community
28
ThinkerPopproposes standards for the world of GraphDB through the development of open source projects
![Page 29: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/29.jpg)
Nome speakerMail speaker – company or community
29
ThinkerPop - BlueprintsBlueprints is a collection of interfaces, implementations, ouplementations, and test suites for the property graph data model.
Blueprints is analogous to the JDBC, but for graph databases.
![Page 30: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/30.jpg)
Nome speakerMail speaker – company or community
30
BluePrints - ExampleGraph graph = new OrientGraph("/tmp/my_graph");
Vertex a = graph.addVertex(null);
Vertex b = graph.addVertex(null);
a.setProperty("name","marko");
b.setProperty("name","peter");
Edge e = graph.addEdge(null, a, b, "knows"); e.setProperty("since", 2006);
graph.shutdown();
![Page 31: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/31.jpg)
Nome speakerMail speaker – company or community
31
ThinkerPop - GremlinGremlin is a graph traversal language used for graph query, analysis, and manipulation.
![Page 32: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/32.jpg)
Nome speakerMail speaker – company or community
32
Gremlin - Example
TBD
![Page 33: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/33.jpg)
Nome speakerMail speaker – company or community
33
NuvolaBase
Create your GraphDatabase on the cloud in 1 minute.
www.nuvolabase.com
![Page 34: Dal modello Relazionale al Grafo: cosa cambia? By Alfonso Focareta](https://reader033.fdocuments.us/reader033/viewer/2022052822/554f4f7cb4c905423f8b5119/html5/thumbnails/34.jpg)
Dal modello Relazionale al Grafo: cosa cambia?
Alfonso Focareta
[email protected] Pro-Netics S.p.A. - Team Leader/Senior DeveloperNuvolaBase Ltd – Software EngineerTwitter : @afocareta