SlideShare a Scribd company logo
1 of 24
Download to read offline
Introducing VenmoPlus.com
- Explore your Venmo network!
Qingpeng “Q.P.” Zhang, Insight Data Engineering Fellow
Features - VenmoPlus.com
● fuzzy searching of user name, with friend list to help
identify users with same name
● labeling the relationship between the payer and receiver
● friend recommendation
● searching transactions in friend circle
● listing friends of the user
Features - VenmoPlus.com
● fuzzy searching of user name, with friend list to help
identify users with same name
● labeling the relationship between the payer and receiver
● friend recommendation
● searching transactions in friend circle
● listing friends of the user
Demo:
VenmoPlus.com
Challenge:
● Find the distance between nodes in dynamic graph in real time
Solutions
● Two databases
○ Redis and ElasticSearch
● Algorithm design
○ BFS -> Bidirectional Search
○ Query relationship of a past transaction
● Query/search optimizations
Solutions
● Two databases
○ Redis and ElasticSearch
● Algorithm design
○ BFS -> Bidirectional Search
○ Query relationship of a past transaction
● Query/search optimizations
Historical
transactions
Real time
transactions
A Tale of Two Databases
API
Redis for graph structure
420890 Graham Hadley
1630476 Leon Tang
810029 Harminder Toor
1371353 Ephraim Park
562884 Paul Min
420890 set(14935158, 562884)
1630476 set(1371353)
810029 set(190230,14935158)
1371353 set(810029,971156)
562884 set(196371,1371353)
35 million edges
6 million nodes
ElasticSearch for everything
ElasticSearch for everything
Redis
Elasticsearch
Redis + Elasticsearch
=> search transactions in friend circle
Breadth First Search -> Bidirectional Search
Shortest distance -> intersection of sets (friend lists)
● A’s 1st degree friends ∩ B’s 1st degree friends
● A’s 2nd degree friends ∩ B’s 1st degree friends
O(N^2) -> O(2*N)
O(N^3) -> O(N + N^2)
VenmoPlus.com
m4.xlarge
m4.large
m4.xlarge
m4.large
t2.micro
$29.11/day
More optimizations to do
● Only store necessary information in elasticsearch to increase performance
● Labeling the distance of users for historical transaction can be done in
batch job, to reduce the number of the real time queries
● Adjust AWS instances to reduce the cost
Qingpeng “Q.P.” Zhang
● Postdoc, Lawrence Berkeley National Lab
○ GeneLearn - to classify DNA sequences
● PhD in Computer Science, Michigan State
○ Khmer - efficient k-mer counting
○ IGS - feature engineering for comparing samples
● BS in Physics, Nanjing University
What I learned from Insight:
Redis, Elasticsearch, Kafka, Spark Streaming, Flask, AngularJS, etc.
Query relationship of a past transaction
Query relationship of a past transaction
Query distance between vertices in a historic moment in a constantly changing
graph (because we don’t pre-calculate the distance….)
● If there are transactions before that one, distance = 1
● If the transaction is new: distance >1
○ Remove the influence of that specific transaction temporarily
○ Check distance from graph (2, 3, or >3)
Pipeline, raw data, in distributed way
Query/Search Optimizations
1. Remove aggregation for better performance… (trade-off)
2. Friend recommender:
a. Using Counter to get only 5 users with the most common friends
3. Search message in friend circle
a. Combine query of Elasticsearch and Redis

More Related Content

Similar to VenmoPlus

Introducing VenmoPlus.com 6/27 version
Introducing VenmoPlus.com 6/27 versionIntroducing VenmoPlus.com 6/27 version
Introducing VenmoPlus.com 6/27 versionQingpeng "Q.P." Zhang
 
An introduction to similarity search and k-nn graphs
An introduction to similarity search and k-nn graphsAn introduction to similarity search and k-nn graphs
An introduction to similarity search and k-nn graphsThibault Debatty
 
Your Database Cannot Do this (well)
Your Database Cannot Do this (well)Your Database Cannot Do this (well)
Your Database Cannot Do this (well)javier ramirez
 
Summary of SIGIR 2011 Papers
Summary of SIGIR 2011 PapersSummary of SIGIR 2011 Papers
Summary of SIGIR 2011 Paperschetanagavankar
 
HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...
HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...
HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...Araport
 
Reflected intelligence evolving self-learning data systems
Reflected intelligence  evolving self-learning data systemsReflected intelligence  evolving self-learning data systems
Reflected intelligence evolving self-learning data systemsTrey Grainger
 
Deep feature synthesis
Deep feature synthesisDeep feature synthesis
Deep feature synthesisDurra Sahtout
 
FOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter Boncz
FOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter BonczFOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter Boncz
FOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter BonczIoan Toma
 
Follow the money with graphs
Follow the money with graphsFollow the money with graphs
Follow the money with graphsStanka Dalekova
 
finding nobel prize window by PageRank
finding nobel prize window by PageRankfinding nobel prize window by PageRank
finding nobel prize window by PageRankYuji Fujita
 
Sparql querying of-property-graphs-harsh thakkar-graph day 2017 sf
Sparql querying of-property-graphs-harsh thakkar-graph day 2017 sfSparql querying of-property-graphs-harsh thakkar-graph day 2017 sf
Sparql querying of-property-graphs-harsh thakkar-graph day 2017 sfHarsh Thakkar
 
ONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHS
ONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHSONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHS
ONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHSNexgen Technology
 

Similar to VenmoPlus (20)

VenmoPlus demo week6
VenmoPlus demo week6VenmoPlus demo week6
VenmoPlus demo week6
 
0629venmoplus
0629venmoplus0629venmoplus
0629venmoplus
 
Introducing VenmoPlus.com 6/27 version
Introducing VenmoPlus.com 6/27 versionIntroducing VenmoPlus.com 6/27 version
Introducing VenmoPlus.com 6/27 version
 
Qingpeng zhang week5
Qingpeng zhang week5Qingpeng zhang week5
Qingpeng zhang week5
 
Similar Series
Similar SeriesSimilar Series
Similar Series
 
An introduction to similarity search and k-nn graphs
An introduction to similarity search and k-nn graphsAn introduction to similarity search and k-nn graphs
An introduction to similarity search and k-nn graphs
 
Your Database Cannot Do this (well)
Your Database Cannot Do this (well)Your Database Cannot Do this (well)
Your Database Cannot Do this (well)
 
Summary of SIGIR 2011 Papers
Summary of SIGIR 2011 PapersSummary of SIGIR 2011 Papers
Summary of SIGIR 2011 Papers
 
HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...
HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...
HRGRN: enabling graph search and integrative analysis of Arabidopsis signalin...
 
Reflected intelligence evolving self-learning data systems
Reflected intelligence  evolving self-learning data systemsReflected intelligence  evolving self-learning data systems
Reflected intelligence evolving self-learning data systems
 
Dagstuhl 2013 - Montali - On the Relationship between OBDA and Relational Map...
Dagstuhl 2013 - Montali - On the Relationship between OBDA and Relational Map...Dagstuhl 2013 - Montali - On the Relationship between OBDA and Relational Map...
Dagstuhl 2013 - Montali - On the Relationship between OBDA and Relational Map...
 
Deep feature synthesis
Deep feature synthesisDeep feature synthesis
Deep feature synthesis
 
FOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter Boncz
FOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter BonczFOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter Boncz
FOSDEM2014 - Social Network Benchmark (SNB) Graph Generator - Peter Boncz
 
Follow the money with graphs
Follow the money with graphsFollow the money with graphs
Follow the money with graphs
 
04 open source_tools
04 open source_tools04 open source_tools
04 open source_tools
 
Data Science At Zillow
Data Science At ZillowData Science At Zillow
Data Science At Zillow
 
finding nobel prize window by PageRank
finding nobel prize window by PageRankfinding nobel prize window by PageRank
finding nobel prize window by PageRank
 
Sigir 2011 proceedings
Sigir 2011 proceedingsSigir 2011 proceedings
Sigir 2011 proceedings
 
Sparql querying of-property-graphs-harsh thakkar-graph day 2017 sf
Sparql querying of-property-graphs-harsh thakkar-graph day 2017 sfSparql querying of-property-graphs-harsh thakkar-graph day 2017 sf
Sparql querying of-property-graphs-harsh thakkar-graph day 2017 sf
 
ONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHS
ONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHSONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHS
ONLINE SUBGRAPH SKYLINE ANALYSIS OVER KNOWLEDGE GRAPHS
 

Recently uploaded

(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCRsoniya singh
 
What Causes DPF Failure In VW Golf Cars & How Can They Be Prevented
What Causes DPF Failure In VW Golf Cars & How Can They Be PreventedWhat Causes DPF Failure In VW Golf Cars & How Can They Be Prevented
What Causes DPF Failure In VW Golf Cars & How Can They Be PreventedAutobahn Automotive Service
 
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...shivangimorya083
 
GREEN VEHICLES the kids picture show 2024
GREEN VEHICLES the kids picture show 2024GREEN VEHICLES the kids picture show 2024
GREEN VEHICLES the kids picture show 2024AHOhOops1
 
BLUE VEHICLES the kids picture show 2024
BLUE VEHICLES the kids picture show 2024BLUE VEHICLES the kids picture show 2024
BLUE VEHICLES the kids picture show 2024AHOhOops1
 
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptUNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptDineshKumar4165
 
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptxUNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptxDineshKumar4165
 
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kasba 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Roomdivyansh0kumar0
 
办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一mkfnjj
 
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /WhatsappsBeautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsappssapnasaifi408
 
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualJohn Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualExcavator
 
原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证
原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证
原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证jjrehjwj11gg
 
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERUNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERDineshKumar4165
 
Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...
Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...
Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...kexey39068
 
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一fhhkjh
 
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样gfghbihg
 
Not Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These SymptomsNot Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These SymptomsFifth Gear Automotive
 
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls  Size E6 (O525547819) Call Girls In DubaiDubai Call Girls  Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubaikojalkojal131
 
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHot Call Girls In Sector 58 (Noida)
 

Recently uploaded (20)

(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
(8264348440) 🔝 Call Girls In Shaheen Bagh 🔝 Delhi NCR
 
What Causes DPF Failure In VW Golf Cars & How Can They Be Prevented
What Causes DPF Failure In VW Golf Cars & How Can They Be PreventedWhat Causes DPF Failure In VW Golf Cars & How Can They Be Prevented
What Causes DPF Failure In VW Golf Cars & How Can They Be Prevented
 
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...Russian  Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
Russian Call Girls Delhi Indirapuram {9711199171} Aarvi Gupta ✌️Independent ...
 
GREEN VEHICLES the kids picture show 2024
GREEN VEHICLES the kids picture show 2024GREEN VEHICLES the kids picture show 2024
GREEN VEHICLES the kids picture show 2024
 
Hot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Pira Garhi🔝 9953056974 🔝 escort Service
 
BLUE VEHICLES the kids picture show 2024
BLUE VEHICLES the kids picture show 2024BLUE VEHICLES the kids picture show 2024
BLUE VEHICLES the kids picture show 2024
 
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptUNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
 
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptxUNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
UNIT-IV-STEERING, BRAKES AND SUSPENSION SYSTEMS.pptx
 
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kasba 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kasba 👉 8250192130 Available With Room
 
办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一办理埃默里大学毕业证Emory毕业证原版一比一
办理埃默里大学毕业证Emory毕业证原版一比一
 
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /WhatsappsBeautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
 
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualJohn Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
 
原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证
原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证
原版工艺美国普林斯顿大学毕业证Princeton毕业证成绩单修改留信学历认证
 
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERUNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
 
Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...
Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...
Call Girl Service Global Village Dubai +971509430017 Independent Call Girls G...
 
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
定制(Plymouth文凭证书)普利茅斯大学毕业证毕业证成绩单学历认证原版一比一
 
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
(办理学位证)(Toledo毕业证)托莱多大学毕业证成绩单修改留信学历认证原版一模一样
 
Not Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These SymptomsNot Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These Symptoms
 
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls  Size E6 (O525547819) Call Girls In DubaiDubai Call Girls  Size E6 (O525547819) Call Girls In Dubai
Dubai Call Girls Size E6 (O525547819) Call Girls In Dubai
 
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
 

VenmoPlus

  • 1. Introducing VenmoPlus.com - Explore your Venmo network! Qingpeng “Q.P.” Zhang, Insight Data Engineering Fellow
  • 2.
  • 3. Features - VenmoPlus.com ● fuzzy searching of user name, with friend list to help identify users with same name ● labeling the relationship between the payer and receiver ● friend recommendation ● searching transactions in friend circle ● listing friends of the user
  • 4. Features - VenmoPlus.com ● fuzzy searching of user name, with friend list to help identify users with same name ● labeling the relationship between the payer and receiver ● friend recommendation ● searching transactions in friend circle ● listing friends of the user
  • 6. Challenge: ● Find the distance between nodes in dynamic graph in real time
  • 7. Solutions ● Two databases ○ Redis and ElasticSearch ● Algorithm design ○ BFS -> Bidirectional Search ○ Query relationship of a past transaction ● Query/search optimizations
  • 8. Solutions ● Two databases ○ Redis and ElasticSearch ● Algorithm design ○ BFS -> Bidirectional Search ○ Query relationship of a past transaction ● Query/search optimizations
  • 10. Redis for graph structure 420890 Graham Hadley 1630476 Leon Tang 810029 Harminder Toor 1371353 Ephraim Park 562884 Paul Min 420890 set(14935158, 562884) 1630476 set(1371353) 810029 set(190230,14935158) 1371353 set(810029,971156) 562884 set(196371,1371353) 35 million edges 6 million nodes
  • 14. Redis + Elasticsearch => search transactions in friend circle
  • 15. Breadth First Search -> Bidirectional Search Shortest distance -> intersection of sets (friend lists) ● A’s 1st degree friends ∩ B’s 1st degree friends ● A’s 2nd degree friends ∩ B’s 1st degree friends O(N^2) -> O(2*N) O(N^3) -> O(N + N^2)
  • 17. More optimizations to do ● Only store necessary information in elasticsearch to increase performance ● Labeling the distance of users for historical transaction can be done in batch job, to reduce the number of the real time queries ● Adjust AWS instances to reduce the cost
  • 18. Qingpeng “Q.P.” Zhang ● Postdoc, Lawrence Berkeley National Lab ○ GeneLearn - to classify DNA sequences ● PhD in Computer Science, Michigan State ○ Khmer - efficient k-mer counting ○ IGS - feature engineering for comparing samples ● BS in Physics, Nanjing University What I learned from Insight: Redis, Elasticsearch, Kafka, Spark Streaming, Flask, AngularJS, etc.
  • 19. Query relationship of a past transaction
  • 20. Query relationship of a past transaction Query distance between vertices in a historic moment in a constantly changing graph (because we don’t pre-calculate the distance….) ● If there are transactions before that one, distance = 1 ● If the transaction is new: distance >1 ○ Remove the influence of that specific transaction temporarily ○ Check distance from graph (2, 3, or >3)
  • 21.
  • 22.
  • 23. Pipeline, raw data, in distributed way
  • 24. Query/Search Optimizations 1. Remove aggregation for better performance… (trade-off) 2. Friend recommender: a. Using Counter to get only 5 users with the most common friends 3. Search message in friend circle a. Combine query of Elasticsearch and Redis