SlideShare une entreprise Scribd logo
1  sur  68
Processing Large Graphs
www.serendio.com
Content:
• Introduction
• Graph Processing with MapReduce
• Graph Processing with Apache Giraph
• Graph Processing with Neo4j
• Conclusion
3
What is Graph?
V1
V4
V6
V7
V2
V5
V3
The set of objects connected by links.
Why Graphs are
important in Big Data
World?
Application Domains
• Recommendation Systems
• Fraud Detection
• Complex Network Analysis
• Graph based Search
• Network & IT operations
• Master Data Management
• Many More…
Graph Processing
with MapReduce
MapReduce
MapReduce : Word Count
MapReduce : Finding Triangle
Problem: Enumerating 3-cycle sub graph from given
graph
MapReduce : Finding Triangle
• In the first map operation for enumerating triangles, the mapper records
each edge under the vertex with the lowest degree.
• The incoming records’ key doesn’t matter.
MapReduce : Finding Triangle
MapReduce : Finding Triangle
• The second map for enumerating triangles brings together the edge
and open triad records.
• In the process, it rekeys the edge records so that both record types
are binned under the vertices they connect.
• In the second reduce, each bin contains at most one edge record and some
number of triad records (perhaps none).
• For every combination of edge record and triad record in a bin, the reduce
emits a triangle record. The output key isn’t significant.
MapReduce : Finding Triangle
MapReduce : Finding Connected
Components
Problem: Finding Connected Components for given
Graph
3
1 2 5
6
4
MapReduce: Finding Connected
Components
3
1 2 5
6
4
MapReduce: Finding Connected
Components
K V
1 1,2
2 1,2,3,4
3 2,3
4 2,4,5
5 4,5,6
6 5,6
2
1 1 4
5
2
K V
1 1,2,3,4
2 1,2,3,4,5
3 1,2
4 1,2,4,5,6
5 4,5,6
6 4,5
1
1 1 1
1
1
1
1 1 2
4
1
K V
1 1,2,3,4,5,6
2 1
3 1
4 1,5,6
5 1,4
6 1,4
K V
1 1,2,3,4,5,6
2 1
3 1
4 1
5 1
6 1
MapReduce: Finding Connected
Components
Why not MapReduce for graph?
Problem with MapReduce Graph Algorithm
• Iterative MR-Jobs
• High I/O
• Not intuitive for Graph Algorithm
The Graph based Technologies in
BigData/Nosql domain
Database Storage & Traversal
Neo4j
TitanDB
OrientDB
Computation Engines
Apache Giraph
GraphLab
Apache Spark Graph ML/Graphx
MapReduce
Hive
Spark
Pig
Cassandra
MySql
Hbase
Giraph
Graphx
GraphLab
Neo4j
OrientDB
Analytics
Database
Tuples Graphs
Data management tools with respect to
Graph
Graph Processing Engine
with Apache Giraph
Apache Giraph
Graph Processing System
• In-memory Computation
• Inspired by Google Pregel
• Vertex-Centic High-level programming model
• Batch oriented processing
• Based on Valient's Bulk Synchronization Parallel
Model
Bulk Synchronization Parallel Model
• Each vertex has
• Vertex-Identifier
• Variable
• Each directed edge has
• Source Vertex identifier
• Target Vertex identifier
• Variable
• Computation consists of,
• Input
• Supersteps separated by global synchronization points
• Algorithm termination
• Output
• Each vertex compute in parallel with same user defined
function.
Apache Giraph Model
Supersteps
• Algorithm Termination:
• Each vertex is in inactive state
• No messages are generated for next superstep
Vertex State Transition
Architecture of Giraph on Hadoop Stack
Problem: Find Maximum Number
Problem: Simple Shortest Path
0
3
21
43
1
1
2
4
4
Source
public void compute(vertex, messages) {
if (Superstep = 0):
vertex.setValue(new DoubleWritable(Double.MAX_VALUE));
double minDist = isSource(vertex) ? 0d : Double.MAX_VALUE;
for (message : messages):
minDist = Math.min(minDist, message);
if (minDist < vertex.getValue())
vertex.setValue(minDist);
for (Edge edge : vertex.getEdges()):
distance = minDist + edge.getValue();
sendMessage(edge.getTargetVertexId(), distance);
vertex.voteToHalt();
}
Problem: Simple Shortest Path
0
3
21
43
1
1
2
4
4
Problem: Simple Shortest Path
Graph Database
with Neo4j
Introduction to Nosql
Nosql = Not Only SQL
Graph Databases
• A database which follows graph structure
• Each node knows its adjacent nodes
• As the number of nodes increases, the cost of local
step remains the same
• Index for lookups
• Optimized for traversing connected data
Graph Databases: Model
Key1 : Value 1
Key2 : Value 2
Key1 : Value 1
Key2 : Value 2
Key1 : Value 1
Key2 : Value 2
Key1 : Value 1
Key2 : Value 2
Key1 : Value 1
Key2 : Value 2
http://db-engines.com
Introduction to Nosql
Neo4j
• Graph database from Neo Technology
• A schema-free labeled Property Graph Database +
Lucene Index
• Perfect for complex, highly connected data
• Reliable with real ACID Transactions
• Scalable: Billions of Nodes and Relationships, Scale
out with highly available Neo4j Cluster
• Server with REST API or Embeddable
• Declarative Query Language (Cypher)
Neo4j: Strengths & Weakness
Strengths
• Powerful data model
• Whiteboard friendly
• Fast for connected data
• Easy to query
Weakness
• Requires Conceptual Shift (Graph like thinking)
Four Building Blocks
• Nodes
• Relationships
• Properties
• Labels
(:USER)
[:RELATIVE
] (:PET)
Name: Mike
Animal: Dog
Name: Apple
Age: 25
Relation: Owner
40Serendio Proprietary and Confidential
SQL to Graph DB: Data Model
Transformation
SQL Graph DB
Table Type of Node(Labels)
Rows of Table Nodes
Columns of Table Node-Properties
Foreign-key, Joins Relationships
SQL to Graph DB: Data Model
Transformation
Name Movies
Language
Rajnikant Tamil
Maheshbabu Telugu
Vijay Tamil
Prabhas Telugu
Name Lead Actor
Bahubali Prabhas
Puli Vijay
Shrimanthu
du
Maheshbabu
Robot Rajnikant
Table: Actor
Table: Movie
ACTOR
MOVIE
ACTOR
MOVIE
Name Prabhas
Movie
Language
Telugu
Name Rajnikant
Movie
Language
Tamil
Name Bahubali
Name Robot
LEAD_ACTOR
LEAD_ACTOR
How to query Graph Database?
• Graph Query Language
– Cypher
– Gremlin
How to query Graph Database?
• Graph Query Language
– Cypher
– Gremlin
Cypher Query Language
• Declarative
• SQL-inspired
• Pattern based
Ramesh Suresh
FRIEND
(Ramesh:PERSON) - [connect:FRIEND] -> (Orange:PERSON)
Cypher: Getting Started
Structure:
• Similar to SQL
• Most common clauses:
– MATCH: the graph pattern for matching
– WHERE: add constrains or filter
– RETURN: what to return
CRUD Operations
MATCH:
• MATCH (n) RETURN n
• MATCH (movie:Movie) RETURN movie
• MATCH (movie:Movie { title: 'Bahubali' }) RETURN movie
• MATCH (director { name:'Rajamouli' })--(movie) RETURN movie.title
• MATCH (raj:Person { name:'Rajamouli'})--(movie:Movie) RETURN movie
• MATCH (raj:Person { name:'Rajamouli'})-->(movie:Movie) RETURN movie
• MATCH (raj:Person { name:'Rajamouli'})<--(movie:Movie) RETURN movie
• MATCH (raj:Person { name:'Rajamouli'})-[:DIRECTED]->(movie:Movie) RETURN
movie
CRUD Operations
WHERE:
• MATCH (n)
WHERE n:Movie
RETURN n
• MATCH (n)
WHERE n.name <> 'Prabhas'
RETURN n
CRUD Operations
Let clean the database:
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r
CRUD Operations
CREATE:
Node:
• CREATE (n)
• CREATE (n),(m)
• CREATE (n:Person)
• CREATE (n:Person:Swedish)
• CREATE (n:Person { name : 'Andres', title : 'Developer' })
• CREATE (a:Person { name : 'Roman' }) RETURN a
CRUD Operations
CREATE:
Relationships:
• MATCH (a:Person),(b:Person)
WHERE a.name = 'Roman' AND b.name = 'Andres'
CREATE (a)-[r:RELTYPE]->(b)
RETURN r
• MATCH (a:Person),(b:Person)
WHERE a.name = 'Roman' AND b.name = 'Andres'
CREATE (a)-[r:RELTYPE { name : a.name + '<->' + b.name }]->(b)
RETURN r
CRUD Operations
CREATE:
Relationships:
• CREATE p =(andres { name:'Andres'}) - [:WORKS_AT] -> (neo)
<- [:WORKS_AT] - (michael { name:'Michael' })
RETURN p
CRUD Operations
UPDATE:
Properties:
• MATCH (n:Person { name : 'Andres' }) SET n :Person:Coder
• MATCH (n:Person { name : 'Andres', title : 'Developer' }) SET
n.title = 'Mang'
CRUD Operations
DELETE:
• MATCH (n:Person)
WHERE n.name = 'Andres'
DELETE n
• MATCH (n { name: 'Andres' })-[r]-()
DELETE n, r
• MATCH (n:Person)
DELETE n
• MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r
Functions
Predicates:
• ALL(identifier in collection WHERE predicate)
• ANY(identifier in collection WHERE predicate)
• NONE(identifier in collection WHERE predicate)
• SINGLE(identifier in collection WHERE predicate)
• EXISTS( pattern-or-property )
Scalar Function:
• LENGTH( collection/pattern expression )
• TYPE( relationship )
• ID( property-container )
• COALESCE( expression [, expression]* )
• HEAD( expression )
• LAST( expression )
• TIMESTAMP()
Functions
Collection Function:
• NODES( path )
• RELATIONSHIPS( path )
• LABELS( node )
• FILTER(identifier in collection WHERE predicate)
• REDUCE( accumulator = initial, identifier in collection | expression )
Mathematical Function:
• ABS( expression )
• COS( expression )
• LOG( expression )
• ROUND( expression )
• SQRT( expression )
Use Case: Movie Recommendation*
Problem:
• We are running IMDB type website.
• We have dataset which contains movie rating done by users.
• Our problem is to generate list of movies which will be
recommended to individual users.
*http://neo4j.com/graphgist/a7c915c8-a3d6-43b9-8127-1836fecc6e2f
Use Case: Movie Recommendation
Use Case: Movie Recommendation
Solution:
• We will find the people who has given similar rating to the
movies watch by both of them.
• After that we will recommend movies which one has not seen
and other has rated high.
• Cosine Similarity function to calculate similarity between
users.
• k-Nearest Neighbors for finding similar users
Use Case: Movie Recommendation
• Cosine Similarity:
• K-NN:
Use Case: Movie Recommendation
Query:Add Cosine Similarity
MATCH (p1:Person)-[x:RATED]->(m:Movie)<-[y:RATED]-(p2:Person)
WITH SUM(x.rating * y.rating) AS xyDotProduct,
SQRT(REDUCE(xDot = 0.0, a IN COLLECT(x.rating) | xDot + a^2)) AS
xLength,
SQRT(REDUCE(yDot = 0.0, b IN COLLECT(y.rating) | yDot + b^2)) AS
yLength,
p1, p2
MERGE (p1)-[s:SIMILARITY]-(p2)
SET s.similarity = xyDotProduct / (xLength * yLength)
Use Case: Movie Recommendation
Use Case: Movie Recommendation
Query: See who is your neighbor in
similarity
MATCH (p1:Person {name:'Michael Sherman'})-[s:SIMILARITY]-(p2:Person)
WITH p2, s.similarity AS sim
ORDER BY sim DESC
LIMIT 5
RETURN p2.name AS Neighbor, sim AS Similarity
Use Case: Movie Recommendation (Conti..)
Query: Recommendation Finally
MATCH (b:Person)-[r:RATED]->(m:Movie), (b)-[s:SIMILARITY]-(a:Person
{name:'Michael Sherman'})
WHERE NOT((a)-[:RATED]->(m))
WITH m, s.similarity AS similarity, r.rating AS rating ORDER BY m.name,
similarity DESC
WITH m.name AS movie, COLLECT(rating)[0..3] AS ratings
WITH movie, REDUCE(s = 0, i IN ratings | s + i)*1.0 / LENGTH(ratings) AS reco
ORDER BY reco DESC
RETURN movie AS Movie, reco AS Recommendation
Why Real-time Recommendation Engine
Important?
• Example of E-Commerce
Neo4j with Other technologies
• Data Import
– LOAD CSV
– Neo4j-import
• Graph Visualization
– Alistair Jones (Arrow)
– Alchemy.js (GraphJSON)
– Neo4j Browser
– Linkurious
– Keylines
– D3.js
Neo4j in Action
• Neo4j + Linkurious for Panama leaks
Conclusion
• The graph is important data model to represent lot of real
world scenarios as connected object provide more
information that isolated objects.
• The de-facto big data technologies are inefficient for solving
large scale graph problems.
• The technologies, designed to solve large scale graph
problems in real time as well as offline are available.
• These graph technologies are matured enough to use in
production.
nishant@serendio.com
Serendio provides Big Data Science Solutions &
Services for Data-Driven Enterprises.
Learn more at:
serendio.com/index.php/case-studies
Thank You!

Contenu connexe

Tendances

Tendances (20)

Big Data MDX with Mondrian and Apache Kylin
Big Data MDX with Mondrian and Apache KylinBig Data MDX with Mondrian and Apache Kylin
Big Data MDX with Mondrian and Apache Kylin
 
Cypher
CypherCypher
Cypher
 
Apache kylin - Big Data Technology Conference 2014 Beijing
Apache kylin - Big Data Technology Conference 2014 BeijingApache kylin - Big Data Technology Conference 2014 Beijing
Apache kylin - Big Data Technology Conference 2014 Beijing
 
Hands on Training – Graph Database with Neo4j
Hands on Training – Graph Database with Neo4jHands on Training – Graph Database with Neo4j
Hands on Training – Graph Database with Neo4j
 
Apache Kylin - Balance between space and time - Hadoop Summit 2015
Apache Kylin -  Balance between space and time - Hadoop Summit 2015Apache Kylin -  Balance between space and time - Hadoop Summit 2015
Apache Kylin - Balance between space and time - Hadoop Summit 2015
 
Apache Kylin Introduction
Apache Kylin IntroductionApache Kylin Introduction
Apache Kylin Introduction
 
Apache Kylin: Hadoop OLAP Engine, 2014 Dec
Apache Kylin: Hadoop OLAP Engine, 2014 DecApache Kylin: Hadoop OLAP Engine, 2014 Dec
Apache Kylin: Hadoop OLAP Engine, 2014 Dec
 
Apache Kylin Streaming
Apache Kylin Streaming Apache Kylin Streaming
Apache Kylin Streaming
 
Scio
ScioScio
Scio
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™
 
Apache Kylin’s Performance Boost from Apache HBase
Apache Kylin’s Performance Boost from Apache HBaseApache Kylin’s Performance Boost from Apache HBase
Apache Kylin’s Performance Boost from Apache HBase
 
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui MengChallenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
 
Apache kylin (china hadoop summit 2015 shanghai)
Apache kylin (china hadoop summit 2015 shanghai)Apache kylin (china hadoop summit 2015 shanghai)
Apache kylin (china hadoop summit 2015 shanghai)
 
Apache Kylin – Cubes on Hadoop
Apache Kylin – Cubes on HadoopApache Kylin – Cubes on Hadoop
Apache Kylin – Cubes on Hadoop
 
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink Forward 2015
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink Forward 2015Gradoop: Scalable Graph Analytics with Apache Flink @ Flink Forward 2015
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink Forward 2015
 
Design cube in Apache Kylin
Design cube in Apache KylinDesign cube in Apache Kylin
Design cube in Apache Kylin
 
1. Apache Kylin Deep Dive - Streaming and Plugin Architecture - Apache Kylin ...
1. Apache Kylin Deep Dive - Streaming and Plugin Architecture - Apache Kylin ...1. Apache Kylin Deep Dive - Streaming and Plugin Architecture - Apache Kylin ...
1. Apache Kylin Deep Dive - Streaming and Plugin Architecture - Apache Kylin ...
 
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
 
Apache Kylin 1.5 Updates
Apache Kylin 1.5 UpdatesApache Kylin 1.5 Updates
Apache Kylin 1.5 Updates
 
Kylin olap part 1- getting started
Kylin olap   part 1- getting startedKylin olap   part 1- getting started
Kylin olap part 1- getting started
 

Similaire à Processing Large Graphs

MathWorks Interview Lecture
MathWorks Interview LectureMathWorks Interview Lecture
MathWorks Interview Lecture
John Yates
 

Similaire à Processing Large Graphs (20)

AgensGraph Presentation at PGConf.us 2017
AgensGraph Presentation at PGConf.us 2017AgensGraph Presentation at PGConf.us 2017
AgensGraph Presentation at PGConf.us 2017
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
 
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
Thorny Path to the Large Scale Graph Processing, Алексей Зиновьев (Тамтэк)
 
Introduction to Neo4j and .Net
Introduction to Neo4j and .NetIntroduction to Neo4j and .Net
Introduction to Neo4j and .Net
 
(DAT203) Building Graph Databases on AWS
(DAT203) Building Graph Databases on AWS(DAT203) Building Graph Databases on AWS
(DAT203) Building Graph Databases on AWS
 
Trending with Purpose
Trending with PurposeTrending with Purpose
Trending with Purpose
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
A Workshop on R
A Workshop on RA Workshop on R
A Workshop on R
 
MathWorks Interview Lecture
MathWorks Interview LectureMathWorks Interview Lecture
MathWorks Interview Lecture
 
managing big data
managing big datamanaging big data
managing big data
 
Intro to Cypher
Intro to CypherIntro to Cypher
Intro to Cypher
 
Data Science At Zillow
Data Science At ZillowData Science At Zillow
Data Science At Zillow
 
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014:  Social Network Benchmark (SNB) Graph GeneratorFOSDEM 2014:  Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databases
 
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
 
Python Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB WorkshopPython Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB Workshop
 
GraphTour - Closing Keynote
GraphTour - Closing KeynoteGraphTour - Closing Keynote
GraphTour - Closing Keynote
 
Web analytics at scale with Druid at naver.com
Web analytics at scale with Druid at naver.comWeb analytics at scale with Druid at naver.com
Web analytics at scale with Druid at naver.com
 
Neo4j tms
Neo4j tmsNeo4j tms
Neo4j tms
 

Plus de Nishant Gandhi (8)

Customer Feedback Analytics for Starbucks
Customer Feedback Analytics for Starbucks Customer Feedback Analytics for Starbucks
Customer Feedback Analytics for Starbucks
 
Guest Lecture: Introduction to Big Data at Indian Institute of Technology
Guest Lecture: Introduction to Big Data at Indian Institute of TechnologyGuest Lecture: Introduction to Big Data at Indian Institute of Technology
Guest Lecture: Introduction to Big Data at Indian Institute of Technology
 
Graph Coloring Algorithms on Pregel Model using Hadoop
Graph Coloring Algorithms on Pregel Model using HadoopGraph Coloring Algorithms on Pregel Model using Hadoop
Graph Coloring Algorithms on Pregel Model using Hadoop
 
Neo4j vs giraph
Neo4j vs giraphNeo4j vs giraph
Neo4j vs giraph
 
Map reduce programming model to solve graph problems
Map reduce programming model to solve graph problemsMap reduce programming model to solve graph problems
Map reduce programming model to solve graph problems
 
Packet tracer practical guide
Packet tracer practical guidePacket tracer practical guide
Packet tracer practical guide
 
Hadoop Report
Hadoop ReportHadoop Report
Hadoop Report
 
Hadoop
HadoopHadoop
Hadoop
 

Dernier

➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
gajnagarg
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
amitlee9823
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 

Dernier (20)

➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 

Processing Large Graphs

  • 2. Content: • Introduction • Graph Processing with MapReduce • Graph Processing with Apache Giraph • Graph Processing with Neo4j • Conclusion
  • 3. 3 What is Graph? V1 V4 V6 V7 V2 V5 V3 The set of objects connected by links.
  • 4. Why Graphs are important in Big Data World?
  • 5. Application Domains • Recommendation Systems • Fraud Detection • Complex Network Analysis • Graph based Search • Network & IT operations • Master Data Management • Many More…
  • 9. MapReduce : Finding Triangle Problem: Enumerating 3-cycle sub graph from given graph
  • 10. MapReduce : Finding Triangle • In the first map operation for enumerating triangles, the mapper records each edge under the vertex with the lowest degree. • The incoming records’ key doesn’t matter.
  • 12. MapReduce : Finding Triangle • The second map for enumerating triangles brings together the edge and open triad records. • In the process, it rekeys the edge records so that both record types are binned under the vertices they connect.
  • 13. • In the second reduce, each bin contains at most one edge record and some number of triad records (perhaps none). • For every combination of edge record and triad record in a bin, the reduce emits a triangle record. The output key isn’t significant. MapReduce : Finding Triangle
  • 14. MapReduce : Finding Connected Components Problem: Finding Connected Components for given Graph 3 1 2 5 6 4
  • 16. 3 1 2 5 6 4 MapReduce: Finding Connected Components K V 1 1,2 2 1,2,3,4 3 2,3 4 2,4,5 5 4,5,6 6 5,6 2 1 1 4 5 2 K V 1 1,2,3,4 2 1,2,3,4,5 3 1,2 4 1,2,4,5,6 5 4,5,6 6 4,5
  • 17. 1 1 1 1 1 1 1 1 1 2 4 1 K V 1 1,2,3,4,5,6 2 1 3 1 4 1,5,6 5 1,4 6 1,4 K V 1 1,2,3,4,5,6 2 1 3 1 4 1 5 1 6 1 MapReduce: Finding Connected Components
  • 18. Why not MapReduce for graph? Problem with MapReduce Graph Algorithm • Iterative MR-Jobs • High I/O • Not intuitive for Graph Algorithm
  • 19. The Graph based Technologies in BigData/Nosql domain Database Storage & Traversal Neo4j TitanDB OrientDB Computation Engines Apache Giraph GraphLab Apache Spark Graph ML/Graphx
  • 22. Apache Giraph Graph Processing System • In-memory Computation • Inspired by Google Pregel • Vertex-Centic High-level programming model • Batch oriented processing • Based on Valient's Bulk Synchronization Parallel Model
  • 24. • Each vertex has • Vertex-Identifier • Variable • Each directed edge has • Source Vertex identifier • Target Vertex identifier • Variable • Computation consists of, • Input • Supersteps separated by global synchronization points • Algorithm termination • Output • Each vertex compute in parallel with same user defined function. Apache Giraph Model
  • 26. • Algorithm Termination: • Each vertex is in inactive state • No messages are generated for next superstep Vertex State Transition
  • 27. Architecture of Giraph on Hadoop Stack
  • 29. Problem: Simple Shortest Path 0 3 21 43 1 1 2 4 4 Source
  • 30. public void compute(vertex, messages) { if (Superstep = 0): vertex.setValue(new DoubleWritable(Double.MAX_VALUE)); double minDist = isSource(vertex) ? 0d : Double.MAX_VALUE; for (message : messages): minDist = Math.min(minDist, message); if (minDist < vertex.getValue()) vertex.setValue(minDist); for (Edge edge : vertex.getEdges()): distance = minDist + edge.getValue(); sendMessage(edge.getTargetVertexId(), distance); vertex.voteToHalt(); } Problem: Simple Shortest Path
  • 33. Introduction to Nosql Nosql = Not Only SQL
  • 34. Graph Databases • A database which follows graph structure • Each node knows its adjacent nodes • As the number of nodes increases, the cost of local step remains the same • Index for lookups • Optimized for traversing connected data
  • 35. Graph Databases: Model Key1 : Value 1 Key2 : Value 2 Key1 : Value 1 Key2 : Value 2 Key1 : Value 1 Key2 : Value 2 Key1 : Value 1 Key2 : Value 2 Key1 : Value 1 Key2 : Value 2
  • 37. Neo4j • Graph database from Neo Technology • A schema-free labeled Property Graph Database + Lucene Index • Perfect for complex, highly connected data • Reliable with real ACID Transactions • Scalable: Billions of Nodes and Relationships, Scale out with highly available Neo4j Cluster • Server with REST API or Embeddable • Declarative Query Language (Cypher)
  • 38. Neo4j: Strengths & Weakness Strengths • Powerful data model • Whiteboard friendly • Fast for connected data • Easy to query Weakness • Requires Conceptual Shift (Graph like thinking)
  • 39. Four Building Blocks • Nodes • Relationships • Properties • Labels (:USER) [:RELATIVE ] (:PET) Name: Mike Animal: Dog Name: Apple Age: 25 Relation: Owner
  • 40. 40Serendio Proprietary and Confidential SQL to Graph DB: Data Model Transformation SQL Graph DB Table Type of Node(Labels) Rows of Table Nodes Columns of Table Node-Properties Foreign-key, Joins Relationships
  • 41. SQL to Graph DB: Data Model Transformation Name Movies Language Rajnikant Tamil Maheshbabu Telugu Vijay Tamil Prabhas Telugu Name Lead Actor Bahubali Prabhas Puli Vijay Shrimanthu du Maheshbabu Robot Rajnikant Table: Actor Table: Movie ACTOR MOVIE ACTOR MOVIE Name Prabhas Movie Language Telugu Name Rajnikant Movie Language Tamil Name Bahubali Name Robot LEAD_ACTOR LEAD_ACTOR
  • 42. How to query Graph Database? • Graph Query Language – Cypher – Gremlin
  • 43. How to query Graph Database? • Graph Query Language – Cypher – Gremlin
  • 44. Cypher Query Language • Declarative • SQL-inspired • Pattern based Ramesh Suresh FRIEND (Ramesh:PERSON) - [connect:FRIEND] -> (Orange:PERSON)
  • 45. Cypher: Getting Started Structure: • Similar to SQL • Most common clauses: – MATCH: the graph pattern for matching – WHERE: add constrains or filter – RETURN: what to return
  • 46. CRUD Operations MATCH: • MATCH (n) RETURN n • MATCH (movie:Movie) RETURN movie • MATCH (movie:Movie { title: 'Bahubali' }) RETURN movie • MATCH (director { name:'Rajamouli' })--(movie) RETURN movie.title • MATCH (raj:Person { name:'Rajamouli'})--(movie:Movie) RETURN movie • MATCH (raj:Person { name:'Rajamouli'})-->(movie:Movie) RETURN movie • MATCH (raj:Person { name:'Rajamouli'})<--(movie:Movie) RETURN movie • MATCH (raj:Person { name:'Rajamouli'})-[:DIRECTED]->(movie:Movie) RETURN movie
  • 47. CRUD Operations WHERE: • MATCH (n) WHERE n:Movie RETURN n • MATCH (n) WHERE n.name <> 'Prabhas' RETURN n
  • 48. CRUD Operations Let clean the database: MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r
  • 49. CRUD Operations CREATE: Node: • CREATE (n) • CREATE (n),(m) • CREATE (n:Person) • CREATE (n:Person:Swedish) • CREATE (n:Person { name : 'Andres', title : 'Developer' }) • CREATE (a:Person { name : 'Roman' }) RETURN a
  • 50. CRUD Operations CREATE: Relationships: • MATCH (a:Person),(b:Person) WHERE a.name = 'Roman' AND b.name = 'Andres' CREATE (a)-[r:RELTYPE]->(b) RETURN r • MATCH (a:Person),(b:Person) WHERE a.name = 'Roman' AND b.name = 'Andres' CREATE (a)-[r:RELTYPE { name : a.name + '<->' + b.name }]->(b) RETURN r
  • 51. CRUD Operations CREATE: Relationships: • CREATE p =(andres { name:'Andres'}) - [:WORKS_AT] -> (neo) <- [:WORKS_AT] - (michael { name:'Michael' }) RETURN p
  • 52. CRUD Operations UPDATE: Properties: • MATCH (n:Person { name : 'Andres' }) SET n :Person:Coder • MATCH (n:Person { name : 'Andres', title : 'Developer' }) SET n.title = 'Mang'
  • 53. CRUD Operations DELETE: • MATCH (n:Person) WHERE n.name = 'Andres' DELETE n • MATCH (n { name: 'Andres' })-[r]-() DELETE n, r • MATCH (n:Person) DELETE n • MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r
  • 54. Functions Predicates: • ALL(identifier in collection WHERE predicate) • ANY(identifier in collection WHERE predicate) • NONE(identifier in collection WHERE predicate) • SINGLE(identifier in collection WHERE predicate) • EXISTS( pattern-or-property ) Scalar Function: • LENGTH( collection/pattern expression ) • TYPE( relationship ) • ID( property-container ) • COALESCE( expression [, expression]* ) • HEAD( expression ) • LAST( expression ) • TIMESTAMP()
  • 55. Functions Collection Function: • NODES( path ) • RELATIONSHIPS( path ) • LABELS( node ) • FILTER(identifier in collection WHERE predicate) • REDUCE( accumulator = initial, identifier in collection | expression ) Mathematical Function: • ABS( expression ) • COS( expression ) • LOG( expression ) • ROUND( expression ) • SQRT( expression )
  • 56. Use Case: Movie Recommendation* Problem: • We are running IMDB type website. • We have dataset which contains movie rating done by users. • Our problem is to generate list of movies which will be recommended to individual users. *http://neo4j.com/graphgist/a7c915c8-a3d6-43b9-8127-1836fecc6e2f
  • 57. Use Case: Movie Recommendation
  • 58. Use Case: Movie Recommendation Solution: • We will find the people who has given similar rating to the movies watch by both of them. • After that we will recommend movies which one has not seen and other has rated high. • Cosine Similarity function to calculate similarity between users. • k-Nearest Neighbors for finding similar users
  • 59. Use Case: Movie Recommendation • Cosine Similarity: • K-NN:
  • 60. Use Case: Movie Recommendation Query:Add Cosine Similarity MATCH (p1:Person)-[x:RATED]->(m:Movie)<-[y:RATED]-(p2:Person) WITH SUM(x.rating * y.rating) AS xyDotProduct, SQRT(REDUCE(xDot = 0.0, a IN COLLECT(x.rating) | xDot + a^2)) AS xLength, SQRT(REDUCE(yDot = 0.0, b IN COLLECT(y.rating) | yDot + b^2)) AS yLength, p1, p2 MERGE (p1)-[s:SIMILARITY]-(p2) SET s.similarity = xyDotProduct / (xLength * yLength)
  • 61. Use Case: Movie Recommendation
  • 62. Use Case: Movie Recommendation Query: See who is your neighbor in similarity MATCH (p1:Person {name:'Michael Sherman'})-[s:SIMILARITY]-(p2:Person) WITH p2, s.similarity AS sim ORDER BY sim DESC LIMIT 5 RETURN p2.name AS Neighbor, sim AS Similarity
  • 63. Use Case: Movie Recommendation (Conti..) Query: Recommendation Finally MATCH (b:Person)-[r:RATED]->(m:Movie), (b)-[s:SIMILARITY]-(a:Person {name:'Michael Sherman'}) WHERE NOT((a)-[:RATED]->(m)) WITH m, s.similarity AS similarity, r.rating AS rating ORDER BY m.name, similarity DESC WITH m.name AS movie, COLLECT(rating)[0..3] AS ratings WITH movie, REDUCE(s = 0, i IN ratings | s + i)*1.0 / LENGTH(ratings) AS reco ORDER BY reco DESC RETURN movie AS Movie, reco AS Recommendation
  • 64. Why Real-time Recommendation Engine Important? • Example of E-Commerce
  • 65. Neo4j with Other technologies • Data Import – LOAD CSV – Neo4j-import • Graph Visualization – Alistair Jones (Arrow) – Alchemy.js (GraphJSON) – Neo4j Browser – Linkurious – Keylines – D3.js
  • 66. Neo4j in Action • Neo4j + Linkurious for Panama leaks
  • 67. Conclusion • The graph is important data model to represent lot of real world scenarios as connected object provide more information that isolated objects. • The de-facto big data technologies are inefficient for solving large scale graph problems. • The technologies, designed to solve large scale graph problems in real time as well as offline are available. • These graph technologies are matured enough to use in production.
  • 68. nishant@serendio.com Serendio provides Big Data Science Solutions & Services for Data-Driven Enterprises. Learn more at: serendio.com/index.php/case-studies Thank You!