Graph databases - EuroPython 2014
Upcoming SlideShare
Loading in...5
×
 

Graph databases - EuroPython 2014

on

  • 734 views

There are many kinds of NoSQL databases like, document databases, key-value, column databases and graph databases. In some scenarios is more convenient to store our data as a graph, because we want to ...

There are many kinds of NoSQL databases like, document databases, key-value, column databases and graph databases. In some scenarios is more convenient to store our data as a graph, because we want to extract and study information relative to these connections. In this scenario, graph databases are the ideal, they are designed and implemented to deal with connected information in a efficient way.
https://ep2014.europython.eu/en/schedule/sessions/70/

Statistics

Views

Total Views
734
Views on SlideShare
634
Embed Views
100

Actions

Likes
1
Downloads
7
Comments
0

3 Embeds 100

https://ep2014.europython.eu 80
https://twitter.com 17
http://www.slideee.com 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Graph databases - EuroPython 2014 Graph databases - EuroPython 2014 Presentation Transcript

  • Graph Databases A little connected tour Francisco Fernández Castaño ! @fcofdezc
  • Beginning
  • The old town of Königsberg has seven bridges: Can you take a walk through town, visiting each part of the town and crossing each bridge only once?
  • El origenG = (V, E)
  • What is a Graph DB?
  • Graph Nodes Relationships Properties Store Store Connect Have Have
  • Written in Java ACID Rest interface Cypher
  • Why Graph DB?
  • The traditional way in the context of connected data is artificial
  • !Scalability
  • Depth MySQL time (s) Neo4j time (s) Results 2 0.016 0.01 ~2500 3 30.267 0.168 ~110,000 4 1543.505 1.359 ~600,000 5 No Acaba 2.132 ~800,000 MySQL vs Neo4j * Neo4J in Action
  • Person Id Person 1 Frank 2 John .. … 99 Alice PersonFriend PersonID FriendID 1 2 2 1 .. … 99 2
  • O(log n)
  • O(1)
  • O(m log n)
  • O(m)
  • We can transform our domain model in a natural way
  • Use cases
  • Social Networks Follow Follow John Jeff Douglas
  • Geospatial problems Fraud detection Authorization Network management
  • Recommendation System
  • Cypher Declarative language ASCII oriented Pattern matching
  • Cypher Cypher Traverser API Core API Kernel
  • Cypher a b (a)-->(b)
  • Cypher clapton cream (clapton)-[:play_in]->(cream) play_in
  • Follow FollowJohn Jeff Douglas Cypher (john:User)-[:FOLLOW]->(jeff:User) ! (douglas:User)-[:FOLLOW]->(john:User)
  • Cypher clapton {name: Eric Clapton} cream (clapton)-[:play_in]->(cream)<-[:labeled]-(blues) play_in {date: 1968} Blues labeled
  • Cypher MATCH (m)-[:PLAY_IN]—>(b) RETURN m,b;
  • Cypher MATCH (m)-[:PLAY_IN]—>(b), (b)<-[:LABELED]-(s) RETURN m.name, t.date, s.name;
  • Cypher MATCH (c {name: ‘clapton’})-[t:PLAY_IN]—>(b), (b)<-[:LABELED]-(s) RETURN c.name, b.name, s.name;
  • Cypher MATCH (c {name: ‘clapton’})-[t:PLAY_IN]—>(b), (b)<-[:LABELED]-(e {name: ‘blues’}) RETURN c.name, b.name, e.name ORDER BY t.date
  • Cypher MATCH (c {name: ‘clapton’})-[r:PLAY_IN | PRODUCE]—>(b), (b)<-[:LABELED]-(e {name: ‘blues’}) RETURN c.name, b.name, e.name WHERE r.date > 1968 ORDER BY r.date
  • Cypher MATCH (a)-[:KNOW*5]—>(b)
  • MATCH p = (startNode:Station {name: ‘Sol’}) -[rels:CONNECTED_TO*]-> (endNode:Station {name: ‘Retiro’}) RETURN p AS shortestPath, reduce(weight=0, r in rels: weight + r.weight) as tWeight ORDER BY tWeight ASC LIMIT 1
  • Neo4J extensions Managed Unmanaged
  • Neo4J extensions Managed Unmanaged
  • Neo4J extensions Managed Unmanaged
  • Drivers/Clients
  • Instead of just picking a relational database because everyone does, we need to understand the nature of the data we’re storing and how we want to manipulate it. Martin Fowler
  • References
  • Neo4J as a service http://www.graphenedb.com
  • Danke