introduction: relational to graphs

55
RDBMS to Graphs Harnessing the Power of the Graph March 2015

Upload: neo4j-the-fastest-and-most-scalable-native-graph-database

Post on 16-Jul-2015

305 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introduction: Relational to Graphs

RDBMS to GraphsHarnessing the Power of the Graph

March 2015

Page 2: Introduction: Relational to Graphs

Agenda

• Origins of Neo4j

• Benefits of Graphs

• Your enterprise architecture & polyglot persistence

• Query time!

• Q&A

Page 3: Introduction: Relational to Graphs

Neo Technology Overview

Product

• Neo4j - World’s leading graph database

• 1M+ downloads, adding 50k+ per month

• 150+ enterprise subscription customers including over 50 of the Global 2000

Company

• Neo Technology, Creator of Neo4j

• 80 employees with HQ in Silicon Valley, London, Munich, Paris and Malmö

• $45M in funding from Fidelity, Sunstone, Conor, Creandum, Dawn Capital

Page 4: Introduction: Relational to Graphs

Neo4j Adoption by Selected Verticals

FinancialServices

CommunicationsHealth &

Life Sciences

HR &Recruiting

Media &Publishing

SocialWeb

Industry & Logistics

Entertainment Consumer Retail Information ServicesBusiness Services

Page 5: Introduction: Relational to Graphs

How Customers Use Neo4j

Network & Data Center

Master DataManagement

SocialRecom–

mendations

Identity & Access

Search &Discovery

GEO

Page 6: Introduction: Relational to Graphs

“Forrester estimates that over 25% of enterprises will be using graph databases by 2017”

Neo4j Leads the Graph Database Revolution

“Neo4j is the current market leader in graph databases.”

“Graph analysis is possibly the single most effective competitive differentiator for organizations pursuing data-driven operations and decisions after the design of data capture.”

IT Market Clock for Database Management Systems, 2014https://www.gartner.com/doc/2852717/it-market-clock-database-management

TechRadar™: Enterprise DBMS, Q1 2014http://www.forrester.com/TechRadar+Enterprise+DBMS+Q1+2014/fulltext/-/E-RES106801

Graph Databases – and Their Potential to Transform How We Capture Interdependencies (Enterprise Management Associates)http://blogs.enterprisemanagement.com/dennisdrogseth/2013/11/06/graph-databasesand-potential-transform-capture-interdependencies/

Page 7: Introduction: Relational to Graphs

Largest Ecosystem of Graph Enthusiasts

• 1,000,000+ downloads

• 20,000+ education registrants

• 18,000+ Meetup members

• 100+ technology and service partners

• 150+ enterprise subscription customers including 50+ Global 2000 companies

Page 8: Introduction: Relational to Graphs

High Business Value in Data Relationships

Data is increasing in volume…• New digital processes• More online transactions• New social networks• More devices

Using Data Relationships unlocks value • Real-time recommendations• Fraud detection• Master data management• Network and IT operations• Identity and access management• Graph-based search… and is getting more connected

Customers, products, processes, devices interact and relate to each other

Early adopters became industry leaders

Page 9: Introduction: Relational to Graphs

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 10: Introduction: Relational to Graphs

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 11: Introduction: Relational to Graphs

Modeling as a Graph

Page 12: Introduction: Relational to Graphs

The Whiteboard Model Is the Physical Model

Page 13: Introduction: Relational to Graphs

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 14: Introduction: Relational to Graphs

Relational Versus Graph Models

Relational Model Graph Model

KNOWSANDREAS

TOBIAS

MICA

DELIA

Person FriendPerson-Friend

ANDREASDELIA

TOBIAS

MICA

Page 15: Introduction: Relational to Graphs

Let’s Model!Customer, Supplier, and Product (Master Data)

Orders (Activity)

Page 16: Introduction: Relational to Graphs

The Domain Model

Page 17: Introduction: Relational to Graphs

Except…

Page 18: Introduction: Relational to Graphs

The RequisiteNorthwind Example!

NOT JUST ANY

Page 19: Introduction: Relational to Graphs

(Northwind)-[:TO]->(Graph)Building the Graph Model

Page 20: Introduction: Relational to Graphs

Building Relationships in Graphs

SOLD

Employee OrderOrder

Page 21: Introduction: Relational to Graphs

Locate Foreign Keys

Page 22: Introduction: Relational to Graphs

(FKs)-[:BECOME]->(Relationships)Correct Directions

Page 23: Introduction: Relational to Graphs

Drop Foreign Keys

Page 24: Introduction: Relational to Graphs

Find the Join Tables

Page 25: Introduction: Relational to Graphs

Simple Join Tables Becomes Relationships

Page 26: Introduction: Relational to Graphs

Attributed Join Tables BecomeRelationships with Properties

Page 27: Introduction: Relational to Graphs

Working Subset (Today’s Exercise)

Page 28: Introduction: Relational to Graphs

Northwind Graph Model

Page 29: Introduction: Relational to Graphs

Querying Your Data

Page 30: Introduction: Relational to Graphs

Basic Query: Who do people report to?

MATCH (:Employee{ firstName:“Steven”} ) -[:REPORTS_TO]-> (:Employee{ firstName:“Andrew”} )

REPORTS_TO

Steven Andrew

LABEL PROPERTY

NODE NODE

LABEL PROPERTY

Page 31: Introduction: Relational to Graphs

Basic Query: Who do people report to?

MATCH

(e:Employee)<-[:REPORTS_TO]-(sub:Employee)

RETURN

*

Page 32: Introduction: Relational to Graphs

Basic Query: Who do people report to?

Page 33: Introduction: Relational to Graphs

Basic Query: Who do people report to?

Page 34: Introduction: Relational to Graphs

MATCH (sub)-[:REPORTS_TO*0..3]->(boss),(report)-[:REPORTS_TO*1..3]->(sub)

WHERE boss.name = “John Doe”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

Page 35: Introduction: Relational to Graphs

“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

Page 36: Introduction: Relational to Graphs

Who is in Robert’s (direct, upwards) reporting chain?

MATCH

p=(e:Employee)<-[:REPORTS_TO*]-(sub:Employee)

WHERE

sub.firstName = ‘Robert’

RETURN

p

Page 37: Introduction: Relational to Graphs

Who is in Robert’s (direct, upwards) reporting chain?

Page 38: Introduction: Relational to Graphs

Who’s the Big Boss?

MATCH

p=(e:Employee)

WHERE

NOT (e)<-[:REPORTS_TO]->()

RETURN

e.firstName as bigBoss

Page 39: Introduction: Relational to Graphs

Who’s the Big Boss?

Page 40: Introduction: Relational to Graphs

Product Cross-Sell

MATCH

(choc:Product {productName: 'Chocolade'})

<-[:PRODUCT]-(:Order)<-[:SOLD]-(employee),

(employee)-[:SOLD]->(o2)-[:PRODUCT]->(other:Product)

RETURN

employee.firstName, other.productName, count(distinct o2) as count

ORDER BY

count DESC

LIMIT 5;

Page 41: Introduction: Relational to Graphs

Product Cross-Sell

Page 42: Introduction: Relational to Graphs

High Performance

Page 43: Introduction: Relational to Graphs

Neo4j Clustering Architecture Optimized for Speed & Availability at Scale

43

Performance Benefits

• No network hops within queries

• Real-time operations with fast and consistent response times

• Cache sharding spreads cache across cluster for very large graphs

Clustering Features• Master-slave replication with

master re-election and failover• Each instance has its own local cache• Horizontal scaling & disaster recovery

Load Balancer

Neo4jNeo4jNeo4j

Page 44: Introduction: Relational to Graphs

Getting Data into Neo4j

Cypher-Based “LOAD CSV” Capability• Transactional (ACID) writes• Initial and incremental loads of up to

10 million nodes and relationships

Command-Line Bulk Loader neo4j-import• For initial database population• For loads with 10B+ records• Up to 1M records per second

4.58 million thingsand their relationships…

Loads in 100 seconds!

Page 45: Introduction: Relational to Graphs

MIGRATE ALL DATA

MIGRATE GRAPH DATA

DUPLICATE GRAPH DATA

Non-graph data Graph data

Graph dataAll data

All data

RelationalDatabase

GraphDatabase

Application

Application

Application

Three Ways to Load Data into Neo4j

Page 46: Introduction: Relational to Graphs

Polyglot Persistence

Page 47: Introduction: Relational to Graphs

Data Storage andBusiness Rules Execution

Data Mining and Aggregation

Neo4j Fits into Your Enterprise Environment

Application

Graph Database Cluster

Neo4j Neo4j Neo4j

Ad HocAnalysis

Bulk AnalyticInfrastructure

Graph Compute EngineEDW …

Data Scientist

End User

Databases

RelationalNoSQL

Hadoop

Page 48: Introduction: Relational to Graphs

Polyglot Persistence

Page 49: Introduction: Relational to Graphs

Users Love Neo4j

Page 50: Introduction: Relational to Graphs

Users Love Neo4j

Page 51: Introduction: Relational to Graphs

Learn the Way of the GraphQuickly and Easily

Page 52: Introduction: Relational to Graphs

Quick Start: Plan Your Project

1

2

3

4

5

6

7

8

Learn Neo4j

Decide on Architecture

Import and Model Data

Build Application

Test Application

Deploy your appin as little as 8 weeks

PROFESSIONAL SERVICES PLAN

Page 53: Introduction: Relational to Graphs

There Are Lots of Ways to Easily Learn Neo4j

Page 54: Introduction: Relational to Graphs

SummaryOnly Neo4j Unlocks the Value in Your Data Relationships

Data is increasing in volume…• New digital processes• More online transactions• New social networks• More devices

… and is getting more connected

Customers, products, processes, devices interact and relate to each other

Page 55: Introduction: Relational to Graphs

RDBMS to GraphsHarnessing the Power of the Graph

End of Presentation