+ All Categories
Home > Technology > Getting Started with Graph Databases

Getting Started with Graph Databases

Date post: 05-Apr-2017
Category:
Upload: lauren-hayward-schaefer
View: 75 times
Download: 1 times
Share this document with a friend
43
#DevoxxFR #IntroToGraph @Lauren_Schaefer Getting Started with Graph Databases a Devoxx France tools-in-action session @Lauren_Schaefer 1
Transcript
Page 1: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Getting Started with Graph Databasesa Devoxx France tools-in-action session

@Lauren_Schaefer

1

Page 2: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

The plan• What are graph databases and why should you care?

• Schema diagrams

• CRUD!

• Recommendation engines

Page 3: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

What are graph databases?

Page 4: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

What are graph databases?

• NoSQL• Focus on relationships• Nodes and edges instead of tables

Page 5: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Page 6: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Creative Commons: https://www.flickr.com/photos/hjl/4094315135/

Page 7: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

How do you make a graph?

Page 8: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

How do you make a graph?

Node(noun

)

Node(noun

)

Node(noun

)

Node(noun

)

Page 9: Getting Started with Graph Databases

#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)

Page 10: Getting Started with Graph Databases

#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

Page 11: Getting Started with Graph Databases

#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)

Page 12: Getting Started with Graph Databases

#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)

Page 13: Getting Started with Graph Databases

#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)

Page 14: Getting Started with Graph Databases

#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)

Page 15: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Should you care about graph databases?

Page 16: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Graph databases are massively increasing in popularity

http://db-engines.com/en/ranking_categories

Page 17: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

PeoplePeople who viewed this item ultimately bought…

Blue pool float Red wagon

Page 18: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Places

Page 19: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Things

Page 20: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Fraud

$$$

Page 21: Getting Started with Graph Databases

#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

Page 22: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Let’s try a graph database

Page 23: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

How do you create a schema diagram for a graph?

Page 24: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Lauren’s Lovely Landscapes

Page 25: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Lauren’s Lovely Landscapes

Page 26: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Lauren’s Lovely Landscapes

Page 27: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

1. Model the nouns and verbs

printuser buys

Page 28: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

2. Define vertices and edges

label: printlabel: user label: buys

Page 29: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

3. Define the multiplicitylabel: printlabel: user label: buys

MULTI

Page 30: Getting Started with Graph Databases

#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

Page 31: Getting Started with Graph Databases

#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

Page 32: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

CRUD!

Page 33: Getting Started with Graph Databases

#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

Page 34: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

How do you create a recommendation engine?

Page 35: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Generating recommendations

Page 36: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

TinkerPop recipe

Page 37: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Recommendations for DaleAlaska

Antarctica

Las Vegas

Australia

Japan

Jason

Joy

Deanna

Dale

Page 38: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Recommendations for DaleAlaska

Antarctica

Las Vegas

Australia

Japan

Jason

Joy

Deanna

Dale

Page 39: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Recommendations for DaleAlaska

Antarctica

Las Vegas

Australia

Japan

Jason

Joy

Deanna

Dale

Page 40: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Recommendations for DaleAlaska

Antarctica

Las Vegas

Australia

Japan

Jason

Joy

Deanna

Dale

Page 41: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Recommendations for DaleAlaska

Antarctica

Las Vegas

Australia

Japan

Jason

Joy

Deanna

Dale

Page 42: Getting Started with Graph Databases

#DevoxxFR #IntroToGraph @Lauren_Schaefer

Live demo!• Write Gremlin queries to generate recommendations

Page 43: Getting Started with Graph Databases

#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


Recommended