Nodes
And relationships between nodes
Animal
"name" : "Banana",
"color" : "orange"
Furnishing
"type" : "carpet"
Scratched
"timestamp" : 1417126199
Barfed On
"timestamp" : 1417136235
Stored the same way you might describe your data naturally
Reflects your application's domain
Graph databases are part of the NoSQL family
... but they're pretty different.
Aggregate-Oriented
2 main categories of NoSQL databases:
Graph Databases
When people talk about NoSQL, they're usually referring to the aggregate oriented databases.
Parentheses = nodes
(user)
Arrows and square brackets = relationships
-[:has]->
Together
(user)-[:has]->(role)
Variables
(foo:User)-[bar:has]->()
Labels
(creature:Dog)
Relationship types
[:purchased]
Properties
(:Customer {name:"Daniel"}) -[:PURCHASED {timestamp: 1417631772}]-> (:Product {id: "abc", price: 35.5})
Querying is about matching patterns
Example: find customers who have purchased the same product as current customer
MATCH (c:Customer)-[:PURCHASED]->()<-[:PURCHASED]-(c2)
WHERE c.email = "customer@example.com"
return c2
This graph search...
... has the same performance as this one
Videos
Books
Services