Jul 02, 2015
NOSQLGRAPH DBs
APP DBs
AGENDA
GraphDatabases
Graph Databases
Leonhard Euler (1707 –1783)Swiss mathematician
Graph Databases: HISTORY
Graph Databases: HISTORY
What is Graph?
Vertice(Node)
Edge(Relationship)
Graph Databases: GRAPH
Graph Databases: WHAT IS IT?
Graph Databases: WHAT IS IT?
Joins
VS
Traversals
Good for semi-structured connected
data
1Index free-
adjacency
The underlying
storage
The processing
engine
2
3
4
Graph Databases: CHARACTERISTICS
APPs
Application: social graphs
Application: PAGE RANK
APP: Collaborative filtering
Neo4J: CHARACTERISTICS
true ACID transactions;
scales to billions of nodes and relationships;
high speed querying through traversals;
declarative graph query language;
Neo4J: who useit
Neo4J: WHO USE
Neo4J: network architecture
Neo4J: who useit
Neo4J: NETWORK ARCHITECTURE
Neo4J: architectureNeo4J: ARCHITECTURE
Neo4J: architectureNeo4J: Internal storage
Node
Relationship
Neo4J: architectureNeo4J: Internal storage
APP: Collaborative filteringNeo4J: CF
APP: Collaborative filteringNeo4J: CF
Neo4J: CYPHER
MATCH(p1:Person)-[x:RATED]->(m:PRODUCT)<-[y:RATED]-
(p2:Person)WITH
SUM(x.rating * y.rating) AS xyDotProduct, SQRT(REDUCE(xDot = 0, a IN COLLECT(x.rating) | xDot + a^2)) AS xLength, SQRT(REDUCE(yDot = 0, b IN COLLECT(y.rating) | yDot + b^2)) AS yLength, p1, p2CREATE UNIQUE
(p1)-[s:SIMILARITY]-(p2)SET
s.similarity = xyDotProduct / (xLength * yLength)
Alternatives
• GO• RESTful API• Built-in query editor and visualizer• back-end's: LevelDB, MongoDB• modularity
• No native storage(• Very raw(