Neo Technology, Inc Confidential
Emil Eifrem emil@neotechnology.com @emileifrem #neo4j
Graph All Teh Things!!!111
Graph Database Use Cases That Aren’t Social GOTO Berlin, 2014
1 Thursday, November 6, 14
Graph All Teh Things!!!111 Graph Database Use Cases That Arent - - PowerPoint PPT Presentation
Graph All Teh Things!!!111 Graph Database Use Cases That Arent Social GOTO Berlin, 2014 Emil Eifrem emil@neotechnology.com @emileifrem #neo4j Neo Technology, Inc Confidential Thursday, November 6, 14 1 Agenda 1. Context 2. Wait! What
Neo Technology, Inc Confidential
Emil Eifrem emil@neotechnology.com @emileifrem #neo4j
Graph Database Use Cases That Aren’t Social GOTO Berlin, 2014
1 Thursday, November 6, 14
Neo Technology, Inc Confidential
2 Thursday, November 6, 14
Neo Technology, Inc Confidential
3 Thursday, November 6, 14
Neo Technology, Inc Confidential
4 Thursday, November 6, 14
Neo Technology, Inc Confidential
5 Thursday, November 6, 14
Neo Technology, Inc Confidential
6 Thursday, November 6, 14
Neo Technology, Inc Confidential 7 Thursday, November 6, 14
Neo Technology, Inc Confidential
8 Thursday, November 6, 14
Neo Technology, Inc Confidential
C 34,3% B 38,4% A 3,3% D 3,8% 1,8% 1,8% 1,8% 1,8% 1,8% E 8,1% F 3,9%
9 Thursday, November 6, 14
Neo Technology, Inc Confidential 10 Thursday, November 6, 14
Neo Technology, Inc Confidential 11 Thursday, November 6, 14
Neo Technology, Inc Confidential
Core industries & Use Cases WEB / ISV Financial Services Tele-communications Network & Data Center Management Master Data Management Social Geo
12 Thursday, November 6, 14
Neo Technology, Inc Confidential
Core industries & Use Cases WEB / ISV Financial Services Tele-communications & Life Sciences Network & Data Center Management Master Data Management Social GEO
Finance
13 Thursday, November 6, 14
Neo Technology, Inc Confidential
Source: http://db-engines.com/en/ranking/graph+dbms!
14 Thursday, November 6, 14
Neo Technology, Inc Confidential
0% 10% 20% 30% 2011 2014 2017
25% 2.5% 0%
% of Enterprises using Graph Databases
“Forrester estimates that over 25%
databases by 2017”
Sources
+DBMS+Q1+2014/fulltext/-/E-RES106801)
Technologies in the Enterprise” (http://www.dataversity.net)
“25% of survey respondents said they plan to use Graph databases in the future.”
15 Thursday, November 6, 14
Neo Technology, Inc Confidential
16 Thursday, November 6, 14
17 Thursday, November 6, 14
18 Thursday, November 6, 14
19 Thursday, November 6, 14
20 Thursday, November 6, 14
(:Person {name:"Ann"}) –[:LOVES]-> (:Person {name:"Dan"})
21 Thursday, November 6, 14
(:Person {name:"Ann"}) –[:LOVES]-> (:Person {name:"Dan"})
22 Thursday, November 6, 14
(:Person {name:"Ann"})–[:LOVES]->(whom)
23 Thursday, November 6, 14
MATCH (:Person {name:"Ann"})–[:LOVES]->(whom)
24 Thursday, November 6, 14
MATCH (:Person {name:"Ann"})–[:LOVES]->(whom) RETURN whom
25 Thursday, November 6, 14
Neo Technology, Inc Confidential 26 Thursday, November 6, 14
Neo Technology, Inc Confidential
MATCH (me:Person)-[:IS_FRIEND_OF]->(friend:Person), (friend)-[:LIKES]->(restaurant), (restaurant)-[:LOCATED_IN]->(newyork:City), (restaurant)-[:SERVES]->(sushi:Cuisine) WHERE me.name = 'Emil' AND newyork.location='New York' AND sushi.cuisine='Sushi' RETURN restaurant.name
http://maxdemarzi.com/?s=facebook
27 Thursday, November 6, 14
*“Find all direct reports and how many they manage, up to 3 levels down”
28 Thursday, November 6, 14
*“Find all direct reports and how many they manage, up to 3 levels down”
(SELECT T.directReportees AS directReportees, sum(T.count) AS count FROM ( SELECT manager.pid AS directReportees, 0 AS count FROM person_reportee manager WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") UNION SELECT manager.pid AS directReportees, count(manager.directly_manages) AS count FROM person_reportee manager WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION SELECT manager.pid AS directReportees, count(reportee.directly_manages) AS count FROM person_reportee manager JOIN person_reportee reportee ON manager.directly_manages = reportee.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION SELECT manager.pid AS directReportees, count(L2Reportees.directly_manages) AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees ) AS T GROUP BY directReportees) UNION (SELECT T.directReportees AS directReportees, sum(T.count) AS count FROM ( SELECT manager.directly_manages AS directReportees, 0 AS count FROM person_reportee manager WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") UNION SELECT reportee.pid AS directReportees, count(reportee.directly_manages) AS count FROM person_reportee manager JOIN person_reportee reportee ON manager.directly_manages = reportee.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION (continued from previous page...) SELECT depth1Reportees.pid AS directReportees, count(depth2Reportees.directly_manages) AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees ) AS T GROUP BY directReportees) UNION (SELECT T.directReportees AS directReportees, sum(T.count) AS count FROM( SELECT reportee.directly_manages AS directReportees, 0 AS count FROM person_reportee manager JOIN person_reportee reportee ON manager.directly_manages = reportee.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION SELECT L2Reportees.pid AS directReportees, count(L2Reportees.directly_manages) AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees ) AS T GROUP BY directReportees) UNION (SELECT L2Reportees.directly_manages AS directReportees, 0 AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") )
29 Thursday, November 6, 14
MATCH ¡(boss)-‑[:MANAGES*0..3]-‑>(sub), ¡ ¡ ¡ ¡ ¡ ¡(sub)-‑[:MANAGES*1..3]-‑>(report) WHERE ¡boss.name ¡= ¡“John ¡Doe” RETURN ¡sub.name ¡AS ¡Subordinate, ¡count(report) ¡AS ¡Total
*“Find all direct reports and how many they manage, up to 3 levels down”
30 Thursday, November 6, 14
DATABASE # PEOPLE QUERY TIME (MS) MySQL Neo4j Neo4j
1,000 2,000 1,000 2 1,000,000 2
31 Thursday, November 6, 14
Neo Technology, Inc Confidential
“Our ¡Neo4j ¡solution ¡is ¡literally ¡thousands ¡of ¡times ¡ faster ¡than ¡the ¡prior ¡MySQL ¡solution, with ¡queries ¡that ¡require ¡10-‑100 ¡times ¡less ¡code.”
32 Thursday, November 6, 14
Neo Technology, Inc Confidential
33 Thursday, November 6, 14
Neo Technology, Inc Confidential
34 Thursday, November 6, 14
Neo Technology, Inc Confidential
35 Thursday, November 6, 14
Neo Technology, Inc Confidential
36 Thursday, November 6, 14
Neo Technology, Inc Confidential
37 Thursday, November 6, 14
Neo Technology, Inc Confidential
38 Thursday, November 6, 14
Neo Technology, Inc Confidential
39 Thursday, November 6, 14
Neo Technology, Inc Confidential
Total Dollar Amount Transaction Count Investigate Investigate
40 Thursday, November 6, 14
Neo Technology, Inc Confidential
41 Thursday, November 6, 14
Neo Technology, Inc Confidential
Ref: http://www.gartner.com/id=2081316
Interest Graph Payment Graph Intent Graph Mobile Graph Social Graph
42 Thursday, November 6, 14
Neo Technology, Inc Confidential
(e.g. Network Dependency Analysis, Network Inventory, etc.)
(mobile apps, social recommendations, collaboration)
(creating inferred social graph, churn reduction, etc.)
(org & product hierarchy, data governance, IAM)
(enterprise collaboration)
43 Thursday, November 6, 14
Neo Technology, Inc Confidential
(e.g. Fraud Detection, Credit Risk Analysis, Chargebacks...)
(org drillthru, product recommendations, mobile payments, etc.)
(identity & access management, authorization)
(portfolio analytics, risk management, market & sentiment analysis, compliance)
(enterprise collaboration, corporate hierarchy, data governance)
Finance Finance
44 Thursday, November 6, 14
Neo Technology, Inc Confidential
(e.g. referrals, patient management, research)
(support communities, doctor recommendations, clinical trials)
(drug research, genetic screening, bioengineering, etc.)
(biological master data, evolutionary taxonomy, the access control graph, etc.)
(collaborative medicine, clinical trials, etc.)
45 Thursday, November 6, 14
Neo Technology, Inc Confidential
46 Thursday, November 6, 14
47 Thursday, November 6, 14