graphs are eating the world
TRANSCRIPT
Graphs are Eating the World
Dave [email protected]
Why a Graph Database?
id name
1 Los Angeles
2 New York
Locationsid name
1 Michelle
2 Hank
3 Jenny
Employees
id name
1 Public
2 Sensitive
AssetGroups
id name
1 Finance
2 IT
Departments
id name
1 Fortune Forecast
2 Jan Press Release
Resources
emp loc
1 1
2 2
3 2
Employees_Locationsemp dept
1 1
2 1
3 2
Employees_Departmentsemp group
1 1
2 1
2 2
3 2
Employees_AssetGroups
rsrc group
1 1
2 2
Resources_AssetGroups
Who in the finance department living in New York has access to the Fortune Forecast?
Who in the finance department living in New York has access to the Fortune Forecast?
The Whiteboard Model Is the Physical Model
CAR
DRIVES
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
LOVES
LOVES
LIVES WITH
OWNS
PERSON PERSONRelationships• Relate nodes by type and direction• Can have name-value properties
Relational Versus Graph Models
Relational Model Graph Model
KNOWS
KNOWS
KNOWS
ANDREAS
TOBIAS
MICA
DELIA
Person FriendPerson-Friend
ANDREASDELIA
TOBIAS
MICA
Graph Query Language: Cypher
MATCH (:Person { name:“Dan”} ) -[:LOVES]-> (:Person { name:“Ann”} )
LOVES
Dan Ann
NODE NODE
LABEL PROPERTYLABEL PROPERTY
MATCH (c:City)-[*..2]->(co:Country{name:'Canada'})RETURN c.name;
Express Complex Queries Easily with Cypher
Find all cities in Canada
Cypher QueryMS SQL Query
WITH AreasCTE AS( --anchor select, start with the country of Canada, which will be the root element for our searchSELECT AreaID, AreaName, ParentAreaID, AreaTypeFROM dbo.Area WHERE AreaName = 'Canada'UNION ALL--recursive select, recursive until you reach a leaf (an Area which is not a parent of any other area)SELECT a.AreaID, a.AreaName, a.ParentAreaID, a.AreaType FROM dbo.Area a INNER JOIN AreasCTE s ON a.ParentAreaID = s.AreaID ) --Now, you will have all Areas in Canada, so now let's filter by the AreaType "City"SELECT * FROM AreasCTE where AreaType = 'City'
https://myadventuresincoding.wordpress.com/2014/05/02/sql-server-simple-recursive-query-example/
Short demo!
Neo4j is leading the world’s fastest
growing database segment:
Graph Databases
RDBMS
Hadoop
DB-Engines is an independent site using objective data from Google Trends, LinkedIn, StackOverflow, etc.
Growth rate over time
adidas
Neo4j is relied on by:
…and over 150 others
“We found Neo4j to be literally thousands of times faster than our prior MySQL solution, with queries that require 10 to 100 times less code. Today, Neo4j provides eBay with functionality that was previously impossible.”
Volker PacherSenior Developer
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
Neo4j Customer Journey
IDENTIFYING
CHALLENGES
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
IDENTIFYING
CHALLENGES
Neo4j Customer Journey
Identifying Challenges
Business Challenges
• Competitor pressure• Real-time response
time• Need to do 10x more
with 10x less• Growth pushing old
systems against the wall
Architecture Challenges
• The requirements will change later
• Iterative development clashes with schema
• Real-time reads with simultaneous writes
Development Challenges
• Poor JOIN performance• Building a flexible &
extendable data model• Transactional operation• Code becoming hard to
evolve
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
IDENTIFYING
CHALLENGES
Neo4j Customer Journey
IDENTIFYING
CHALLENGES
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
Neo4j Customer Journey
Everyone collects data today.
“Store first, ask questions later”
Better Data
There is another dimension beyond data volume:
Data Relationships
Better Data
Invoice
Total: $10
To: Peter, Acme Inc.
Imagine it’s the 90’s and you have an invoicing system.
AccountingSystem
Great
!
Better Data
Now imagine it’s today.
AccountingSystem
Wait… that’s
it?
Invoice
Total: $10
To: Peter, Acme Inc.
Better Data
Invoice
Total: $10
To: Peter, Acme Inc.
ProductsCategories
CompaniesMarket
Segments
People
Invoices actually have a lot of information.
Better Data
Invoice
Total: $10
To: Peter, Acme Inc.
• What kind of products do customers in a certain market segment buy?
• What items could we recommend to this customer, based on what other people have bought?
• What kind of customer shops in a certain category?
Products
Categories
Companies
Market Segments
People
Better Data
Ignore data relationships and you will miss these insights.
Put your data relationships to work and make the most of the data you already have!
Invoice
Total: $10
To: Peter, Acme Inc.
Products
Categories
Companies
Market Segments
People
Better Data
IDENTIFYING
CHALLENGES
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
Neo4j Customer Journey
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
IDENTIFYING
CHALLENGES
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
Neo4j Customer Journey
Better Development
“Yeah… so we need to store and query data relationships as a graph. We will use a tabular database because it’s what we always use.”
You what, mate?
Better DevelopmentDon’t reinvent the wheel! It’s costly and will set you back.
Let Neo4j do the heavy lifting for you. We have spent over a decade with 200+ customers building the world’s leading graph database.
Keep your team focused on building your product and business, not a complex database solution.
Better DevelopmentSay goodbye to denormalized query views
Query live data as it’s being updated, all in real time with Cypher or Java APIs
Scale your infrastructure proportionally and reasonably
Orders-of-magnitude improvement on modest hardware
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
IDENTIFYING
CHALLENGES
Neo4j Customer Journey
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
IDENTIFYING
CHALLENGES
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
Neo4j Customer Journey
Focus usually shifts from asking– How do we solve this?to– Wow! What else can we do?
Climbing the stairs is significantly easier the second time
Better Decisions
Journey Example
IDENTIFYING
CHALLENGES
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
– The SQL queries are prohibitively slow.
– It makes a lot of sense to look at our data as a graph.
– There is a great product available, built for graphs.
– How can we use this tool and way of thinking to improve our business?
The Core ofWhy Neo4j
IDENTIFYING
CHALLENGES
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
BETTER DEVELOPME
NT
BETTER DATA
Start getting value from the Data
Relationships in your business
Maintain momentum and keep your team
focused and effective
The Core of Why Neo4j
Selected Case Study
AirbusDesign Dependency Analysis
Airbus
• 63’000 employees
• €60 Billion revenue in 2014
• 437 operators globally:
Airbus – The Challenge
• Aircraft design process generates large amounts of design assets
• A given part of the model may be referenced in many places
• It becomes increasingly costly to analyze the impact of a change
Airbus – Evaluating Neo4j
• By mapping the dependencies among the assets, impact can be understood up-front immediately
• 10x required performance with 100 million items and 1B+ links
• Neo4j evaluated in short amount of time with expert assistance
Airbus – Value of Solution• Shifting a slow process to become
real-time, increasing productivity while reducing frustration and mistakes
• Engineers can immediately validate changes being made against the relevant dependencies
• Focus shifted from “how do we build this” to “what should we build next?”
Airbus – Value of Solution
• Leverage data relationships between design assets to work smarter
• Allow engineers to spend more time on valuable work by making impact and dependency analysis very simple
BETTER DEVELOPME
NT
BETTER DATA
BETTER DEVELOPME
NT
BETTER DATA
Start getting value from the Data
Relationships in your business
Maintain momentum and keep your team
focused and effective
The Core of Why Neo4j
Neo4j Customer Journey
IDENTIFYING
CHALLENGES
BETTER DATA
FOCUS ON DATA
RELATIONSHIPS
BETTER DECISIONS“HOW DO WE SOLVE
THIS?” BECOMES
“WOW, WHAT ELSE
CAN WE DO?”
BETTER DEVELOPM
ENTINVENT YOUR
PRODUCT, NOT A GRAPH
DATABASE
Thank you!!!