SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
1 What Is Gravty?
2 The Internals of Gravty
3 Fine-Tuning Gravty
4 Future Plans
1 What Is Gravty?
2 The Internals of Gravty
3 Fine-Tuning Gravty
4 Future Plans
A Graph Database Is
“A graph database is a database that uses
graph structures for semantic queries with nodes,
edges and properties to represent and store data.” (Wikipedia)
Stores objects (vertices)
and relationships (edges)
Provides graph search
capabilities
Vertices and Edges in a Graph Database
Friends
Friends
Likes
Use Cases of a Graph Database
Facebook
Social Graph
Social networks
Google
PageRank
Ranking websites
Walmart
and eBay
Product recommendation
Need for a Large Graph Database System
Social GraphLINE Timeline
LINE Talk
Ranking
Recommendation
LINE Friends Shop
LINE News
Gravty
Need for a Large Graph Database System
Social GraphLINE Timeline
LINE Talk
Ranking
Recommendation
LINE Friends Shop
LINE News
Gravty
7 billion vertices
100 billion edges
200 billion indexes
5 billion writes a day
(create / update / delete)
Gravty Is
A scalable graph database to search
relational information efficiently
by searching through a large pool of data
using the graph search technique.
Requirements for Gravty
Easy to scale out
• To support
ever-increasing data
Easy to develop
• Add, modify, and remove
features as necessary
• Tailored to the LINE
development environment
• Not dependent on LINE-
specific components
Full control over everything!
Easy to use
• Graph query language
• REST API
1 What Is Gravty?
2 The Internals of Gravty
3 Fine-Tuning Gravty
4 Future Plans
Technology Stack and Architecture
Data Model
Technology Stack and Architecture
Application
TinkerPop3 Gremlin-Console
TinkerPop3 Graph API
Graph Processing Layer
Storage Layer
MySQL
(config, meta)
HBaseKafka
Gravty
MySQL
(config, meta)
Kafka
Application
TinkerPop3 Gremlin-Console
TinkerPop 3.2.0 Graph API
Graph Processing Layer (OLTP only)
HBase
Storage Layer
Gravty
HBase 1.1.x Local MemoryKafka 0.10.0.0 Phoenix 4.8.0
Application
TinkerPop3 Gremlin-Console
TinkerPop3 Graph API
Gravty
Storage Layer (Abstract Interface)
Phoenix Repository
(Default)
Memory Repository
(Standalone)
Graph Processing Layer
• Row key: vertex-id
• Edges are stored in columns
• Disadvantages
Data Model
Flat-Wide Table
Column scan is slow
Columns cannot be split
Row Column
vertex-id1 property property edge edge edge edge edge edge
vertex-id2 …
vertex-id3 …
• Row key: edge-id
Data Model
Tall-Narrow Table (Gravty)
SrcVertexId-Label-TgtVertexId
Row Column
svtxid1-label-tvtxid2
edge
property
edge
property
svtxid1-label-tvtxid3 …
…
• Edges are stored in rows
• Advantages
More effective edge scan
Parallel execution
Friends
Flat-Wide vs Tall-Narrow
g.V(“brown”).out(“friends”).id().limit(3)
Brown
Cony
Moon
Sally
[cony, moon, sally]
Flat-Wide vs Tall-Narrow
Flat-Wide Model
Brown edge edge edge edge edge edge
(1) Row scan
2 operations
(2) Column scan
[cony, moon, sally]
‘likes’ ‘friends’
Flat-Wide vs Tall-Narrow
Tall-Narrow Model (Gravty)
brown-friends-sally
(1) Row scan
1 operation
[cony, moon, sally]
brown-friends-moon
brown-friends-cony
• Can split by rows (region)
• Can isolate hotspot rows
• Can scan in parallel
Flat-Wide vs Tall-Narrow
g.V(“brown”).out(“friends”).out(“friends”).
id().limit(10)
4 searches in total
• Flat-Wide = 8 operations
• Tall-Narrow (Gravty) = 4 operations
1 What Is Gravty?
2 The Internals of Gravty
3 Fine-Tuning Gravty
4 Future Plans
Faster, Compact Querying
Avoiding Hot-Spotting
Efficient Secondary Indexing
Faster, Compact Querying
g.V(brown).hasLabel("user").out("friends”).order().by(“name”, Order.incr).limit(5)
Reducing graph traversal steps
GraphStep VertexStepFilterStep RangeStepFilterStep
GGraphStep GVertexStep
Faster, Compact Querying
g.V(brown)
.outE("friends”).limit(5)
.inV().order().by("name", Order.incr)
.properties("name")
inV(): Pipelined iterator from outE()
• TinkerPop: Sequential consuming
• Gravty: Parallel querying + pre-loading vertex property
Querying in parallel and pre-loading vertex properties
outE() “name”: “Boss”
limit 5
friends
inV()
“name”: “Edward”
“name”: “Moon”
“name”: “James”
“name”: “Jessica”
“name”: “Cony”
“name”: “Sally”
Row keys that have
sequential orders may cause
RegionServers to suffer:
Hot-spotting problem with HBase RegionServer
EDGE TABLE
SrcVertexId Label TgtVertexId
u000001 1 u000002
u000001 1 u000003
u000002 1 u000001
u000003 1 u000001
u000004 2 u000009
• Heavy loads of writes or reads
• Inefficient region splitting
Avoiding Hot-Spotting
Solutions to the hot-spotting problem
- Pre-splitting regions
- Salting row keys with a hashed prefix
(Salting tables by Apache Phoenix)
But, there is a scan performance issue
with the LIMIT clause
SELECT * FROM index …
LIMIT 100;
Avoiding Hot-Spotting
Avoiding Hot-Spotting
Phoenix Salted Table
Scan 100 rows
Client side merge sort
Phoenix Client
Result
Scan 100 rows
Scan 100 rows
Scan 100 rows
Scan maximum 400 rows
Avoiding Hot-Spotting
Custom Salting + Pre-splitting
hash (source-vertex-id)
Result
Phoenix Client
Scan 100 rows sequentially
Row Key Prefix
Indexed graph view for
faster graph search
Asynchronous index
processing using Kafka
Efficient Secondary Indexing
Tools for failure
recovery
Default Phoenix IndexCommitter
HRegion
HRegion
HRegion
HRegion
HRegion
HRegion
Put
Delete
Put
Indexer Coprocessor
Phoenix Driver
numConnections = regionServers * regionServers * needConnections
Index update
Index update
Too many connections on
each RegionServer
(Network is heavily congested)
Synchronous processing of index update requests
Gravty IndexCommitter
HRegion
HRegion
HRegion
HRegion
HRegion
HRegion
Put
Delete
Put
Indexer Coprocessor
Phoenix Driver
numConnections = indexers * regionServers * needConnections
Mutations
Asynchronous processing using Kafka
Kafka
Indexer
Indexer
Index
update
Default Phoenix IndexCommitter
1. Phoenix
client UPSERT
INDEX 1
Phoenix
Coprocessor
Region Server
Primary Table
Phoenix
Coprocessor
Region Server
INDEX 2
Phoenix
Coprocessor
Region Server
PUT
PUT / DELETE
PUT / DELETE
2. Request HBase mutations
for indexes in parallel
RETURN
3. Phoenix client
returns
Gravty IndexCommitter
INDEX 1
Phoenix
Coprocessor
Region Server
Primary Table
Phoenix
Coprocessor
Region Server
INDEX 2
Phoenix
Coprocessor
Region Server
1.PUT
2. HBase mutations for INDEX 1, 2
4. Consume
3.RETURN
Kafka
Index
Consumer
5. PUT / DELETE
5. PUT / DELETE
Secondary Indexing Metrics
Server TPS RegionServer
Number of connections
3x 1/8
Reentrant event
processing
Every row is versioned in
HBase (timestamp)
Logging failures
and replaying
failed requests
Time machine to
resume at
certain runtime
Resetting runtime offset
of Kafka consumers
Best-Effort Failover
Fail fast, fix later
Monitoring Tools for Failure Recovery
Setting alerts and displaying metrics
• Prometheus
• Dropwizard metrics
• jvm_exporter
• Grafana
• Ambari
1 What Is Gravty?
2 The Internals of Gravty
3 Fine-Tuning Gravty
4 Future Plans
Client
Graph API
Multiple Graph Clusters
Before
Gravty
HBase Cluster
Client
Graph API
After
Gravty
HBase Cluster HBase Cluster
HBase Cluster
HBase Repository
Storage Layer
Memory Repository
(Standalone)
Phoenix Repository
(Default)
HBase
Repository
Abstract Interface
HBase
Phoenix Region
CoprocessorLocal Memory
Graph analytics system
graph computation
OLAP Functionality
TinkerPop Graph
Computing API
We will open source Gravty
B 4 gravty

Contenu connexe

Tendances

Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
amiable_indian
 
232 md5-considered-harmful-slides
232 md5-considered-harmful-slides232 md5-considered-harmful-slides
232 md5-considered-harmful-slides
Dan Kaminsky
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...
Lucas Jellema
 

Tendances (20)

2014-11-26 | Creating a BitTorrent Client with Scala and Akka, Part 1 (Vienna...
2014-11-26 | Creating a BitTorrent Client with Scala and Akka, Part 1 (Vienna...2014-11-26 | Creating a BitTorrent Client with Scala and Akka, Part 1 (Vienna...
2014-11-26 | Creating a BitTorrent Client with Scala and Akka, Part 1 (Vienna...
 
Hiding in plain sight
Hiding in plain sightHiding in plain sight
Hiding in plain sight
 
Twitch Plays Pokémon: Twitch's Chat Architecture
Twitch Plays Pokémon: Twitch's Chat ArchitectureTwitch Plays Pokémon: Twitch's Chat Architecture
Twitch Plays Pokémon: Twitch's Chat Architecture
 
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
 
Large Scale Accumulo Clusters
Large Scale Accumulo ClustersLarge Scale Accumulo Clusters
Large Scale Accumulo Clusters
 
My Bro The ELK
My Bro The ELKMy Bro The ELK
My Bro The ELK
 
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
 
2017 Devoxx MA Deconstructing and Evolving REST Security
2017 Devoxx MA Deconstructing and Evolving REST Security2017 Devoxx MA Deconstructing and Evolving REST Security
2017 Devoxx MA Deconstructing and Evolving REST Security
 
Infrastructure Tracking with Passive Monitoring and Active Probing: ShmooCon ...
Infrastructure Tracking with Passive Monitoring and Active Probing: ShmooCon ...Infrastructure Tracking with Passive Monitoring and Active Probing: ShmooCon ...
Infrastructure Tracking with Passive Monitoring and Active Probing: ShmooCon ...
 
2018 IterateConf Deconstructing and Evolving REST Security
2018 IterateConf Deconstructing and Evolving REST Security2018 IterateConf Deconstructing and Evolving REST Security
2018 IterateConf Deconstructing and Evolving REST Security
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
 
232 md5-considered-harmful-slides
232 md5-considered-harmful-slides232 md5-considered-harmful-slides
232 md5-considered-harmful-slides
 
Side-Channels on the Web: Attacks and Defenses
Side-Channels on the Web: Attacks and DefensesSide-Channels on the Web: Attacks and Defenses
Side-Channels on the Web: Attacks and Defenses
 
Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]
 
[Perforce] Tasks - The Holy Hand Grenade of Branching
[Perforce] Tasks - The Holy Hand Grenade of Branching[Perforce] Tasks - The Holy Hand Grenade of Branching
[Perforce] Tasks - The Holy Hand Grenade of Branching
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...
 
SANS Holiday Hack 2013 – Investigation Timeline
SANS Holiday Hack 2013 – Investigation TimelineSANS Holiday Hack 2013 – Investigation Timeline
SANS Holiday Hack 2013 – Investigation Timeline
 
New DNS Traffic Analysis Techniques to Identify Global Internet Threats
New DNS Traffic Analysis Techniques to Identify Global Internet ThreatsNew DNS Traffic Analysis Techniques to Identify Global Internet Threats
New DNS Traffic Analysis Techniques to Identify Global Internet Threats
 
HotPics 2021
HotPics 2021HotPics 2021
HotPics 2021
 
DevOps Days Montevideo Container Superhero Keynote
DevOps Days Montevideo Container Superhero KeynoteDevOps Days Montevideo Container Superhero Keynote
DevOps Days Montevideo Container Superhero Keynote
 

En vedette

B 6 new stream processing platform with apache flink
B 6 new stream processing platform with apache flinkB 6 new stream processing platform with apache flink
B 6 new stream processing platform with apache flink
LINE Corporation
 
B 7 a true agile team - global line news
B 7 a true agile team - global line newsB 7 a true agile team - global line news
B 7 a true agile team - global line news
LINE Corporation
 
A 3 difficult challenges that line has overcome
A 3 difficult challenges that line has overcomeA 3 difficult challenges that line has overcome
A 3 difficult challenges that line has overcome
LINE Corporation
 
B 5 stellite -apply chromium open-source to line game
B 5 stellite -apply chromium open-source to line gameB 5 stellite -apply chromium open-source to line game
B 5 stellite -apply chromium open-source to line game
LINE Corporation
 
A 7 architecture sustaining line live
A 7 architecture sustaining line liveA 7 architecture sustaining line live
A 7 architecture sustaining line live
LINE Corporation
 
A 10 working environment and culture for line engineers
A 10 working environment and culture for line engineersA 10 working environment and culture for line engineers
A 10 working environment and culture for line engineers
LINE Corporation
 
A 9 line shop powered by armeria
A 9 line shop powered by armeriaA 9 line shop powered by armeria
A 9 line shop powered by armeria
LINE Corporation
 

En vedette (20)

B 3 line bot live coding
B 3 line bot live codingB 3 line bot live coding
B 3 line bot live coding
 
B 6 new stream processing platform with apache flink
B 6 new stream processing platform with apache flinkB 6 new stream processing platform with apache flink
B 6 new stream processing platform with apache flink
 
B 7 a true agile team - global line news
B 7 a true agile team - global line newsB 7 a true agile team - global line news
B 7 a true agile team - global line news
 
A 2 new world by the line bot
A 2 new world by the line botA 2 new world by the line bot
A 2 new world by the line bot
 
A 6 group app platform
A 6 group app platformA 6 group app platform
A 6 group app platform
 
A 3 difficult challenges that line has overcome
A 3 difficult challenges that line has overcomeA 3 difficult challenges that line has overcome
A 3 difficult challenges that line has overcome
 
B 5 stellite -apply chromium open-source to line game
B 5 stellite -apply chromium open-source to line gameB 5 stellite -apply chromium open-source to line game
B 5 stellite -apply chromium open-source to line game
 
A 7 architecture sustaining line live
A 7 architecture sustaining line liveA 7 architecture sustaining line live
A 7 architecture sustaining line live
 
A 1 opening & introduction
A 1 opening & introductionA 1 opening & introduction
A 1 opening & introduction
 
A 4 line login - line platform
A 4 line login - line platformA 4 line login - line platform
A 4 line login - line platform
 
A 10 working environment and culture for line engineers
A 10 working environment and culture for line engineersA 10 working environment and culture for line engineers
A 10 working environment and culture for line engineers
 
A 9 line shop powered by armeria
A 9 line shop powered by armeriaA 9 line shop powered by armeria
A 9 line shop powered by armeria
 
B 1 rinna and rinna
B 1 rinna and rinnaB 1 rinna and rinna
B 1 rinna and rinna
 
ディープラーニングで株価予測をやってみた
ディープラーニングで株価予測をやってみたディープラーニングで株価予測をやってみた
ディープラーニングで株価予測をやってみた
 
為替と株の予測の話
為替と株の予測の話為替と株の予測の話
為替と株の予測の話
 
リアルタイム画風変換とその未来
リアルタイム画風変換とその未来リアルタイム画風変換とその未来
リアルタイム画風変換とその未来
 
The monad fear
The monad fearThe monad fear
The monad fear
 
S10 line bot awards
S10 line bot awardsS10 line bot awards
S10 line bot awards
 
S8 line engineer culture
S8 line engineer cultureS8 line engineer culture
S8 line engineer culture
 
S6 the guardian of line today automation test
S6 the guardian of line today automation testS6 the guardian of line today automation test
S6 the guardian of line today automation test
 

Similaire à B 4 gravty

Similaire à B 4 gravty (20)

Greg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Greg Hogan – To Petascale and Beyond- Apache Flink in the CloudsGreg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
Greg Hogan – To Petascale and Beyond- Apache Flink in the Clouds
 
Xia Zhu – Intel at MLconf ATL
Xia Zhu – Intel at MLconf ATLXia Zhu – Intel at MLconf ATL
Xia Zhu – Intel at MLconf ATL
 
Solr Graph Query: Presented by Kevin Watters, KMW Technology
Solr Graph Query: Presented by Kevin Watters, KMW TechnologySolr Graph Query: Presented by Kevin Watters, KMW Technology
Solr Graph Query: Presented by Kevin Watters, KMW Technology
 
(DAT203) Building Graph Databases on AWS
(DAT203) Building Graph Databases on AWS(DAT203) Building Graph Databases on AWS
(DAT203) Building Graph Databases on AWS
 
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
 
Automated Machine Learning Using Spark Mllib to Improve Customer Experience-(...
Automated Machine Learning Using Spark Mllib to Improve Customer Experience-(...Automated Machine Learning Using Spark Mllib to Improve Customer Experience-(...
Automated Machine Learning Using Spark Mllib to Improve Customer Experience-(...
 
Follow the money with graphs
Follow the money with graphsFollow the money with graphs
Follow the money with graphs
 
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
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
 
Nebula Graph nMeetup in Shanghai - Meet with Graph Technology Enthusiasts
Nebula Graph nMeetup in Shanghai - Meet with Graph Technology EnthusiastsNebula Graph nMeetup in Shanghai - Meet with Graph Technology Enthusiasts
Nebula Graph nMeetup in Shanghai - Meet with Graph Technology Enthusiasts
 
Solr 6.0 Graph Query Overview
Solr 6.0 Graph Query OverviewSolr 6.0 Graph Query Overview
Solr 6.0 Graph Query Overview
 
Apache HAWQ Architecture
Apache HAWQ ArchitectureApache HAWQ Architecture
Apache HAWQ Architecture
 
Graph computation
Graph computationGraph computation
Graph computation
 
Graph Databases & OrientDB
Graph Databases & OrientDBGraph Databases & OrientDB
Graph Databases & OrientDB
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and Modeling
 
Making sense of the Graph Revolution
Making sense of the Graph RevolutionMaking sense of the Graph Revolution
Making sense of the Graph Revolution
 
Large Scale Graph Analytics with JanusGraph
Large Scale Graph Analytics with JanusGraphLarge Scale Graph Analytics with JanusGraph
Large Scale Graph Analytics with JanusGraph
 
Large Scale Graph Analytics with JanusGraph
Large Scale Graph Analytics with JanusGraphLarge Scale Graph Analytics with JanusGraph
Large Scale Graph Analytics with JanusGraph
 
The Graph Revolution
The Graph RevolutionThe Graph Revolution
The Graph Revolution
 

Plus de LINE Corporation

Plus de LINE Corporation (20)

JJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LTJJUG CCC 2018 Fall 懇親会LT
JJUG CCC 2018 Fall 懇親会LT
 
Reduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin CoroutinesReduce dependency on Rx with Kotlin Coroutines
Reduce dependency on Rx with Kotlin Coroutines
 
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみたKotlin/NativeでAndroidのNativeメソッドを実装してみた
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
 
Use Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extensionUse Kotlin scripts and Clova SDK to build your Clova extension
Use Kotlin scripts and Clova SDK to build your Clova extension
 
The Magic of LINE 購物 Testing
The Magic of LINE 購物 TestingThe Magic of LINE 購物 Testing
The Magic of LINE 購物 Testing
 
GA Test Automation
GA Test AutomationGA Test Automation
GA Test Automation
 
UI Automation Test with JUnit5
UI Automation Test with JUnit5UI Automation Test with JUnit5
UI Automation Test with JUnit5
 
Feature Detection for UI Testing
Feature Detection for UI TestingFeature Detection for UI Testing
Feature Detection for UI Testing
 
LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享LINE 新星計劃介紹與新創團隊分享
LINE 新星計劃介紹與新創團隊分享
 
​LINE 技術合作夥伴與應用分享
​LINE 技術合作夥伴與應用分享​LINE 技術合作夥伴與應用分享
​LINE 技術合作夥伴與應用分享
 
LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣LINE 開發者社群經營與技術推廣
LINE 開發者社群經營與技術推廣
 
日本開發者大會短講分享
日本開發者大會短講分享日本開發者大會短講分享
日本開發者大會短講分享
 
LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享LINE Chatbot - 活動報名報到設計分享
LINE Chatbot - 活動報名報到設計分享
 
在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed Kubernetes在 LINE 私有雲中使用 Managed Kubernetes
在 LINE 私有雲中使用 Managed Kubernetes
 
LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧
 
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
 
LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享LINE Things - LINE IoT平台新技術分享
LINE Things - LINE IoT平台新技術分享
 
LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗LINE Pay - 一卡通支付新體驗
LINE Pay - 一卡通支付新體驗
 
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Platform API Update - 打造一個更好的Chatbot服務
 
Keynote - ​LINE 的技術策略佈局與跨國產品開發
Keynote - ​LINE 的技術策略佈局與跨國產品開發Keynote - ​LINE 的技術策略佈局與跨國產品開發
Keynote - ​LINE 的技術策略佈局與跨國產品開發
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

B 4 gravty

  • 1.
  • 2. 1 What Is Gravty? 2 The Internals of Gravty 3 Fine-Tuning Gravty 4 Future Plans
  • 3. 1 What Is Gravty? 2 The Internals of Gravty 3 Fine-Tuning Gravty 4 Future Plans
  • 4. A Graph Database Is “A graph database is a database that uses graph structures for semantic queries with nodes, edges and properties to represent and store data.” (Wikipedia) Stores objects (vertices) and relationships (edges) Provides graph search capabilities
  • 5. Vertices and Edges in a Graph Database Friends Friends Likes
  • 6. Use Cases of a Graph Database Facebook Social Graph Social networks Google PageRank Ranking websites Walmart and eBay Product recommendation
  • 7. Need for a Large Graph Database System Social GraphLINE Timeline LINE Talk Ranking Recommendation LINE Friends Shop LINE News Gravty
  • 8. Need for a Large Graph Database System Social GraphLINE Timeline LINE Talk Ranking Recommendation LINE Friends Shop LINE News Gravty 7 billion vertices 100 billion edges 200 billion indexes 5 billion writes a day (create / update / delete)
  • 9. Gravty Is A scalable graph database to search relational information efficiently by searching through a large pool of data using the graph search technique.
  • 10. Requirements for Gravty Easy to scale out • To support ever-increasing data Easy to develop • Add, modify, and remove features as necessary • Tailored to the LINE development environment • Not dependent on LINE- specific components Full control over everything! Easy to use • Graph query language • REST API
  • 11. 1 What Is Gravty? 2 The Internals of Gravty 3 Fine-Tuning Gravty 4 Future Plans Technology Stack and Architecture Data Model
  • 12. Technology Stack and Architecture Application TinkerPop3 Gremlin-Console TinkerPop3 Graph API Graph Processing Layer Storage Layer MySQL (config, meta) HBaseKafka Gravty
  • 13. MySQL (config, meta) Kafka Application TinkerPop3 Gremlin-Console TinkerPop 3.2.0 Graph API Graph Processing Layer (OLTP only) HBase Storage Layer Gravty
  • 14. HBase 1.1.x Local MemoryKafka 0.10.0.0 Phoenix 4.8.0 Application TinkerPop3 Gremlin-Console TinkerPop3 Graph API Gravty Storage Layer (Abstract Interface) Phoenix Repository (Default) Memory Repository (Standalone) Graph Processing Layer
  • 15. • Row key: vertex-id • Edges are stored in columns • Disadvantages Data Model Flat-Wide Table Column scan is slow Columns cannot be split Row Column vertex-id1 property property edge edge edge edge edge edge vertex-id2 … vertex-id3 …
  • 16. • Row key: edge-id Data Model Tall-Narrow Table (Gravty) SrcVertexId-Label-TgtVertexId Row Column svtxid1-label-tvtxid2 edge property edge property svtxid1-label-tvtxid3 … … • Edges are stored in rows • Advantages More effective edge scan Parallel execution
  • 18. Flat-Wide vs Tall-Narrow Flat-Wide Model Brown edge edge edge edge edge edge (1) Row scan 2 operations (2) Column scan [cony, moon, sally] ‘likes’ ‘friends’
  • 19. Flat-Wide vs Tall-Narrow Tall-Narrow Model (Gravty) brown-friends-sally (1) Row scan 1 operation [cony, moon, sally] brown-friends-moon brown-friends-cony • Can split by rows (region) • Can isolate hotspot rows • Can scan in parallel
  • 20. Flat-Wide vs Tall-Narrow g.V(“brown”).out(“friends”).out(“friends”). id().limit(10) 4 searches in total • Flat-Wide = 8 operations • Tall-Narrow (Gravty) = 4 operations
  • 21. 1 What Is Gravty? 2 The Internals of Gravty 3 Fine-Tuning Gravty 4 Future Plans Faster, Compact Querying Avoiding Hot-Spotting Efficient Secondary Indexing
  • 22. Faster, Compact Querying g.V(brown).hasLabel("user").out("friends”).order().by(“name”, Order.incr).limit(5) Reducing graph traversal steps GraphStep VertexStepFilterStep RangeStepFilterStep GGraphStep GVertexStep
  • 23. Faster, Compact Querying g.V(brown) .outE("friends”).limit(5) .inV().order().by("name", Order.incr) .properties("name") inV(): Pipelined iterator from outE() • TinkerPop: Sequential consuming • Gravty: Parallel querying + pre-loading vertex property Querying in parallel and pre-loading vertex properties outE() “name”: “Boss” limit 5 friends inV() “name”: “Edward” “name”: “Moon” “name”: “James” “name”: “Jessica” “name”: “Cony” “name”: “Sally”
  • 24. Row keys that have sequential orders may cause RegionServers to suffer: Hot-spotting problem with HBase RegionServer EDGE TABLE SrcVertexId Label TgtVertexId u000001 1 u000002 u000001 1 u000003 u000002 1 u000001 u000003 1 u000001 u000004 2 u000009 • Heavy loads of writes or reads • Inefficient region splitting Avoiding Hot-Spotting
  • 25. Solutions to the hot-spotting problem - Pre-splitting regions - Salting row keys with a hashed prefix (Salting tables by Apache Phoenix) But, there is a scan performance issue with the LIMIT clause SELECT * FROM index … LIMIT 100; Avoiding Hot-Spotting
  • 26. Avoiding Hot-Spotting Phoenix Salted Table Scan 100 rows Client side merge sort Phoenix Client Result Scan 100 rows Scan 100 rows Scan 100 rows Scan maximum 400 rows
  • 27. Avoiding Hot-Spotting Custom Salting + Pre-splitting hash (source-vertex-id) Result Phoenix Client Scan 100 rows sequentially Row Key Prefix
  • 28. Indexed graph view for faster graph search Asynchronous index processing using Kafka Efficient Secondary Indexing Tools for failure recovery
  • 29. Default Phoenix IndexCommitter HRegion HRegion HRegion HRegion HRegion HRegion Put Delete Put Indexer Coprocessor Phoenix Driver numConnections = regionServers * regionServers * needConnections Index update Index update Too many connections on each RegionServer (Network is heavily congested) Synchronous processing of index update requests
  • 30. Gravty IndexCommitter HRegion HRegion HRegion HRegion HRegion HRegion Put Delete Put Indexer Coprocessor Phoenix Driver numConnections = indexers * regionServers * needConnections Mutations Asynchronous processing using Kafka Kafka Indexer Indexer Index update
  • 31. Default Phoenix IndexCommitter 1. Phoenix client UPSERT INDEX 1 Phoenix Coprocessor Region Server Primary Table Phoenix Coprocessor Region Server INDEX 2 Phoenix Coprocessor Region Server PUT PUT / DELETE PUT / DELETE 2. Request HBase mutations for indexes in parallel RETURN 3. Phoenix client returns
  • 32. Gravty IndexCommitter INDEX 1 Phoenix Coprocessor Region Server Primary Table Phoenix Coprocessor Region Server INDEX 2 Phoenix Coprocessor Region Server 1.PUT 2. HBase mutations for INDEX 1, 2 4. Consume 3.RETURN Kafka Index Consumer 5. PUT / DELETE 5. PUT / DELETE
  • 33. Secondary Indexing Metrics Server TPS RegionServer Number of connections 3x 1/8
  • 34. Reentrant event processing Every row is versioned in HBase (timestamp) Logging failures and replaying failed requests Time machine to resume at certain runtime Resetting runtime offset of Kafka consumers Best-Effort Failover Fail fast, fix later
  • 35. Monitoring Tools for Failure Recovery Setting alerts and displaying metrics • Prometheus • Dropwizard metrics • jvm_exporter • Grafana • Ambari
  • 36. 1 What Is Gravty? 2 The Internals of Gravty 3 Fine-Tuning Gravty 4 Future Plans
  • 37. Client Graph API Multiple Graph Clusters Before Gravty HBase Cluster Client Graph API After Gravty HBase Cluster HBase Cluster HBase Cluster
  • 38. HBase Repository Storage Layer Memory Repository (Standalone) Phoenix Repository (Default) HBase Repository Abstract Interface HBase Phoenix Region CoprocessorLocal Memory
  • 39. Graph analytics system graph computation OLAP Functionality TinkerPop Graph Computing API
  • 40. We will open source Gravty