performance introspec on of graph databases
play

Performance Introspec/on of Graph Databases Peter Macko - PowerPoint PPT Presentation

Performance Introspec/on of Graph Databases Peter Macko Daniel Margo Margo Seltzer Harvard University Harvard University Harvard University Cambridge, MA


  1. Performance ¡Introspec/on ¡ of ¡Graph ¡Databases ¡ Peter ¡Macko ¡ Daniel ¡Margo ¡ Margo ¡Seltzer ¡ Harvard ¡University ¡ Harvard ¡University ¡ Harvard ¡University ¡ Cambridge, ¡MA ¡ Cambridge, ¡MA ¡ Cambridge, ¡MA ¡

  2. Conven/onal ¡Benchmark ¡ Benchmarking ¡Graph ¡Database ¡X ¡ Dataset ¡with ¡2 ¡mil. ¡nodes, ¡10 ¡mil. ¡edges ¡ ¡ UnidirecConal ¡BFS-­‑based ¡shortest ¡path: ¡ 38.3 ¡seconds ¡ ¡

  3. Performance ¡Introspec/on ¡ of ¡Graph ¡Databases ¡ • A ¡black-­‑box ¡approach ¡to ¡ understanding ¡the ¡strengths ¡and ¡ ? ¡ inefficiencies ¡of ¡graph ¡databases. ¡ ¡ • A ¡benchmarking ¡methodology ¡that ¡ idenCfies ¡how ¡smaller ¡operaCons ¡fit ¡ together ¡to ¡create ¡bigger ¡operaCons ¡ using ¡quanCtaCve ¡relaConships. ¡ • A ¡web-­‑based ¡tool ¡to ¡run ¡the ¡ benchmarks ¡and ¡to ¡visualize ¡the ¡ results. ¡

  4. Outline ¡ 1. IntroducCon ¡ 2. Methodology ¡ 3. ImplementaCon ¡ 4. Selected ¡Results ¡ 5. Conclusion ¡ ¡

  5. Methodology ¡ 1. Recursively ¡ decompose ¡a ¡graph ¡applicaCon ¡into ¡its ¡ primiCve ¡graph ¡operaCons: ¡ – Get ¡vertex, ¡edge, ¡property ¡ – Insert/update ¡vertex, ¡edge, ¡property ¡ 2. Measure ¡each ¡operaCon. ¡ 3. Model ¡higher ¡level ¡operaCons ¡naively ¡in ¡terms ¡of ¡ lower-­‑level ¡operaCons. ¡ 4. Compare ¡actual ¡and ¡modeled ¡performance ¡to ¡ idenCfy ¡strengths/weaknesses ¡of ¡implementaCon. ¡

  6. Example ¡– ¡Decomposi/on ¡ • Consider ¡the ¡BFS ¡shortest ¡path: ¡ Function Shortest-Path(source, target): Function Shortest-Path(source, target): Q ← new Queue { source } Q ← new Queue { source } while Q is not empty: while Q is not empty: v ← dequeue from Q v ← dequeue from Q if v = target: if v = target: done done else : else : N ← Get Neighbors of v N ← Get Neighbors of v for n ϵ N: for n ϵ N: if n was not yet visited: enqueue n to Q if n was not yet visited: enqueue n to Q • How ¡long ¡should ¡it ¡take ¡with ¡no ¡opCmizaCon? ¡ ( Latency ¡of ¡Get ¡Neighbors ) ¡× ¡( # ¡of ¡visited ¡neighborhoods ) ¡

  7. Example ¡– ¡Recursive ¡Decomposi/on ¡ BFS ¡Shortest ¡Path: ¡ • A ¡simple ¡BFS ¡shortest ¡path ¡ BFS ¡Shortest ¡ algorithm ¡decomposes ¡into ¡ Path ¡ some ¡number ¡of ¡“Get ¡ Neighbors” ¡queries ¡ Get ¡ • A ¡call ¡to ¡“Get ¡Neighbors” ¡ Neighbors ¡ traverses ¡on ¡average ¡ n ¡edges ¡ • A ¡“Traverse” ¡operaCon ¡gets ¡a ¡ Traverse ¡ single ¡edge ¡from ¡the ¡database ¡ and ¡the ¡vertex ¡at ¡the ¡other ¡ endpoint ¡ GET ¡ GET ¡ vertex ¡ edge ¡

  8. Example ¡– ¡Recursive ¡Decomposi/on ¡ BFS ¡Shortest ¡Path: ¡ Latency-­‑Model(Shortest ¡Path) ¡ BFS ¡Shortest ¡ Path ¡ ¡= ¡m ¡× ¡Latency(Get ¡Neighbors) ¡ Latency-­‑Model(Get ¡Neighbors) ¡ Get ¡ Neighbors ¡ ¡= ¡n ¡× ¡Latency(Traverse) ¡ Latency-­‑Model(Traverse) ¡ Traverse ¡ ¡= ¡Latency(Get ¡Vertex) ¡ ¡+ ¡Latency(Get ¡Edge) ¡ GET ¡ GET ¡ vertex ¡ edge ¡

  9. Example ¡– ¡Recursive ¡Decomposi/on ¡ BFS ¡Shortest ¡Path ¡– ¡Neo4j, ¡2 ¡mil. ¡node ¡graph: ¡ Latency-­‑Model(Shortest ¡Path) ¡ BFS ¡Shortest ¡ Path ¡ ¡= ¡m ¡× ¡Latency(Get ¡Neighbors) ¡ Latency-­‑Model(Get ¡Neighbors) ¡ Get ¡ Neighbors ¡ ¡= ¡n ¡× ¡Latency(Traverse) ¡ Latency-­‑Model(Traverse) ¡ Traverse ¡ ¡= ¡0.5 ¡μs ¡+ ¡3.4 ¡μs ¡ ¡= ¡3.9 ¡μs ¡ GET ¡ GET ¡ vertex ¡ edge ¡

  10. Example ¡– ¡Recursive ¡Decomposi/on ¡ BFS ¡Shortest ¡Path ¡– ¡Neo4j, ¡2 ¡mil. ¡node ¡graph: ¡ Latency-­‑Model(Shortest ¡Path) ¡ BFS ¡Shortest ¡ Path ¡ ¡= ¡m ¡× ¡Latency(Get ¡Neighbors) ¡ Latency-­‑Model(Get ¡Neighbors) ¡ Get ¡ Neighbors ¡ ¡= ¡10 ¡× ¡3.9 ¡μs ¡= ¡39 ¡μs ¡ Actual: ¡32 ¡μs ¡ Latency-­‑Model(Traverse) ¡ Traverse ¡ ¡= ¡0.5 ¡μs ¡+ ¡3.4 ¡μs ¡ ¡= ¡3.9 ¡μs ¡ GET ¡ GET ¡ vertex ¡ edge ¡

  11. Example ¡– ¡Recursive ¡Decomposi/on ¡ BFS ¡Shortest ¡Path ¡– ¡Neo4j, ¡2 ¡mil. ¡node ¡graph: ¡ Latency-­‑Model(Shortest ¡Path) ¡ BFS ¡Shortest ¡ Path ¡ ¡= ¡523,000 ¡× ¡32 ¡μs ¡= ¡35.6 ¡s ¡ Actual: ¡38.3 ¡s ¡ Latency-­‑Model(Get ¡Neighbors) ¡ Get ¡ Neighbors ¡ ¡= ¡10 ¡× ¡3.9 ¡μs ¡= ¡39 ¡μs ¡ Actual: ¡32 ¡μs ¡ Latency-­‑Model(Traverse) ¡ Traverse ¡ ¡= ¡0.5 ¡μs ¡+ ¡3.4 ¡μs ¡ ¡= ¡3.9 ¡μs ¡ GET ¡ GET ¡ vertex ¡ edge ¡

  12. Types ¡of ¡Opera/ons ¡ BFS ¡Shortest ¡Path: ¡ Algorithms: ¡ ¡Higher-­‑level ¡ operaCons; ¡oken ¡not ¡part ¡of ¡the ¡ BFS ¡Shortest ¡ Path ¡ graph ¡API. ¡ Graph ¡OperaCons: ¡ ¡Common ¡ Get ¡ building ¡blocks ¡for ¡higher ¡level ¡ Neighbors ¡ operaCons. ¡ Micro-­‑OperaCons: ¡ ¡Low-­‑level ¡ Traverse ¡ operaCons ¡that ¡do ¡not ¡further ¡ decompose ¡or ¡that ¡cannot ¡be ¡ measured ¡directly ¡(and ¡thus ¡ GET ¡ GET ¡ must ¡be ¡modeled). ¡ vertex ¡ edge ¡

  13. Another ¡Decomposi/on ¡Example ¡ Clustering ¡Coefficients: ¡ • CompuCng ¡a ¡clustering ¡ Compute ¡ Clustering ¡ coefficients ¡(i.e., ¡triangle ¡ Coeff. ¡ counCng) ¡involves ¡gemng ¡ Get ¡ k -­‑hop ¡ k-­‑hop ¡neighborhoods ¡for ¡k ¡= ¡2 ¡ Neighbors ¡ • “Get ¡k-­‑hop ¡neighbors” ¡gets ¡all ¡ Get ¡ neighbors ¡that ¡are ¡at ¡most ¡k ¡ Neighbors ¡ hops ¡away ¡from ¡a ¡given ¡ starCng ¡vertex ¡ Traverse ¡ • (We ¡have ¡already ¡seen ¡“Get ¡ GET ¡ GET ¡ Neighbors” ¡before) ¡ vertex ¡ edge ¡

  14. Writes ¡ Ingest: ¡ Insert ¡a ¡ Bulk ¡Ingest ¡ subgraph ¡ SET ¡ ADD ¡ ADD ¡ property ¡ vertex ¡ edge ¡ ¡ • InserCng ¡a ¡subgraph ¡into ¡a ¡database ¡is ¡a ¡ combinaCon ¡of ¡add ¡vertex, ¡add ¡edge, ¡and ¡set ¡edge ¡ or ¡vertex ¡property ¡micro-­‑operaCons ¡ • Performing ¡one ¡ingest ¡at ¡a ¡Cme ¡is ¡oken ¡inefficient, ¡ so ¡databases ¡frequently ¡provide ¡opCmized ¡bulk ¡ ingest ¡

  15. Opera/on ¡Decomposi/on ¡Summary ¡ Compute ¡ Hop-­‑plot ¡ IdenCfy ¡ PageRank ¡ analysis ¡ small ¡world ¡ Applica/ons ¡ Compute ¡ clustering ¡ All-­‑pairs ¡SP ¡ coeff. ¡ Single-­‑ Max ¡flow ¡ source ¡SP ¡ BFS ¡ Shortest ¡ Algorithms ¡ Path ¡ Get ¡ ¡k-­‑hop ¡ neighbors ¡ Get ¡(cond) ¡ INS ¡ Bulk ¡ neighbors ¡ subgraph ¡ Ingest ¡ Get ¡ neighbors ¡ Graph ¡opera/ons ¡ Traverse ¡ GET ¡ GET ¡ GET ¡ SET ¡ ADD ¡ ADD ¡ vertex ¡ edge ¡ prop ¡ prop ¡ vertex ¡ edge ¡ Micro-­‑opera/ons ¡

  16. Outline ¡ 1. IntroducCon ¡ 2. Methodology ¡ 3. ImplementaCon ¡ 4. Selected ¡Results ¡ 5. Conclusion ¡ ¡

  17. Implementa/on ¡ • Started ¡with ¡choosing ¡the ¡Blueprints ¡API ¡– ¡a ¡ uniform ¡Java ¡API ¡for ¡accessing ¡property ¡graphs ¡ (graphs ¡with ¡properCes ¡on ¡nodes ¡and ¡edges) ¡ • Benchmark ¡and ¡all ¡tools ¡implemented ¡in ¡Java ¡

  18. Interfacing ¡with ¡Databases ¡ • ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡– ¡The ¡benchmark ¡framework ¡and ¡ the ¡reference ¡implementaCon ¡for ¡each ¡operaCon ¡ • For ¡each ¡graph ¡database: ¡ – Required: ¡Implement ¡a ¡few ¡methods ¡(150 ¡LOC ¡on ¡average) ¡ – OpConal: ¡Re-­‑implement ¡each ¡operaCon ¡in ¡the ¡database’s ¡ naCve ¡API ¡for ¡improved ¡performance ¡ • Tested ¡with: ¡ • During ¡development, ¡also ¡BerkeleyDB ¡and ¡MySQL ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend