The Graph Story of the SAP HANA Database

6.818 Aufrufe

Veröffentlicht am

Many traditional and new business applications work with inherently graph-
structured data and therefore benefit from graph abstractions and operations provided
in the data management layer. The property graph data model not only offers schema
flexibility but also permits managing and processing data and metadata jointly. By
having typical graph operations implemented directly in the database engine and
exposing them both in the form of an intuitive programming interface and a declarative
language, complex business application logic can be expressed more easily and executed
very efficiently. In this paper we describe our ongoing work to extend the SAP HANA
database with built-in graph data support. We see this as a next step on the way
to provide an efficient and intuitive data management platform for modern business
applications with SAP HANA.

1 Kommentar
15 Gefällt mir
Statistik
Notizen
Keine Downloads
Aufrufe
Aufrufe insgesamt
6.818
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
45
Aktionen
Geteilt
0
Downloads
0
Kommentare
1
Gefällt mir
15
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

The Graph Story of the SAP HANA Database

  1. 1. The Graph Story of theSAP HANA DatabaseMichael Rudolf, Marcus Paradies, Christof Bornhoevd, Wolfgang LehnerBTW13 March 13, 2013
  2. 2. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  3. 3. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  4. 4. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  5. 5. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  6. 6. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  7. 7. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  8. 8. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  9. 9. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  10. 10. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  11. 11. Use Case: Wine Supply Chain Traceability [1]c 2013 SAP AG. All rights reserved. 2
  12. 12. Use Case: Wine Supply Chain Traceability [1] Query: Find the grape grower that caused the problemc 2013 SAP AG. All rights reserved. 2
  13. 13. Use Case: Wine Supply Chain Traceability [1] Query: Find the grape grower that caused the problemc 2013 SAP AG. All rights reserved. 2
  14. 14. Use Case: Wine Supply Chain Traceability [1] Query: Find the grape grower that caused the problemc 2013 SAP AG. All rights reserved. 2
  15. 15. More Enterprise Applicationsc 2013 SAP AG. All rights reserved. 3
  16. 16. More Enterprise Applications Transportation and Logisticsc 2013 SAP AG. All rights reserved. 3
  17. 17. More Enterprise Applications Transportation and Logistics Supply Chain Traceabilityc 2013 SAP AG. All rights reserved. 3
  18. 18. More Enterprise Applications Transportation and Logistics Supply Chain Traceability Fraud Detection for Insurance Companiesc 2013 SAP AG. All rights reserved. 3
  19. 19. More Enterprise Applications Transportation and Logistics Supply Chain Traceability Fraud Detection for Insurance Companies Bill of Materialsc 2013 SAP AG. All rights reserved. 3
  20. 20. More Enterprise Applications Transportation and Logistics Supply Chain Traceability Fraud Detection for Insurance Companies Bill of Materials Targeted Advertisementc 2013 SAP AG. All rights reserved. 3
  21. 21. More Enterprise Applications Transportation and Logistics Supply Chain Traceability Fraud Detection for Insurance Companies Bill of Materials Targeted Advertisement Route planning with geospatial informationc 2013 SAP AG. All rights reserved. 3
  22. 22. More Enterprise Applications Transportation and Logistics Supply Chain Traceability Fraud Detection for Insurance Companies Bill of Materials Targeted Advertisement Route planning with geospatial information Network-based Customer Community Growthc 2013 SAP AG. All rights reserved. 3
  23. 23. More Enterprise Applications Transportation and Logistics Supply Chain Traceability Fraud Detection for Insurance Companies Bill of Materials Targeted Advertisement Route planning with geospatial information Network-based Customer Community Growth . . . Novel Business Applications!c 2013 SAP AG. All rights reserved. 3
  24. 24. Agenda1. Use Casesc 2013 SAP AG. All rights reserved. 4
  25. 25. Agenda1. Use Cases 2. Property Graph Modelc 2013 SAP AG. All rights reserved. 4
  26. 26. Agenda1. Use Cases 3. Comparison with Relational Model 2. Property Graph Model 4. Comparison with RDF Modelc 2013 SAP AG. All rights reserved. 4
  27. 27. Agenda 5. Graph Processing in SAP HANA1. Use Cases 3. Comparison with Relational Model 2. Property Graph Model 4. Comparison with RDF Modelc 2013 SAP AG. All rights reserved. 4
  28. 28. Agenda 6. Active Information Store 7. WIPE 5. Graph Processing in SAP HANA1. Use Cases 3. Comparison with Relational Model 2. Property Graph Model 4. Comparison with RDF Modelc 2013 SAP AG. All rights reserved. 4
  29. 29. Agenda 6. Active Information Store 7. WIPE 5. Graph Processing in SAP HANA 8. Graph Abstraction 9. Graph Layer Traversals1. Use Cases 3. Comparison with Relational Model 2. Property Graph Model 4. Comparison with RDF Modelc 2013 SAP AG. All rights reserved. 4
  30. 30. Agenda 6. Active Information Store 7. WIPE 5. Graph Processing in SAP HANA 10. Experimental 8. Graph Results Abstraction 9. Graph Layer Traversals1. Use Cases 3. Comparison with Relational Model 2. Property Graph Model 4. Comparison with RDF Modelc 2013 SAP AG. All rights reserved. 4
  31. 31. Agenda 6. Active Information Store 7. WIPE 5. Graph Processing in SAP HANA 10. Experimental 8. Graph Results Abstraction 9. Graph Layer Traversals1. Use Cases 11. Conclusions 3. Comparison with Relational Model 2. Property Graph Model 4. Comparison with RDF Modelc 2013 SAP AG. All rights reserved. 4
  32. 32. The Property Graph Model “Books” “Movies & TV” part of part of “Literature “Movies” & Fiction” Rating 4/5 in in 1997 “Romeo rates DVD “Romeo and Juliet” in 2012 and Juliet” Rating 5/5 Book rates rates DVD rates 1999 Rating 4/5 Rating 3/5 “Shakespeare in Love” Provides directed, attributed multi-relational graphs Attributes on vertices and edges as key-value pairs (instance-level instead of class-level)c 2013 SAP AG. All rights reserved. 5
  33. 33. Comparison with Relational Model Focus on structured tables and relational consistency constraints No simple/intuitive way to represent edge attributesc 2013 SAP AG. All rights reserved. 6
  34. 34. Comparison with RDF Graph Model Data representation as triplets (statements) No simple/intuitive way to represent edge attributes No simple/intuitive way to represent entities/subjects as complex objects covering all associated attributesc 2013 SAP AG. All rights reserved. 7
  35. 35. Graph Processing in SAP HANA in a Nutshell ODBC / JDBC RPC Client Interfaces SQL WIPE Compiler Compiler Graph Function Library SQL WIPE Active Relational Runtime Runtime Information Stack Store Relational Abstraction Graph Abstraction Layer Layer Column Store Operators Core Column Store Primitives Storage Interface Declarative interface: WIPE Imperative interface: GraphAPIc 2013 SAP AG. All rights reserved. 8
  36. 36. The Data Model of the AIS Workspace AIS Core Data Model 1 * Property Taxonomy 1 * * 1 1 1..* 1..* 2 * 1 1 Association Info Item Term Technical Type 1 1..* 1 1 * 1..* Attribute 0..1 Template Info Items represent uniquely identiable data objects Associations describe directed relationship between pairs of Info Items Attributes describe a Property of the Info Item or Association they belong to Terms describe the assumed semantic type of Info Items or Associationsc 2013 SAP AG. All rights reserved. 9
  37. 37. WIPEWeakly Structured Information Processing and Exploration Declarative query- and manipulation language Combination of BI-like data aggregation and graph-like traversals Declaration of multiple insert, update, delete, and query operations in one statement c 2013 SAP AG. All rights reserved. 10
  38. 38. WIPEWeakly Structured Information Processing and Exploration Declarative query- and manipulation language Combination of BI-like data aggregation and graph-like traversals Declaration of multiple insert, update, delete, and query operations in one statement USE WORKSPACE uri : AIS ; “Books” “Movies TV” $category = { uri : books }; part of part of $books = $category - uri : partOf (1 ,*) “Literature Fiction” in “Movies” Rating 4/5 - uri : in ; in 1997 “Romeo rates DVD RESULT uri : best “Romeo and Juliet” 2012 and Juliet” in Rating 5/5 Book rates FROM $b : $books rates DVD rates WHERE ANY $b - uri : rates @ uri : rating 3/5; Rating 4/5 Rating 3/5 1999 “Shakespeare in Love” c 2013 SAP AG. All rights reserved. 10
  39. 39. Graph Abstraction Layer GraphAPI exposes graph functionality to the application developer Directly operates on the column store engine Support for graph creation, deletion and access to existing graphs Addition, deletion, and modication of vertices and edges Search and traversal operationsc 2013 SAP AG. All rights reserved. 11
  40. 40. Graph Traversal Operator Graph traversal acts in a breadth-rst manner Example query: { uri:D }-uri:a(1,*) D Vsource Vtarget Etype a D B a B b c F C c a B A a A a E A C b b b E C b C E D b c B C a F D c Fc 2013 SAP AG. All rights reserved. 12
  41. 41. Graph Traversal Operator Graph traversal acts in a breadth-rst manner Example query: { uri:D }-uri:a(1,*) D Vsource Vtarget Etype a D B a B b c F C c a B A a Scan A a E A C b b b E C b C E D b c B C a F D c Fc 2013 SAP AG. All rights reserved. 12
  42. 42. Graph Traversal Operator Graph traversal acts in a breadth-rst manner Example query: { uri:D }-uri:a(1,*) D Vsource Vtarget Etype a D B a B b c F C c a B A a A a E A C b b b E C b C E D b c B C a F D c Fc 2013 SAP AG. All rights reserved. 12
  43. 43. Graph Traversal Operator Graph traversal acts in a breadth-rst manner Example query: { uri:D }-uri:a(1,*) D Vsource Vtarget Etype a D B a B b c F C c a B A a Scan A a E A C b b b E C b C E D b c B C a F D c Fc 2013 SAP AG. All rights reserved. 12
  44. 44. Graph Traversal Operator Graph traversal acts in a breadth-rst manner Example query: { uri:D }-uri:a(1,*) D Vsource Vtarget Etype a D B a B b c F C c a B A a A a E A C b b b E C b C E D b c B C a F D c Fc 2013 SAP AG. All rights reserved. 12
  45. 45. Graph Traversal Operator Graph traversal acts in a breadth-rst manner Example query: { uri:D }-uri:a(1,*) D Vsource Vtarget Etype a D B a B b c F C c a B A a Scan A a E A C b b b E C b C E D b c B C a F D c Fc 2013 SAP AG. All rights reserved. 12
  46. 46. Graph Traversal Operator Graph traversal acts in a breadth-rst manner Example query: { uri:D }-uri:a(1,*) → { uri:B, uri:A, uri:C } D Vsource Vtarget Etype a D B a B b c F C c a B A a A a E A C b b b E C b C E D b c B C a F D c Fc 2013 SAP AG. All rights reserved. 12
  47. 47. Experimental Results Generated graph data sets with up to 40 Mio. edges Comparison of WIPE queries and their equivalent SQL queriesc 2013 SAP AG. All rights reserved. 13
  48. 48. Experimental Results Generated graph data sets with up to 40 Mio. edges Comparison of WIPE queries and their equivalent SQL queries USE WORKSPACE uri : AIS ; SELECT DISTINCT V. id $root = { uri : A }; FROM AIS . EDGES AS A , $t = $root - uri : a (4 ,4); AIS . EDGES AS B , RESULT uri : res FROM $t ; AIS . EDGES AS C , AIS . EDGES AS D , AIS . VERTICES AS V WHERE A. source = A AND D . target = V. id AND A . type = a AND A . target = B. source AND B . target = C. source AND C . target = D. sourcec 2013 SAP AG. All rights reserved. 13
  49. 49. Experimental Results Generated graph data sets with up to 40 Mio. edges Comparison of WIPE queries and their equivalent SQL queries (in × baseline measurement) (in × baseline measurement) G1 Relative Execution Factor Relative Execution Factor 26 3 G2 G3 G4 WIPE G5 23 SQL 2 20 1 0 5 10 5 10 Number of Path Steps Number of Path Steps Figure: Scalability of SQL and WIPE Figure: Scalability of WIPEc 2013 SAP AG. All rights reserved. 13
  50. 50. Conclusions1 Native Support for Graph Processing2 Accessible via declarative and procedural interface3 Tight integration with other engines (such as temporal and spatial)4 No need to replicate data to separate graph data structurec 2013 SAP AG. All rights reserved. 14
  51. 51. Everything that can be invented has been invented.(Charles H. Duell, Commissioner, U.S. Oce of Patents, 1899)Contact information:Marcus ParadiesPhD StudentWDF03, C5.25m.paradies@sap.comChristof Bornhoevdchristof.bornhoevd@sap.com
  52. 52. Wine Supply Chain Traceability GS1 Application Guideline. http://www.gs1.org/docs/traceability/GS1_wine_traceability.pdf/.c 2013 SAP AG. All rights reserved. 15

×