a whirlwind tour of graph databases
TRANSCRIPT
![Page 1: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/1.jpg)
GraphDBWhirlwind TourMichael Hunger
Code Days - OOP
![Page 2: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/2.jpg)
(Michael Hunger)-[:WORKS_FOR]->(Neo4j)
[email protected] | @mesirii | github.com/jexp | jexp.de/blog
Michael Hunger - Head of Developer Relations @Neo4j
![Page 3: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/3.jpg)
WhyGraphs
?
UseCases
Data Model
Query-ing
Neo4j
![Page 4: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/4.jpg)
Why Graphs?
Because the World is a Graph!
![Page 5: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/5.jpg)
Everything and Everyone is Connected
• people, places, events• companies, markets• countries, history, politics• sciences, art, teaching• technology, networks, machines, applications, users• software, code, dependencies, architecture, deployments• criminals, fraudsters and their behavior
![Page 6: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/6.jpg)
Value from Relationships
![Page 7: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/7.jpg)
Value from Data RelationshipsCommon Use Cases
Internal Applications
Master Data Management
Network and IT Operations
Fraud Detection
Customer-Facing Applications
Real-Time Recommendations
Graph-Based Search
Identity and Access Management
![Page 8: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/8.jpg)
The Rise of Connections in Data
Networks of People Business Processes Knowledge Networks
E.g., Risk management, Supply chain, Payments
E.g., Employees, Customers, Suppliers, Partners, Influencers
E.g., Enterprise content, Domain specific content, eCommerce content
Data connections are increasing as rapidly as data volumes
![Page 9: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/9.jpg)
9
Harnessing Connections Drives Business Value
Enhanced Decision
Making
Hyper
Personalization
Massive Data
Integration
Data Driven Discovery
& Innovation
Product Recommendations
Personalized Health Care
Media and Advertising
Fraud Prevention
Network Analysis
Law Enforcement
Drug Discovery
Intelligence and Crime Detection
Product & Process Innovation
360 view of customer
Compliance
Optimize Operations
Connected Data at the Center
AI & Machine
Learning
Price optimization
Product Recommendations
Resource allocation
Digital Transformation Megatrends
![Page 10: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/10.jpg)
Graph Databases areHOT
![Page 11: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/11.jpg)
Graph Databases Are Hot
![Page 12: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/12.jpg)
Lots of Choice
![Page 13: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/13.jpg)
Newcomers in the last 3 years
• DSE Graph
• Agens Graph
• IBM Graph
• JanusGraph
• Tibco GraphDB
• Microsoft CosmosDB
• TigerGraph
• MemGraph
• AWS Neptune
• SAP HANA Graph
![Page 14: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/14.jpg)
Database Technology Architectures
Graph DB
Connected DataDiscrete Data
Relational DBMSOther NoSQL
Right Tool for the Job
![Page 15: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/15.jpg)
The impact of Graphs
How Graphs are changing the World
![Page 16: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/16.jpg)
GRAPHSFOR GOOD
![Page 17: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/17.jpg)
![Page 18: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/18.jpg)
![Page 19: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/19.jpg)
Neo4j ICIJ Distribution
![Page 20: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/20.jpg)
Better Health with Graphs
![Page 21: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/21.jpg)
Cancer Research - Candiolo Cancer Institute
“Our application relies on complexhierarchical data, which required a moreflexible model than the one provided bythe traditional relational databasemodel,” said Andrea Bertotti, MD
neo4j.com/case-studies/candiolo-cancer-institute-ircc/
![Page 22: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/22.jpg)
Graph Databases in Healthcare and Life Sciences
14 Presenters from all around Europe on:
• Genome• Proteome• Human Pathway• Reactome• SNP• Drug Discovery• Metabolic Symbols• ...
neo4j.com/blog/neo4j-life-sciences-healthcare-workshop-berlin/
![Page 23: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/23.jpg)
DISRUPTIONWITHGRAPHS
![Page 24: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/24.jpg)
![Page 25: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/25.jpg)
BETTERBUSINESSWITH GRAPHS
![Page 26: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/26.jpg)
28
Real-Time Recommendations
Fraud Detection
Network &IT Operations
Master Data Management
Knowledge Graph
Identity & Access Management
Common Graph Technology Use Cases
AirBnb
![Page 27: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/27.jpg)
30
• Record “Cyber Monday” sales• About 35M daily transactions• Each transaction is 3-22 hops• Queries executed in 4ms or less• Replaced IBM Websphere commerce
• 300M pricing operations per day• 10x transaction throughput on half the
hardware compared to Oracle• Replaced Oracle database
• Large postal service with over 500k employees
• Neo4j routes 7M+ packages daily at peak, with peaks of 5,000+ routing operations per second.
Handling Large Graph Work Loads for Enterprises
Real-time promotion
recommendations
Marriott’s Real-time
Pricing Engine
Handling Package
Routing in Real-Time
![Page 28: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/28.jpg)
Software
Financial Services Telecom
Retail & Consumer Goods
Media & Entertainment Other Industries
Airbus
![Page 29: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/29.jpg)
NEWINSIGHTSWITH GRAPHS
![Page 30: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/30.jpg)
Machine Learning is Based on Graphs
![Page 31: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/31.jpg)
![Page 32: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/32.jpg)
![Page 33: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/33.jpg)
![Page 34: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/34.jpg)
The Property GraphModel, Import, Query
![Page 35: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/35.jpg)
The Whiteboard Model Is the Physical Model
Eliminates Graph-to-Relational Mapping
In your data modelBridge the gap
between business and IT models
In your applicationGreatly reduce need for application code
![Page 36: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/36.jpg)
CAR
name: “Dan”born: May 29, 1970
twitter: “@dan”name: “Ann”
born: Dec 5, 1975
since: Jan 10, 2011
brand: “Volvo”model: “V70”
Property Graph Model Components
Nodes• The objects in the graph• Can have name-value properties• Can be labeled
Relationships• Relate nodes by type and direction• Can have name-value properties
LOVES
LOVES
LIVES WITHPERSON PERSON
![Page 37: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/37.jpg)
Cypher: Powerful and Expressive Query Language
MATCH (:Person { name:“Dan”} ) -[:LOVES]-> (:Person { name:“Ann”} )
LOVES
Dan Ann
LABEL PROPERTY
NODE NODE
LABEL PROPERTY
![Page 38: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/38.jpg)
Relational Versus Graph Models
Relational Model Graph Model
KNOWSANDREAS
TOBIAS
MICA
DELIA
Person FriendPerson-Friend
ANDREASDELIA
TOBIAS
MICA
![Page 39: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/39.jpg)
Retail ...
Recommendations
![Page 40: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/40.jpg)
Our starting point – Northwind ER
![Page 41: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/41.jpg)
Building Relationships in Graphs
ORDERED
Customer OrderOrder
![Page 42: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/42.jpg)
Locate Foreign Keys
![Page 43: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/43.jpg)
(FKs)-[:BECOME]->(Relationships) & Correct Directions
![Page 44: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/44.jpg)
Drop Foreign Keys
![Page 45: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/45.jpg)
Find the Join Tables
![Page 46: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/46.jpg)
Simple Join Tables Becomes Relationships
![Page 47: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/47.jpg)
Attributed Join Tables Become Relationships with Properties
![Page 48: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/48.jpg)
(One) Northwind Graph Model
![Page 49: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/49.jpg)
(:You)-[:QUERY]->(:Data)
in a graph
![Page 50: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/50.jpg)
Who bought Chocolat?
![Page 51: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/51.jpg)
You all know SQL
SELECT distinct c.CompanyNameFROM customers AS cJOIN orders AS o
ON (c.CustomerID = o.CustomerID)JOIN order_details AS od
ON (o.OrderID = od.OrderID)JOIN products AS p
ON (od.ProductID = p.ProductID)WHERE p.ProductName = 'Chocolat'
![Page 52: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/52.jpg)
Apache Tinkerpop 3.3.x - Gremlin
g = graph.traversal();g.V().hasLabel('Product')
.has('productName','Chocolat')
.in('INCLUDES')
.in('ORDERED')
.values('companyName').dedup();
![Page 53: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/53.jpg)
W3C Sparql
PREFIX sales_db: <http://sales.northwind.com/>
SELECT distinct ?company_name WHERE {<sales_db:CompanyName> ?company_name .
?c <sales_db:ORDERED> ?o .?o <sales_db:ITEMS> ?od .?od <sales_db:INCLUDES> ?p .?p <sales_db:ProductName> "Chocolat" .
}
![Page 54: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/54.jpg)
openCypher
MATCH (c:Customer)-[:ORDERED]->(o)-[:INCLUDES]->(p:Product)
WHERE p.productName = 'Chocolat'
RETURN distinct p.companyName
![Page 55: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/55.jpg)
Basic Pattern: Customers Orders?
MATCH (:Customer {custName:"Delicatessen"} ) -[:ORDERED]-> (order:Order) RETURN order
VAR LABEL
NODE NODE
LABEL PROPERTY
ORDERED
Customer OrderOrder
REL
![Page 56: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/56.jpg)
Basic Query: Customer's Orders?
MATCH (c:Customer)-[:ORDERED]->(order)
WHERE c.customerName = 'Delicatessen'
RETURN *
![Page 57: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/57.jpg)
Basic Query: Customer's Frequent Purchases?
MATCH (c:Customer)-[:ORDERED]->()-[:INCLUDES]->(p:Product)
WHERE c.customerName = 'Delicatessen'
RETURN p.productName, count(*) AS freqORDER BY freq DESC LIMIT 10;
![Page 58: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/58.jpg)
openCypher - Recommendation
MATCH(c:Customer)-[:ORDERED]->(o1)-[:INCLUDES]->(p),(peer)-[:ORDERED]->(o2)-[:INCLUDES]->(p),(peer)-[:ORDERED]->(o3)-[:INCLUDES]->(reco)
WHERE c.customerId = $customerIdAND NOT (c)-[:ORDERED]->()-[:INCLUDES]->(reco)
RETURN reco.productName, count(*) AS freqORDER BY freq DESC LIMIT 10
![Page 59: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/59.jpg)
Product Cross-Sell
MATCH(:Product {productName: 'Chocolat'})<-[:INCLUDES]-(:Order)<-[:SOLD]-(employee)-[:SOLD]->()-[:INCLUDES]->(cross:Product)
RETURNemployee.firstName, cross.productName, count(distinct o2) AS freq
ORDER BY freq DESC LIMIT 5;
![Page 60: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/60.jpg)
openCypher
![Page 61: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/61.jpg)
openCypher...
...is a community effort to evolve Cypher, and tomake it the most useful language for querying property graphs
openCypher implementations
SAP Hana Graph, Redis, Agens Graph, Cypher.PL, Neo4j
![Page 62: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/62.jpg)
github.com/opencypher Language Artifacts
● Cypher 9 specification● ANTLR and EBNF Grammars● Formal Semantics (SIGMOD)● TCK (Cucumber test suite)● Style Guide
Implementations & Code
● openCypher for Apache Spark● openCypher for Gremlin● open source frontend (parser)● ...
![Page 63: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/63.jpg)
Cypher 10
● Next version of Cypher
● Actively working on natural language specification
● New features○ Subqueries○ Multiple graphs○ Path patterns○ Configurable pattern matching semantics
![Page 64: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/64.jpg)
Extending Neo4j
![Page 65: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/65.jpg)
Extending Neo4j -User Defined Procedures & Functions
Neo4j Execution EngineUser Defined
Procedure
User Defined Functions
Applications
Bolt
User Defined Procedures & Functions let
you write custom code that is:
• Written in any JVM language
• Deployed to the Database
• Accessed by applications via Cypher
![Page 66: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/66.jpg)
Procedure Examples
Built-In• Metadata Information
• Index Management
• Security
• Cluster Information
• Query Listing & Cancellation
• ...
Libraries• APOC (std library)• Spatial• RDF (neosemantics)• NLP• ...
neo4j.com/developer/procedures-functions
![Page 67: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/67.jpg)
Example: Data(base) Integration
![Page 68: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/68.jpg)
Graph Analytics
Neo4j Graph Algorithms
![Page 69: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/69.jpg)
”Graph analysis is possibly the single most effective
competitive differentiator for organizations pursuing data-
driven operations and decisions“
The Impact of Connected Data
![Page 70: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/70.jpg)
Existing Options (so far)
•Data Processing•Spark with GraphX, Flink with Gelly•Gremlin Graph Computer
•Dedicated Graph Processing•Urika, GraphLab, Giraph, Mosaic, GPS, Signal-Collect, Gradoop
•Data Scientist Toolkit• igraph, NetworkX, Boost in Python, R, C
![Page 71: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/71.jpg)
![Page 72: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/72.jpg)
Goal: Iterate Quickly
•Combine data from sources into one graph
•Project to relevant subgraphs
•Enrich data with algorithms
•Traverse, collect, filter aggregate with queries
•Visualize, Explore, Decide, Export
•From all APIs and Tools
![Page 73: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/73.jpg)
![Page 74: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/74.jpg)
1. Call as Cypher procedure
2. Pass in specification (Label, Prop, Query) and configuration
3. ~.stream variant returns (a lot) of results
CALL algo.<name>.stream('Label','TYPE',{conf})
YIELD nodeId, score
4. non-stream variant writes results to graph returns statistics
CALL algo.<name>('Label','TYPE',{conf})
Usage
![Page 75: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/75.jpg)
Pass in Cypher statement for node- and relationship-lists.
CALL algo.<name>(
'MATCH ... RETURN id(n)',
'MATCH (n)-->(m)
RETURN id(n) as source,
id(m) as target', {graph:'cypher'})
Cypher Projection
![Page 76: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/76.jpg)
DEMO: OOP
![Page 77: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/77.jpg)
Development
![Page 78: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/78.jpg)
Data Storage andBusiness Rules Execution
Data Mining and Aggregation
Neo4j Fits into Your Environment
Application
Graph Database Cluster
Neo4j Neo4j Neo4j
Ad HocAnalysis
Bulk AnalyticInfrastructure
Graph Compute EngineEDW …
Data Scientist
End User
Databases
RelationalNoSQL
Hadoop
![Page 79: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/79.jpg)
Official Language Drivers
• Foundational drivers for popular programming languages
• Bolt: streaming binary wire protocol
• Authoritative mapping to native type system, uniform across drivers
• Pluggable into richer frameworks
JavaScript Java .NET Python PHP, ....
Drivers
Bolt
![Page 80: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/80.jpg)
Bolt + Official Language Drivers
http://neo4j.com/developer/ http://neo4j.com/developer/language-guides/
![Page 81: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/81.jpg)
Using Bolt: Official Language Drivers look all the same
With JavaScript
var driver = Graph.Database.driver("bolt://localhost");
var session = driver.session();
var result = session.run("MATCH (u:User) RETURN u.name");
![Page 82: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/82.jpg)
neo4j.com/developer/spring-data-neo4j
Spring Data Neo4j Neo4j OGM
@NodeEntitypublic class Talk { @Id @GeneratedValueLong id; String title; Slot slot;Track track; @Relationship(type="PRESENTS",
direction=INCOMING) Set<Person> speaker = new HashSet<>();
}
![Page 83: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/83.jpg)
Spring Data Neo4j Neo4j OGM
interface TalkRepository extends Neo4jRepository<Talk, Long> {
@Query("MATCH (t:Talk)<-[rating:RATED]-(user) WHERE t.id = {talkId} RETURN rating")
List<Rating> getRatings(@Param("talkId") Long talkId);
List<Talk> findByTitleContaining(String title);}
![Page 84: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/84.jpg)
github.com/neoj4-contrib/neo4j-spark-connector
Neo4j Spark Connector
![Page 86: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/86.jpg)
Neo4j
THE Graph Database Platform
![Page 87: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/87.jpg)
Graph Transactions
Graph Analytics
Data Integration
Development & Admin
Analytics Tooling
Drivers & APIs Discovery & Visualization
Developers
Admins
Applications Business Users
Data Analysts
Data Scientists
![Page 88: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/88.jpg)
• Operational workloads
• Analytics workloads
Real-time Transactional
and Analytic Processing • Interactive graph exploration
• Graph representation of data
Discovery and
Visualization
• Native property graph model
• Dynamic schema
Agilit
y
• Cypher - Declarative query language
• Procedural language extensions
• Worldwide developer community
Developer Productivity
• 10x less CPU with index-free adjacency
• 10x less hardware than other platforms
Hardware efficiency
Neo4j: Graph Platform
Performance
• Index-free adjacency
• Millions of hops per second
![Page 89: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/89.jpg)
![Page 90: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/90.jpg)
Index-free adjacency ensures lightning-
fast retrieval of data and relationships
Native Graph Architecture
Index free adjacencyUnlike other database models Neo4j
connects data as it is stored
![Page 91: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/91.jpg)
Neo4j Query Planner
Cost based Query Planner since Neo4j
• Uses transactional database statistics
• High performance Query Engine
• Bytecode compiled queries
• Future: Parallism
![Page 92: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/92.jpg)
1
2
3
4
5
6
Architecture Components
Index-Free Adjacency
In memory and on flash/disk
vs
ACID Foundation
Required for safe writes
Full-Stack Clustering
Causal consistencySecurity
Language, Drivers, Tooling
Developer Experience, Graph Efficiency
Graph Engine
Cost-Based Optimizer, Graph Statistics, Cypher Runtime
Hardware Optimizations
For next-gen infrastructure
![Page 93: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/93.jpg)
Neo4j – allows you to connect the dots
• Was built to efficiently
• store,
• query and
• manage highly connected data
• Transactional, ACID• Real-time OLTP• Open source• Highly scalable on few machines
![Page 94: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/94.jpg)
High Query Performance: Some Numbers
• Traverse 2-4M+ relationships per second and core
• Cost based query optimizer –complex queries return in milliseconds
• Import 100K-1M records per second transactionally
• Bulk import tens of billions of records in a few hours
![Page 95: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/95.jpg)
Get Started
![Page 96: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/96.jpg)
Neo4j Sandbox
![Page 97: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/97.jpg)
How do I get it? Desktop – Container – Cloud
http://neo4j.com/download/
docker run neo4j
![Page 98: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/98.jpg)
Neo4j Cluster Deployment Options
• Developer: Neo4j Desktop (free Enterprise License)• On premise – Standalone or via OS package• Containerized with official Docker Image•
In the Cloud• AWS, GCE, Azure
• Using Resource Managers• DC/OS – Marathon
• Kubernetes
• Docker Swarm
![Page 99: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/99.jpg)
10M+
Downloads
3M+ from Neo4j Distribution
7M+ from Docker
Events
400+Approximate Number of
Neo4j Events per Year
50k+
Meetups
Number of Meetup
Members Globally
Active Community
50k+Trained/certified Neo4j
professionals
Trained Developers
![Page 100: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/100.jpg)
Summary: Graphs allow you ...
• Keep your rich data model
• Handle relationships efficiently
• Write queries easily
• Develop applications quickly
• Have fun
![Page 101: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/101.jpg)
Thank You!
Questions?!
@neo4j | neo4j.com@mesirii | Michael Hunger
![Page 102: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/102.jpg)
Users Love Neo4j
![Page 103: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/103.jpg)
Causal Clustering
Core & Replica Servers Causal Consistency
![Page 104: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/104.jpg)
Causal Clustering - Features
• Two Zones – Core + Edge
• Group of Core Servers – Consistent and Partition tolerant (CP)
• Transactional Writes
• Quorum Writes, Cluster Membership, Leader via Raft Consensus
• Scale out with Read Replicas
• Smart Bolt Drivers with
• Routing, Read & Write Sessions
• Causal Consistency with Bookmarks
![Page 105: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/105.jpg)
• For massive query throughput
• Read-only replicas• Not involved in Consensus
Commit • Disposable, suitable for
auto-scaling
Replica
• Small group of Neo4j databases
• Fault-tolerant Consensus Commit
• Responsible for data safety
Core
![Page 106: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/106.jpg)
Writing to the Core Cluster
Neo4j
Driver
✓
✓
✓
Success
Neo4j
Cluster
![Page 107: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/107.jpg)
Application
Server
Neo4j
DriverMax
Jim
Jane
Mar
k
![Page 108: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/108.jpg)
Routed write statements
driver = GraphDatabase.driver( "bolt+routing://aCoreServer" );
try ( Session session = driver.session( AccessMode.WRITE ) )
{
try ( Transaction tx = session.beginTransaction() )
{
tx.run( "MERGE (user:User {userId: {userId}})",
parameters( "userId", userId ) );
tx.success();
}
}
![Page 109: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/109.jpg)
Bookmark
• Session token• String (for portability)• Opaque to application• Represents ultimate user’s most
recent view of the graph• More capabilities to come
![Page 110: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/110.jpg)
Data
Redundancy
Massive
ThroughputHigh
Availability
3.0
Bigger ClustersConsensus
Commit
Built-in load
balancing
3.1Causal
Clusteri
ng
![Page 111: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/111.jpg)
Neo4j 3.0 Neo4j 3.1High Availability
ClusterCausal Cluster
Master-Slave architecture
Paxos consensus used for
master election
Raft protocol used for leader
election, membership changes
and
commitment of all
transactions
Two part cluster: writeable
Core and read-only read
replicas.
Transaction committed
once written durably on
the master
Transaction committed once written
durably on a majority of the core
members
Practical deployments:
10s servers
Practical deployments: 100s
servers
![Page 112: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/112.jpg)
Causal Clustering - Features
• Two Zones – Core + Edge
• Group of Core Servers – Consistent and Partition tolerant (CP)
• Transactional Writes
• Quorum Writes, Cluster Membership, Leader via Raft Consensus
• Scale out with Read Replicas
• Smart Bolt Drivers with
• Routing, Read & Write Sessions
• Causal Consistency with Bookmarks
![Page 113: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/113.jpg)
• For massive query throughput
• Read-only replicas• Not involved in Consensus
Commit • Disposable, suitable for
auto-scaling
Replica
• Small group of Neo4j databases
• Fault-tolerant Consensus Commit
• Responsible for data safety
Core
![Page 114: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/114.jpg)
Writing to the Core Cluster – Raft Consensus
CommitsNeo4j
Driver
✓
✓
✓
Success
Neo4j
Cluster
![Page 115: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/115.jpg)
Application
Server
Neo4j
DriverMax
Jim
Jane
Mar
k
![Page 116: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/116.jpg)
Routed write statements
driver = GraphDatabase.driver( "bolt+routing://aCoreServer" );
try ( Session session = driver.session( AccessMode.WRITE ) )
{
try ( Transaction tx = session.beginTransaction() )
{
tx.run( "MERGE (user:User {userId: {userId}})“, parameters( "userId",
userId ) );
tx.success();
}
}
![Page 117: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/117.jpg)
Bookmark
• Session token• String (for portability)• Opaque to application• Represents ultimate user’s most
recent view of the graph• More capabilities to come
![Page 118: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/118.jpg)
Data
Redundancy
Massive
ThroughputHigh
Availability
3.0
Bigger ClustersConsensus
Commit
Built-in load
balancing
3.1Causal
Clusteri
ng
![Page 119: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/119.jpg)
Flexible Authentication Options
Choose authentication method
• Built-in native users repositoryTesting/POC, single-instance deployments
• LDAP connector to Active Directory or openLDAP
Production deployments
• Custom auth provider plugins
Special deployment scenarios
128
CustomPlugin
Active Directory openLDAP
LDAP connector
LDAP connector
Auth PluginExtension Module
Built-inNative Users
Neo4j
Built-in Native Users
Auth Plugin Extension Module
![Page 120: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/120.jpg)
129
Flexible Authentication OptionsLDAP Group to Role Mapping
dbms.security.ldap.authorization.group_to_role_mapping= \
"CN=Neo4j Read Only,OU=groups,DC=example,DC=com" = reader; \
"CN=Neo4j Read-Write,OU=groups,DC=example,DC=com" = publisher; \
"CN=Neo4j Schema Manager,OU=groups,DC=example,DC=com" = architect; \
"CN=Neo4j Administrator,OU=groups,DC=example,DC=com" = admin; \
"CN=Neo4j Procedures,OU=groups,DC=example,DC=com" = allowed_role./conf/neo4j.conf
CN=Bob Smith
CN=Carl JuniorOU=peopleDC=example
DC=com
BASE DN
OU=groups
CN=Neo4j Read Only
CN=Neo4j Read-Write
CN=Neo4j Schema Manager
CN=Neo4j Administrator
CN=Neo4j Procedures
Map to Neo4j permissions
![Page 121: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/121.jpg)
Use Cases
![Page 122: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/122.jpg)
Case Study: Knowledge Graphs at eBay
![Page 123: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/123.jpg)
Case Study: Knowledge Graphs at eBay
![Page 124: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/124.jpg)
Case Study: Knowledge Graphs at eBay
![Page 125: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/125.jpg)
Case Study: Knowledge Graphs at eBay
Bags
![Page 126: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/126.jpg)
Men’s Backpack
Handbag
Case Study: Knowledge Graphs at eBay
![Page 127: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/127.jpg)
Case studySolving real-time recommendations for the World’s largest retailer.
Challenge
• In its drive to provide the best web experience for its customers, Walmart wanted to optimize its online recommendations.
• Walmart recognized the challenge it faced in delivering recommendations with traditional relational database technology.
• Walmart uses Neo4j to quickly query customers’ past purchases, as well as instantly capture any new interests shown in the customers’ current online visit – essential for making real-time recommendations.
Use of Neo4j
“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
• With Neo4j, Walmart could substitute a heavy batch process with a simple and real-time graph database.
Result/Outcome
![Page 128: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/128.jpg)
Case studyeBay Now Tackles eCommerce Delivery Service Routing with Neo4j
Challenge
• The queries used to select the best courier for eBays routing system were simply taking too long and they needed a solution to maintain a competitive service.
• The MySQL joins being used created a code base too slow and complex to maintain.
• eBay is now using Neo4j’s graph database platform to redefine e-commerce, by making delivery of online and mobile orders quick and convenient.
Use of Neo4j
• With Neo4j eBay managed to eliminate the biggest roadblock between retailers and online shoppers: the option to have your item delivered the same day.
• The schema-flexible nature of the database allowed easy extensibility, speeding up development.
• Neo4j solution was more than 1000x faster than the prior MySQL Soltution.
Our Neo4j solution is literally thousands of times faster than the prior MySQL solution, with queries that require 10-100 times less code.
Result/Outcome
– Volker Pacher, eBay
![Page 129: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/129.jpg)
Top Tier US RetailerCase studySolving Real-time promotions for a top US
retailer
Challenge
• Suffered significant revenues loss, due to legacy infrastructure.
• Particularly challenging when handling transaction volumes on peak shopping occasions such as Thanksgiving and Cyber Monday.
• Neo4j is used to revolutionize and reinvent its real-time promotions engine.
• On an average Neo4j processes 90% of this retailer’s 35M+ daily transactions, each 3-22 hops, in 4ms or less.
Use of Neo4j
• Reached an all time high in online revenues, due to the Neo4j-based friction free solution.
• Neo4j also enabled the company to be one of the first retailers to provide the same promotions across both online and traditional retail channels.
“On an average Neo4j processes 90% of this retailer’s 35M+ daily transactions, each 3-22 hops, in 4ms or less.”
– Top Tier US Retailer
Result/Outcome
![Page 130: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/130.jpg)
Relational DBs Can’t Handle Relationships Well
• Cannot model or store data and relationships without complexity
• Performance degrades with number and levels of relationships, and database size
• Query complexity grows with need for JOINs
• Adding new types of data and relationships requires schema redesign, increasing time to market
… making traditional databases inappropriatewhen data relationships are valuable in real-time
Slow developmentPoor performance
Low scalabilityHard to maintain
![Page 131: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/131.jpg)
Unlocking Value from Your Data Relationships
• Model your data as a graph of data and relationships
• Use relationship information in real-time to transform your business
• Add new relationships on the fly to adapt to your changing business
![Page 132: A whirlwind tour of graph databases](https://reader033.vdocuments.net/reader033/viewer/2022061317/5aade72b7f8b9a3d6a8b465b/html5/thumbnails/132.jpg)
MATCH (sub)-[:REPORTS_TO*0..3]->(boss),(report)-[:REPORTS_TO*1..3]->(sub)
WHERE boss.name = "Andrew K."RETURN sub.name AS Subordinate, count(report) AS Total
Express Complex Queries Easily with Cypher
Find all direct reports and how many people they manage, up to 3 levels down
Cypher Query
SQL Query