A little talk about graph databases and
Neo4j
torsdag 17 oktober 13
A little talk about graph databases and
Neo4j
torsdag 17 oktober 13
Pernilla Lindh
torsdag 17 oktober 13
Pernilla Lindh Started at Neo4j 2012
Developer Evangelist
Geek Girl Meetup Öresund, Sweden
My Blog: www.p3rnilla.com
Find me on Twitter: @p3rnilla
Email me: [email protected]
torsdag 17 oktober 13
Agenda:
Introduction
The fairytale about Neo4j- Johnny Depp, Cats, Earth, Napster, Friends, Customer, Application map
Graphs are everywhere- social, linked, interest graph
Graph Databases- What is it? My little pony’s, Matrix, Tom Hanks, Patterns, Movies, Query language
Surprise
DEMO
Become a graphista?
Thank you!
torsdag 17 oktober 13
torsdag 17 oktober 13
Once upon a tim!..
torsdag 17 oktober 13
torsdag 17 oktober 13
In " 90’s, #ree guys had a problem...
torsdag 17 oktober 13
In " 90’s, #ree guys had a problem...
torsdag 17 oktober 13
torsdag 17 oktober 13
Between 3-8 000 language today
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
2
1
StugaCottageIS_A
DEHaus
SEHusENGHouse
0
ENGBuilding
torsdag 17 oktober 13
torsdag 17 oktober 13
#ey $a%ed &g into " h'tory and
realized..
torsdag 17 oktober 13
GRAPHS ARE
EVERYWHEREtorsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
1999
torsdag 17 oktober 13
torsdag 17 oktober 13
Let’s build a graph database!
torsdag 17 oktober 13
And called it Neo, since we all
love The Matrix
torsdag 17 oktober 13
And make it open-source so everyone
can join the fun
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
IDEA
torsdag 17 oktober 13
PROTOTYPE
IDEA
torsdag 17 oktober 13
PROTOTYPE
RUNNING IN PRODUCTION
IDEA
torsdag 17 oktober 13
torsdag 17 oktober 13
~ 55 employeesIn 11 countries
A startup
50 000 NIP every month 2% customers of the global 2000
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
Coolest Application Built in Neo4j
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
GRAPHS ARE
EVERYWHEREtorsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
GRAPHS ARE
EVERYWHEREtorsdag 17 oktober 13
So what is a graph database?
torsdag 17 oktober 13
torsdag 17 oktober 13
What is a graph?
torsdag 17 oktober 13
Object (vertex, node)
What is a graph?
torsdag 17 oktober 13
Object (vertex, node)
What is a graph?
torsdag 17 oktober 13
Object (vertex, node)
What is a graph?
torsdag 17 oktober 13
Object (vertex, node)
What is a graph?
torsdag 17 oktober 13
Object (vertex, node)
What is a graph?
torsdag 17 oktober 13
Object (vertex, node)
Link (edge, arc, relationship)
What is a graph?
torsdag 17 oktober 13
Peter
torsdag 17 oktober 13
Peter
Johan
torsdag 17 oktober 13
Peter
Johan
Emil
torsdag 17 oktober 13
Peter
Johan
Emil
torsdag 17 oktober 13
Peter
Johan
Emil
Friend Of
torsdag 17 oktober 13
Peter
Johan
Emil
Friend Of
Friend Of
torsdag 17 oktober 13
Peter
Johan
Emil
Friend Of
Friend Of
Friend Of
torsdag 17 oktober 13
Peter
Johan
Emil
Friend Of
Friend Of
Friend Of
Frien
d Of
torsdag 17 oktober 13
Peter
Johan
Emil
Friend Of
Friend OfFrien
d Of
Friend Of
torsdag 17 oktober 13
PeterAge:38
JohanAge: 36
EmilAge: 34
Friend Ofsince: 1994
Friend Of
Since: 1992 Frien
d Of
Since: 19
84
Friend Since: 1994
torsdag 17 oktober 13
Modeling a graph
torsdag 17 oktober 13
torsdag 17 oktober 13
Step one: Start with a whiteboard and a pen
torsdag 17 oktober 13
torsdag 17 oktober 13
Step two: Use your imagination
torsdag 17 oktober 13
torsdag 17 oktober 13
Everyone watch movies
torsdag 17 oktober 13
torsdag 17 oktober 13
LANA WACHOWSKI
CLOUD ATLASTHE MATRIX
HUGO WEAVINGTOM HANKS
ACTED_IN
LANA WACHOWSKI
ACTED_IN
ACTED_IN
ACTED_IN
DIRECTED
DIRECTED
torsdag 17 oktober 13
LANA WACHOWSKI
CLOUD ATLASTHE MATRIX
HUGO WEAVINGTOM HANKS
ACTED_IN
LANA WACHOWSKI
ACTED_IN
ACTED_IN
ACTED_IN
DIRECTED
DIRECTED
torsdag 17 oktober 13
name: LANA WACHOWSKInationality: USa
won: Razzie, Hugo
title: CLOUD ATLASgenre: drama, sci-fi
title: THE MATRIXgenre: sci-fi
name:HUGO WEAVINGnationality: Australiawon: MTV Movie Award
name:TOM HANKSnationality: USAwon: Oscar, Emmy
ACTED_INrole: Bill Smoke
LANA WACHOWSKI
ACTED_INrole: Zachry
ACTED_IN
ACTED_INrole: Agent Smith
DIRECTEDDIRECTED
torsdag 17 oktober 13
So?
torsdag 17 oktober 13
name: LANA WACHOWSKInationality: USa
won: Razzie, Hugo
title: CLOUD ATLASgenre: drama, sci-fi
title: THE MATRIXgenre: sci-fi
name:HUGO WEAVINGnationality: Australiawon: MTV Movie Award
name:TOM HANKSnationality: USAwon: Oscar, Emmy
ACTED_INrole: Bill Smoke
LANA WACHOWSKI
ACTED_INrole: Zachry
ACTED_IN
ACTED_INrole: Agent Smith
DIRECTEDDIRECTED
torsdag 17 oktober 13
torsdag 17 oktober 13
CYPHER
torsdag 17 oktober 13
CYPHER
Cypher is Neo4j's graph query language
torsdag 17 oktober 13
torsdag 17 oktober 13
// get node with id 0start n=node(0) return a// find nodes connected to node 1start n=node(1) match (n)-->(m) return m// create a nodecreate (me {name:'Pernilla'})// delete relationshipstart n=node(1) match (n)-[r]->(m) delete r
torsdag 17 oktober 13
• Declarative Pattern-Matching language
• SQL-like syntax
• Designed for graphs
torsdag 17 oktober 13
It’s all about Patterns
A
B C
torsdag 17 oktober 13
torsdag 17 oktober 13
Two����������� ������������������ nodes,����������� ������������������ one����������� ������������������ relationship
a b
torsdag 17 oktober 13
Two����������� ������������������ nodes,����������� ������������������ one����������� ������������������ relationship
(a) --> (b)
a b
torsdag 17 oktober 13
Two����������� ������������������ nodes,����������� ������������������ one����������� ������������������ relationship
START a=node(*)MATCH (a)-->(b)RETURN a, b;
a b
torsdag 17 oktober 13
A
A
A
B
B
B
START a=node(*)MATCH (a)-->(b)RETURN a, b;
torsdag 17 oktober 13
A
A
A
B
B
B
START a=node(*)MATCH (a)-->(b)RETURN a, b;
torsdag 17 oktober 13
A
A
A
B
B
B
START a=node(*)MATCH (a)-->(b)RETURN a, b;
torsdag 17 oktober 13
A
A
A
B
B
B
START a=node(*)MATCH (a)-->(b)RETURN a, b;
torsdag 17 oktober 13
torsdag 17 oktober 13
torsdag 17 oktober 13
Aren't we defined by how the world relates to us?
torsdag 17 oktober 13
Become a graphista?
torsdag 17 oktober 13
torsdag 17 oktober 13
Questions?
THANK YOU!
torsdag 17 oktober 13
torsdag 17 oktober 13