Date post: | 05-Apr-2017 |
Category: |
Technology |
Upload: | lauren-hayward-schaefer |
View: | 75 times |
Download: | 1 times |
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Getting Started with Graph Databasesa Devoxx France tools-in-action session
@Lauren_Schaefer
1
#DevoxxFR #IntroToGraph @Lauren_Schaefer
The plan• What are graph databases and why should you care?
• Schema diagrams
• CRUD!
• Recommendation engines
#DevoxxFR #IntroToGraph @Lauren_Schaefer
What are graph databases?
#DevoxxFR #IntroToGraph @Lauren_Schaefer
What are graph databases?
• NoSQL• Focus on relationships• Nodes and edges instead of tables
#DevoxxFR #IntroToGraph @Lauren_Schaefer
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Creative Commons: https://www.flickr.com/photos/hjl/4094315135/
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you make a graph?
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you make a graph?
Node(noun
)
Node(noun
)
Node(noun
)
Node(noun
)
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you make a graph?
Node(noun
)
Node(noun
)
Node(noun
)
Node(noun
)
Edge (Verb)
Edge (Verb)
Edge (Verb)Edge (Verb)
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you make a graph?
Node(noun
)
Node(noun
)
Node(noun
)
Node(noun
)
Edge (Verb)
Edge (Verb)
Edge (Verb)Edge (Verb)
PropertiesKey: value
PropertiesKey: value
PropertiesKey: value
PropertiesKey: value
PropertiesKey: value Propertie
sKey: value
PropertiesKey: value
PropertiesKey: value
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you traverse a graph?
Node(noun
)
Node(noun
)
Node(noun
)
Node(noun
)
Edge (Verb)
Edge (Verb)
Edge (Verb)Edge (Verb)
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you traverse a graph?
Node(noun
)
Node(noun
)
Node(noun
)
Node(noun
)
Edge (Verb)
Edge (Verb)
Edge (Verb)Edge (Verb)
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you traverse a graph?
Node(noun
)
Node(noun
)
Node(noun
)
Node(noun
)
Edge (Verb)
Edge (Verb)
Edge (Verb)Edge (Verb)
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you traverse a graph?
Node(noun
)
Node(noun
)
Node(noun
)
Node(noun
)
Edge (Verb)
Edge (Verb)
Edge (Verb)Edge (Verb)
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Should you care about graph databases?
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Graph databases are massively increasing in popularity
http://db-engines.com/en/ranking_categories
#DevoxxFR #IntroToGraph @Lauren_Schaefer
PeoplePeople who viewed this item ultimately bought…
Blue pool float Red wagon
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Places
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Things
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Fraud
$$$
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Many more use cases• Modeling social networks
• Diagnosing psychosis with word analysis
• Analyzing the spread of epidemics
• Modeling a bio network
• Visualizing a social/economic/political network
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Let’s try a graph database
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you create a schema diagram for a graph?
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Lauren’s Lovely Landscapes
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Lauren’s Lovely Landscapes
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Lauren’s Lovely Landscapes
#DevoxxFR #IntroToGraph @Lauren_Schaefer
1. Model the nouns and verbs
printuser buys
#DevoxxFR #IntroToGraph @Lauren_Schaefer
2. Define vertices and edges
label: printlabel: user label: buys
#DevoxxFR #IntroToGraph @Lauren_Schaefer
3. Define the multiplicitylabel: printlabel: user label: buys
MULTI
#DevoxxFR #IntroToGraph @Lauren_Schaefer
4. Add propertieslabel: printtype: print
name: stringdescription:
stringprice: float
imgPath: string
label: usertype: userfirstName:
stringlastName:
stringusername:
stringemail: string
label: buysdatetime: stringaddress1: stringaddress2: string
city: stringstate: stringzip: integer
paymentMethod: stringMULTI
#DevoxxFR #IntroToGraph @Lauren_Schaefer
5. Create indexeslabel: printtype: print
name: stringdescription:
stringprice: float
imgPath: string
label: usertype: userfirstName:
stringlastName:
stringusername:
stringemail: string
label: buysdatetime: stringaddress1: stringaddress2: string
city: stringstate: stringzip: integer
paymentMethod: stringMULTI
Vertex Indexes:userByName: [firstName, lastName], mixed, not unique, indexOnly (user)userByUsername: [username], composite, unique, indexOnly (user)printByName: [name], composite, unique, indexOnly (print)vByPrice: [price], mixed, not unique
#DevoxxFR #IntroToGraph @Lauren_Schaefer
CRUD!
#DevoxxFR #IntroToGraph @Lauren_Schaefer
CRUD! Live demo!
label: printtype: print
name: stringdescription:
stringprice: float
imgPath: string
label: usertype: userfirstName:
stringlastName:
stringusername:
stringemail: string
label: buysdatetime: stringaddress1: stringaddress2: string
city: stringstate: stringzip: integer
paymentMethod: stringMULTI
#DevoxxFR #IntroToGraph @Lauren_Schaefer
How do you create a recommendation engine?
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Generating recommendations
#DevoxxFR #IntroToGraph @Lauren_Schaefer
TinkerPop recipe
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Recommendations for DaleAlaska
Antarctica
Las Vegas
Australia
Japan
Jason
Joy
Deanna
Dale
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Recommendations for DaleAlaska
Antarctica
Las Vegas
Australia
Japan
Jason
Joy
Deanna
Dale
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Recommendations for DaleAlaska
Antarctica
Las Vegas
Australia
Japan
Jason
Joy
Deanna
Dale
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Recommendations for DaleAlaska
Antarctica
Las Vegas
Australia
Japan
Jason
Joy
Deanna
Dale
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Recommendations for DaleAlaska
Antarctica
Las Vegas
Australia
Japan
Jason
Joy
Deanna
Dale
#DevoxxFR #IntroToGraph @Lauren_Schaefer
Live demo!• Write Gremlin queries to generate recommendations
#DevoxxFR #IntroToGraph @Lauren_Schaefer
That’s all for now…• To access the resources associated with this presentation…
- visit http://ibm.biz/devoxxfr_tia_slides
• To go deeper, attend my hands-on lab on Friday! (and tell your friends)
• To continue to learn more about Lauren, IBM Graph, and Bluemix, follow @Lauren_Schaefer @IBMGraph @IBMBluemix