Neo4j - 5 cool graph examples

30
Neo4j And some graph problems Peter Neubauer COO, Neo Technology #neo4j @peterneubauer [email protected]

description

 

Transcript of Neo4j - 5 cool graph examples

Page 1: Neo4j - 5 cool graph examples

Neo4jAnd some graph problems

Peter NeubauerCOO, Neo Technology

#neo4j@[email protected]

Page 2: Neo4j - 5 cool graph examples

Any sufficiently advanced technology is indistinguishable from magic.

Arthur C. Clarke

@kymerawand

Page 3: Neo4j - 5 cool graph examples

First, a recap: NOSQL data models

Column Family

Key-value stores

Document databases

Graph databases

Data complexity

Dat

a si

ze

We are here

Page 4: Neo4j - 5 cool graph examples

What makes a good DB?

Separate Logic and DataSupport Ad-Hoc queriesBe persistentScale good enough

Page 5: Neo4j - 5 cool graph examples

The property graph modelCore abstractions:

NodesRelationships between nodesProperties on both

Traversal frameworkHigh performancequeries on connecteddata sets

Other bindingsLangs, REST, Gremlin, RDF

name = “Emil”age = 29sex = “yes”

type = KNOWStime = 4 years

type = carvendor = “SAAB”model = “95 Aero”

11 22

33

Page 6: Neo4j - 5 cool graph examples

Social data (customer: brand-name social network)

name = “Mike”age = 29

11

disclosure = public

name = “Charlie”last_name = “Runkle”

name = “Dani”last_name = “California”age = 27

331313

KNOWS KNOWS

name = “Hank”last_name = “Moody”age = 42

age = 3 days

name = “Karen”

77

22

KNOWS

KNOWSKN

OW

S

name = “Marcy Runkle”

4242

KNOWS

Page 7: Neo4j - 5 cool graph examples

Just a social graph?

Page 8: Neo4j - 5 cool graph examples

Spatial data (customer: large telecom company)

name = “Omni Hotel”lat = 3492848long = 283823423

11

length = 7 miles

name = ...lat, long = ...

name = “Swedland”lat = 23410349long = 2342348852

331313

ROAD ROOOAD

name = “The Tavern”lat = 1295238237long = 234823492

length = 3 miles

name = ...

77

22

ROAD

ROADR

OAD

name = ...

4242

ROAD

Page 9: Neo4j - 5 cool graph examples

Social? Spatial? … Social AND spatial!

Page 10: Neo4j - 5 cool graph examples

Social AND spatial data (customer: LBS)

name = “Omni Hotel”lat = 3492848long = 283823423

11

weight = 10

name = “Emil”beer_qual = expert

name = “Maria”age = 30beer_qual = non-existant

331313

LIKES SIBLING

name = “The Tavern”lat = 1295238237long = 234823492

length = 3 miles

name = ...

77

22

ROAD

ROADR

OAD

name = “Peter”

4242

KNOWS

Page 11: Neo4j - 5 cool graph examples

Financial data (customer: international bank)

name = “Mr Godfather”karma = veeeery-lowcash = more-than-you

11

amount = $1000

name = “Emil”cash = always-too-li'l

title = “ATM @ Wall St”id = 230918484233cash_left = 384204

331313

TRANSFER WITHDRAW

name = “The Tavern”lat = 1295238237long = 234823492

amount = $1000

name = ...

77

22

OWNS

DEPOSITTR

ANSF

ER

name = ...

4242

WITHDRAW

Page 12: Neo4j - 5 cool graph examples

REST in Neo4jThe graph as an OODB – Roo, Grails Jruby, Jo4neoDeep graph algos – Routing with A*Multiple indexes in the graph – GISRecommendation systems – Gremlin and LinkedData

Use Cases

Page 13: Neo4j - 5 cool graph examples

REST in Neo4j

Build on self describing JSONIndexingQueryingBindings to PHP, C#, JSOpenGraph APIJruby, Scala

Page 14: Neo4j - 5 cool graph examples

The Graph for objectsKeep data clean!Annotation based

GrailsJo4neoRooJPA

Mixin basedDjangoJRuby

C# (REST)PHP (REST)

Page 15: Neo4j - 5 cool graph examples

The Graph as an OODB

Page 16: Neo4j - 5 cool graph examples

Routing with Neo4j and A*

Page 17: Neo4j - 5 cool graph examples

Routing with Neo4j and A*

Page 18: Neo4j - 5 cool graph examples

Multiple indexes - GISQuadTree (2D)HierarchyTime (1D)On-demand index

Page 19: Neo4j - 5 cool graph examples

Multiple indexes - GIS

Page 20: Neo4j - 5 cool graph examples

Multiple indexes - GIS

Page 21: Neo4j - 5 cool graph examples

Recommendation - Gremlingremlin.tinkerpop.comXPath based “Perl for Graphs”Property Graph Model

Neo4j, RDF-SAIL, Tinkergraph, MongoDB, FSLinkedData SAIL

Page 22: Neo4j - 5 cool graph examples

Recommendation - Gremlin

Page 23: Neo4j - 5 cool graph examples

Recommendation - Gremlin

Page 24: Neo4j - 5 cool graph examples

Activity streamsProcess automation

Life-filtering of event streamsWeb-of-Things data fl ows

Object oriented reportingJasper ReportsReportAnywhereScripting

Other use cases

Page 25: Neo4j - 5 cool graph examples

Werner VogelsCTO, Amazon

“For anything with multiple relationships, multiple connections N e o4 j ab s ol u te l y R OCK S!”

http://bit.ly/dys4nx

Manager of an enterprise product for the Fortune 5000

“Just 3 years ago, the data sets our product handled were very simple. But the past 9-12 months have seen an e x p l os i on of the number of relationships between things.”

A web where the default is social → an explosion of graph-y data

Why graph databases?

Page 26: Neo4j - 5 cool graph examples

How ego are you? (aka other impls?)Franz’ Al l e groGrap h (http://agraph.franz.com)

Proprietary, Lisp, RDF-oriented but real graphdb

Sones grap h DB (http://sones.com)

Proprietary, .NET, in beta

Twitter's Fl oc k DB (http://github.com/twitter/flockdb)

Twitter's (graph) database for large and shallow graphs

Google P re g e l (http://bit.ly/dP9IP)

We are oh-so-secret

Objectivity's I nfi n i te Grap h (http://infinitegraph.com)

New, closed OODB with Graph Layer on top

Page 27: Neo4j - 5 cool graph examples

Most widely deployed graph db in the worldRobust: 24/7 production since 2003Mature: lots of production deploymentsCommunity: ecosystem of tools, bindings, frameworks

Available NOW under AGPLv3 / commercial licenseAGPLv3: “if you’re open source, we’re open source”If you have proprietary software? Must buy a commercial licenseBut the fi rst one is free! For ALL use-cases.

Downloadhttp://neo4j.org

Feedbackhttp://lists.neo4j.org

Why Neo4j?

Page 28: Neo4j - 5 cool graph examples

Th e Ne o4 j te ami s h i r i ng !

Do you see the Matrix? Apply now.

Page 29: Neo4j - 5 cool graph examples

Questions?

Image credit: lost again! Sorry :(

Page 30: Neo4j - 5 cool graph examples

http://neotechnology.com