Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
•
•
•
•
Images from http://www.slideshare.net/debanjanmahata/an-introduction-to-nosql-graph-databases-and-neo4j
•
•
Relational Database Graph Database
Entity Row Node (Vertex)
Relationship Row Relationship (Edge)
•
•
•
•
•
–
•
•
•
–
Make two nodes
CREATE (:person {id: 1, name: “Kisung Kim”, birthday: 1980-01-05});
CREATE (:company {id: 1, name: “Bitnine...
Querying
MATCH (p:person {name: “Kisung Kim”})-[:workFor]->(c:company)
RETURN (p), (c)
No Table Definitions and No Joins
Q...
•
Magic Quadrant for Operational Database Management Systems, Gartner, 2016
•
•
•
•
( ) -[:processes]->(Cypher)
•
•
–
–
•
–
•
•
–
–
•
–
–
–
•
•
–
–
v1
Solution Company Latest Version Features
Neo Technology 3.1
Most famous graph database, Cypher
O(1) access using fixed-siz...
•
•
•
•
From Graph Databases 2nd ed. O’Reilly, 2015
•
•
•
From http://s3.thinkaurelius.com/docs/titan/1.0.0/data-model.html
•
–
•
•
Graph
Vertex Edge
Vertex ID Properties Edge ID PropertiesStart Vertex ID End Vertex ID
B-tree
Vertex ID
B-tree
(St...
•
–
–
–
•
•
Edge
Edge ID PropertiesStart Vertex ID End Vertex ID
B-tree
(Start, End)
B-tree
(End, Start)
Edge ID Properties
B-tree o...
•
•
•
Vertex ID Properties
ag_vertex
Vertex ID Properties
Person
Vertex ID Properties
Message
Vertex ID Properties
Comment...
• AgensGraph v0.9
(https://github.com/bitnine-oss/agens-graph or http://bitnine.net/downloads/)
– Graph data model and DDL...
•
•
•
–
–
•
–
•
•
•
•
–
–
•
•
•
–
:likes
•
–
–
–
•
Person
Country:X
Person
:knows*1..2
Message
Given a start Person, find Persons that are their friends and friends of frien...
•






•
–
–
•
•
•
• 
• 
• 
•
•
•
•
Pg Conf - Implementing Graph Database based-on PostgreSQL
Pg Conf - Implementing Graph Database based-on PostgreSQL
Pg Conf - Implementing Graph Database based-on PostgreSQL
Upcoming SlideShare
Loading in …5
×

Pg Conf - Implementing Graph Database based-on PostgreSQL

4,904 views

Published on

Pg confsv2016 implementing graph database based-on postgresql

Published in: Data & Analytics
  • Dating direct: ❶❶❶ http://bit.ly/2F7hN3u ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ♥♥♥ http://bit.ly/2F7hN3u ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Pg Conf - Implementing Graph Database based-on PostgreSQL

  1. 1. • • • •
  2. 2. Images from http://www.slideshare.net/debanjanmahata/an-introduction-to-nosql-graph-databases-and-neo4j
  3. 3. • • Relational Database Graph Database Entity Row Node (Vertex) Relationship Row Relationship (Edge)
  4. 4. • • •
  5. 5. • • – • • • –
  6. 6. Make two nodes CREATE (:person {id: 1, name: “Kisung Kim”, birthday: 1980-01-05}); CREATE (:company {id: 1, name: “Bitnine Global”}); Make a relationship between the two nodes MATCH (p:person {id: 1}), (c:company {id:1}) CREATE (p)-[:workFor {title: “CTO”, since: 2014}]->(c); Kisung Kim Bitnine Global workFor
  7. 7. Querying MATCH (p:person {name: “Kisung Kim”})-[:workFor]->(c:company) RETURN (p), (c) No Table Definitions and No Joins Query with variable length relationships MATCH (p:person {name: “Kisung Kim”})-[:knows*..3]->(f:person) RETURN (f) Kisung Kim ? workFor Kisung Kim ? knows ? knows ? knows
  8. 8.
  9. 9. Magic Quadrant for Operational Database Management Systems, Gartner, 2016
  10. 10. • • • • ( ) -[:processes]->(Cypher)
  11. 11. • • – – • – •
  12. 12. • – – • – – –
  13. 13. • • – – v1
  14. 14. Solution Company Latest Version Features Neo Technology 3.1 Most famous graph database, Cypher O(1) access using fixed-size array Datastax - Distributed graph system based on Cassandra Titan
  15. 15. • • • • From Graph Databases 2nd ed. O’Reilly, 2015
  16. 16. • • • From http://s3.thinkaurelius.com/docs/titan/1.0.0/data-model.html
  17. 17. • – • • Graph Vertex Edge Vertex ID Properties Edge ID PropertiesStart Vertex ID End Vertex ID B-tree Vertex ID B-tree (Start, End) B-tree (End, Start)
  18. 18. • – – – •
  19. 19. • Edge Edge ID PropertiesStart Vertex ID End Vertex ID B-tree (Start, End) B-tree (End, Start) Edge ID Properties B-tree or Hash index (Vertex ID) (Adjacent Vertex ID, Edge ID) B-tree (Edge ID)
  20. 20. • • • Vertex ID Properties ag_vertex Vertex ID Properties Person Vertex ID Properties Message Vertex ID Properties Comment Vertex ID Properties Post
  21. 21. • AgensGraph v0.9 (https://github.com/bitnine-oss/agens-graph or http://bitnine.net/downloads/) – Graph data model and DDL on PostgreSQL 9.6 – Cypher query processing (70% of OpenCypher spec.) – Integrated query processing (Cypher + SQL) – Client library (JDBC, ODBC, Python) – Monitoring and development using Tadpole DB-hub
  22. 22. • • • – –
  23. 23. • – • • • • – –
  24. 24. • • • –
  25. 25. :likes
  26. 26. • – – – •
  27. 27. Person Country:X Person :knows*1..2 Message Given a start Person, find Persons that are their friends and friends of friends that have made Messages in both of the given Countries, X and Y, within a given period. Only Persons that are foreign to Countries X and Y are considered, that is Persons whose Location is not Country X or Country Y.
  28. 28. •       • – – • • •
  29. 29. •  •  • 
  30. 30. • • • •

×