Graphs in Action: Slide 3
Under the Hood: What Graphs are and Where They Fit -- Slide 35
Transform Your Data from RDBMS to Graph: A Worked Example -- Jump to slide 82
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Slides from GraphDay Santa Clara
1. SANTA CLARA
APRIL 14, 2016
09:00-09:30
09:30-10:15
10:15-11:00
11:00-11:30
11:30-12:30
12:30-13:30
13:30-17:00
Breakfast and Registration
Graphs in Action: Driving Digital
Transformation with Neo4j
Under the Hood: What’s a Graph and
Where Do They Fit
Break
Transform Your Data: A worked example
Lunch
Training Session
Agenda
3. Driving Digital Transformation With Neo4j
GRAPHS IN ACTION
Santa Clara, April 14, 2016
Lars Nordwall
Chief Operating Officer
@lnordwall
lars@neotechnology.com
5. Corporate Threat
Source: Accenture Strategy research, summer 2015
700 business leaders in the European Union, United States, China
and Japan, a majority identified large digital players or start-ups as
the greatest competitive threat to profitable growth. *)
6. Corporate Life Span
The average corporate life span has been falling for more than half a century.
Standard & Poor’s data show it was
- 61 years in 1958
- 25 years in 1980
- 18 years in 2011
Digitization is placing unprecedented pressure on organizations to evolve.
At the present rate, 75 percent of S&P 500 incumbents will be gone by 2027
Source: McKinsey, 2015
7. Dilemma
Everyone collects data today. More
data the better..
“Store first, ask questions later”
Everyone seems to hire data
scientists today (or at least trying).
8. There is another dimension
beyond data volume:
Data Relationships
Why a graph database?
9. Social networks RetailHR &
Recruiting
Manufacturing
& Logistics
Health Care Telco
Today we see graph-projects in virtually every industry
Finance
11. Neo4j solves retail-related challenges for
some of the largest companies in the world
Adidas uses Neo4j to combine
content and product data into a
single, searchable graph database
which is used to create a
personalized customer experience
“We have many different silos, many
different data domains, and in order
to make sense out of our data, we
needed to bring those together and
make them useful for us,”
– Sokratis Kartelias, Adidas
eBay Now Tackles eCommerce
Delivery Service Routing with Neo4j
“We needed to rebuild when growth
and new features made our slowest
query longer than our fastest delivery
- 15 minutes! Neo4j gave us best
solution”
– Volker Pacher, eBay
Walmart uses Neo4j to give
customer best web experience
through relevant and personal
recommendations
“As the current market leader in
graph databases, and with
enterprise features for scalability
and availability, Neo4j is the right
choice to meet our demands”.
- Marcos Vada, Walmart
50. Use of Graphs has created some of the most successful companies in the world
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%
51. NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
52. NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
VIEWED
GRAPH THINKING:
Real Time Recommendations
VIEWED
BOUGHT
VIEWED
BOUGHT
BOUGHT
BOUGHT
BOUGHT
53. “As the current market leader in graph databases,
and with enterprise features for scalability and
availability, Neo4j is the right choice to meet our
demands.” Marcos Wada
Software Developer, Walmart
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
54. NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
GRAPH THINKING:
Master Data Management
MANAGES
MANAGES
LEADS
REGION
M
ANAG
ES
MANAGES
REGION
LEADS
LEADS
COLLABORATES
55. Neo4j is the heart of Cisco HMP: used for governance
and single source of truth and a one-stop shop for all
of Cisco’s hierarchies.
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
56. NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
O
PENED_ACCO
UNT
HAS
IS_ISSUED
GRAPH THINKING:
Fraud Detection
HAS
LIVES
LIVES
IS_ISSUED
OPENED_ACCOUNT
57. “Graph databases offer new methods of uncovering
fraud rings and other sophisticated scams with a
high-level of accuracy, and are capable of stopping
advanced fraud scenarios in real-time.”
Gorka Sadowski
Cyber Security Expert
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
58. GRAPH THINKING:
Graph Based Search
PUBLISH
INCLUDE
INCLUDE
CREATE
CAPTURE
IN
IN
SOURCE
USES
USES
IN
IN
USES
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
SOURCE SOURCE
59. Uses Neo4j to manage the digital assets inside of its next
generation in-flight entertainment system.
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
60. NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
BROWSES
CONNECTS
BRIDGES
ROUTES
POWERS
ROUTES
POWERS
POWERS
HOSTS
QUERIES
GRAPH THINKING:
Network & IT-Operations
61. Uses Neo4j for network topology analysis
for big telco service providers
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
62. GRAPH THINKING:
Identity And Access Management
TRUSTS
TRUSTS
ID
ID
AUTHENTICATES
AUTHENTICATES
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
O
W
NS
OWNS
CAN_READ
63. UBS was the recipient of the 2014
Graphie Award for “Best Identify And
Access Management App”
NEO4j USE CASES
Real Time Recommendations
Master Data Management
Fraud Detection
Identity & Access Management
Graph Based Search
Network & IT-Operations
64. Neo4j Adoption by Selected Verticals
SOFTWARE
FINANCIAL
SERVICES
RETAIL
MEDIA &
BROADCASTING
SOCIAL
NETWORKS
TELECOM HEALTHCARE
70. Connectedness and Size of Data Set
ResponseTime
Relational and
Other NoSQL
Databases
0 to 2 hops
0 to 3 degrees
Thousands of connections
1000x
Advantage
Tens to hundreds of hops
Thousands of degrees
Billions of connections
Neo4j
“Minutes to
milliseconds”
Real-Time Query Performance
71. Speed
“We found Neo4j to be literally thousands of times faster
than our prior MySQL solution, with queries that require
10-100 times less code. Today, Neo4j provides eBay with
functionality that was previously impossible.”
- Volker Pacher, Senior Developer
“Minutes to milliseconds” performance
Queries up to 1000x faster than RDBMS or other NoSQL
73. A Naturally Adaptive Model
A Query Language Designed
for Connectedness
+
=Agility
74. Cypher
Typical Complex SQL Join The Same Query using Cypher
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
Project Impact
Less time writing queries
• More time understanding the answers
• Leaving time to ask the next question
Less time debugging queries:
• More time writing the next piece of code
• Improved quality of overall code base
Code that’s easier to read:
• Faster ramp-up for new project members
• Improved maintainability & troubleshooting
79. Impact on the Business
Neo4j is ultra efficient &
normally needs far less hardware
than any alternative
How?
Increase revenue
• Do new & impossible things
• Faster time-to-market
Reduce cost
• Lower infrastructure costs
How?
• Value from data relationships
• Batch to real time
• 1000x faster
88. AGENDA
• SQL Pains
• Building a Neo4j Application
• Moving from RDBMS -> Graph Models
• Walk through an Example
• Creating Data in Graphs
• Querying Data
104. • Complex to model and store relationships
• Performance degrades with increases in data
• Queries get long and complex
• Maintenance is painful
SQL Pains
105. • Easy to model and store relationships
• Performance of relationship traversal remains constant with
growth in data size
• Queries are shortened and more readable
• Adding additional properties and relationships can be done on
the fly - no migrations
Graph Gains
142. Who do people report to?
MATCH
(sub:Employee)-[:REPORTS_TO]->(e:Employee)
RETURN
e.employeeID AS managerID,
e.firstName AS managerName,
sub.employeeID AS employeeID,
sub.firstName AS employeeName;
159. 3 Steps to Creating the Graph
IMPORT NODES CREATE INDEXES IMPORT RELATIONSHIPS
160. Importing Nodes
// Create categories
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://
raw.githubusercontent.com/neo4j-contrib/developer-resources/
gh-pages/data/northwind/categories.csv" AS row
CREATE (:Category {categoryID: row.CategoryID, categoryName:
row.CategoryName, description: row.Description});
// Create orders
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://
raw.githubusercontent.com/neo4j-contrib/developer-resources/
gh-pages/data/northwind/orders.csv" AS row
MERGE (order:Order {orderID: row.OrderID}) ON CREATE SET
order.shipName = row.ShipName;
161. Importing Nodes
// Create customers
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://
raw.githubusercontent.com/neo4j-contrib/developer-resources/
gh-pages/data/northwind/customers.csv" AS row
CREATE (:Customer {companyName: row.CompanyName, customerID:
row.CustomerID, fax: row.Fax, phone: row.Phone});
// Create products
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://
raw.githubusercontent.com/neo4j-contrib/developer-resources/
gh-pages/data/northwind/products.csv" AS row
CREATE (:Product {productName: row.ProductName, productID:
row.ProductID, unitPrice: toFloat(row.UnitPrice)});
162. Creating Indexes
CREATE CONSTRAINT ON (p:Product) ASSERT p.productID is UNIQUE;
CREATE CONSTRAINT ON (e:Employee) ASSERT e.employeeID is UNIQUE;
CREATE CONSTRAINT ON (c:Customer) ASSERT c.customerID is UNIQUE;
CREATE INDEX ON :Product(productName);
CREATE INDEX ON :Category(categoryID);
CREATE INDEX ON :Supplier(supplierID);
CREATE INDEX ON :Customer(customerName);
164. Creating Relationships
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://
raw.githubusercontent.com/neo4j-contrib/developer-resources/
gh-pages/data/northwind/orders.csv" AS row
MATCH (order:Order {orderID: row.OrderID})
MATCH (customer:Customer {customerID: row.CustomerID})
MERGE (customer)-[:PURCHASED]->(order);
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://
raw.githubusercontent.com/neo4j-contrib/developer-resources/
gh-pages/data/northwind/products.csv" AS row
MATCH (product:Product {productID: row.ProductID})
MATCH (supplier:Supplier {supplierID: row.SupplierID})
MERGE (supplier)-[:SUPPLIES]->(product);
165. Creating Relationships
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/neo4j-
contrib/developer-resources/gh-pages/data/northwind/orders.csv" AS row
MATCH (order:Order {orderID: row.OrderID})
MATCH (product:Product {productID: row.ProductID})
MERGE (order)-[pu:INCLUDES]->(product)
ON CREATE SET pu.unitPrice = toFloat(row.UnitPrice), pu.quantity =
toFloat(row.Quantity);
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/neo4j-
contrib/developer-resources/gh-pages/data/northwind/orders.csv" AS row
MATCH (order:Order {orderID: row.OrderID})
MATCH (employee:Employee {employeeID: row.EmployeeID})
MERGE (employee)-[:SOLD]->(order);
166. Creating Relationships
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/
neo4j-contrib/developer-resources/gh-pages/data/northwind/
products.csv" AS row
MATCH (product:Product {productID: row.ProductID})
MATCH (category:Category {categoryID: row.CategoryID})
MERGE (product)-[:PART_OF]->(category);
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/
neo4j-contrib/developer-resources/gh-pages/data/northwind/
employees.csv" AS row
MATCH (employee:Employee {employeeID: row.EmployeeID})
MATCH (manager:Employee {employeeID: row.ReportsTo})
MERGE (employee)-[:REPORTS_TO]->(manager);
169. “Graph analysis is possibly the single
most effective competitive differentiator
for organizations pursuing data-driven
operations and decisions after the
design of data capture.”