SlideShare ist ein Scribd-Unternehmen logo
1 von 81
Downloaden Sie, um offline zu lesen
GRAPHENDATENBANKEN
          Henning Rauch
    Universität Hof - 04.05.2012
                 1
AGENDA


•   Überblick

•   Neo4J

•   InfiniteGraph

•   Fallen-8


                   2
ÜBERBLICK
             Warum macht es Sinn sich damit zu beschäftigen


„Graph databases will come into vogue. One key gap in the Hadoop
ecosystem is for graph databases, which support rich mining and visualization of
relationships, influence, and behavioral propensities. The market for graph
databases will boom in 2012 as companies everywhere adopt them for social
media analytics, marketing campaign optimization, and customer experience
fine-tuning. We will see VCs put big money behind graph database and analytics
startups. Many big data platform and tool vendors will acquire the startups to
supplement their expanding Hadoop, NoSQL, and enterprise data warehousing
(EDW) portfolios. Social graph analysis, although not a brand-new field, will
become one of the most prestigious specialties in the data science arena,
focusing on high-powered drilldown into polystructured behavioral data sets.“
                              Quelle: http://blogs.forrester.com/james_kobielus/11-12-19-the_year_ahead_in_big_data_big_cool_new_stuff_looms_large

                                                 3
ÜBERBLICK
Beispiel eines Realworld Graphen - facebook




                          Quelle: http://www.facebook.com/press/info.php?statistics

             4
ÜBERBLICK
Beispiel eines Realworld Graphen - NYT „Cascade“




                                  Quelle: http://nytlabs.com/projects/cascade.html

                   5
ÜBERBLICK
Beispiel eines Realworld Graphen - Telefon-Rechnung




                     6
ÜBERBLICK
Abgrenzung zu RDBMS - Property graph
     RDBMS GraphDB




          7
ÜBERBLICK
                       Abgrenzung zu RDBMS - Property graph
                            RDBMS GraphDB
     Person
Id       Name
0     Henning Rauch
1       René Peinl
2        Foo Bar
3     Bruce Schneier
4     Linus Torwalds




                                 7
ÜBERBLICK
                       Abgrenzung zu RDBMS - Property graph
                            RDBMS GraphDB
     Person
                                                 2
Id       Name                                            3
0     Henning Rauch
1       René Peinl
2        Foo Bar
3     Bruce Schneier
                                                             4
4     Linus Torwalds
                                            1




                                                     0




                                 7
ÜBERBLICK
                                     Abgrenzung zu RDBMS - Property graph
                                          RDBMS GraphDB
     Person             Kennt_rel
                                                               2
Id       Name          Id_1   Id_2                                     3
0     Henning Rauch     1      0
1       René Peinl      1      2
2        Foo Bar        1      3
3     Bruce Schneier    1      4
                                                                           4
4     Linus Torwalds    0      1                          1
                        0      2
                        0      3
                        0      4
                        3      4
                        4      3                                   0




                                               7
ÜBERBLICK
                                     Abgrenzung zu RDBMS - Property graph
                                          RDBMS GraphDB
     Person             Kennt_rel
                                                               2
Id       Name          Id_1   Id_2                                     3
0     Henning Rauch     1      0
1       René Peinl      1      2
2        Foo Bar        1      3
3     Bruce Schneier    1      4
                                                                           4
4     Linus Torwalds    0      1                          1
                        0      2
                        0      3
                        0      4
                        3      4
                        4      3                                   0




                                               7
ÜBERBLICK
                                     Abgrenzung zu RDBMS - Property graph
                                          RDBMS GraphDB
     Person             Kennt_rel
                                                               2
Id       Name          Id_1   Id_2                                     3
0     Henning Rauch     1      0
1       René Peinl      1      2
2        Foo Bar        1      3
3     Bruce Schneier    1      4
                                                                           4
4     Linus Torwalds    0      1                          1
                        0      2
                        0      3
                        0      4
                        3      4
                        4      3                                   0



      Tag
Id       Name
0           .NET
1           Java
2           PKI
3        NoSQL



                                               7
ÜBERBLICK
                                     Abgrenzung zu RDBMS - Property graph
                                          RDBMS GraphDB
     Person             Kennt_rel
                                                                2
Id       Name          Id_1   Id_2                                            3
0     Henning Rauch                                Java
                        1      0
1       René Peinl      1      2
2        Foo Bar        1      3
3     Bruce Schneier    1      4
                                                                                     4
4     Linus Torwalds    0      1                           1
                        0      2
                        0      3
                        0      4
                        3      4
                        4      3                                    0



      Tag                                          NoSQL
Id       Name                                                                     .NET

0           .NET
                                                                        PKI
1           Java
2           PKI
3        NoSQL



                                               7
ÜBERBLICK
                                                  Abgrenzung zu RDBMS - Property graph
                                                               RDBMS GraphDB
     Person                      Kennt_rel
                                                                                     2
Id       Name                   Id_1       Id_2                                                    3
0     Henning Rauch                                                     Java
                                 1          0
1       René Peinl               1          2
2        Foo Bar                 1          3
3     Bruce Schneier             1          4
                                                                                                          4
4     Linus Torwalds             0          1                                   1
                                 0          2
                                 0          3
                                 0          4
                                 3          4
                                 4          3                                            0



      Tag                        Tags_rel                               NoSQL
Id       Name          Tag_Id   Person_Id         Signifikanz                                           .NET

0           .NET         0             0              5
                                                                                             PKI
1           Java         1             1              5
2           PKI          2             1              6
3        NoSQL           2             3              10
                         3             0              7
                         3             1              7
                                                                    7
ÜBERBLICK
                                                  Abgrenzung zu RDBMS - Property graph
                                                               RDBMS GraphDB
     Person                      Kennt_rel
                                                                                            2
Id       Name                   Id_1       Id_2                                                               3
0     Henning Rauch                                                     Java
                                 1          0
1       René Peinl               1          2
                                                                                                                  10
2        Foo Bar                 1          3
                                                                               5
3     Bruce Schneier             1          4
                                                                                                                          4
4     Linus Torwalds             0          1                                      1
                                 0          2
                                 0          3
                                 0          4
                                 3          4                           7

                                 4          3                                                   0


                                                                                                    5
      Tag                        Tags_rel                               NoSQL           7
Id       Name          Tag_Id   Person_Id         Signifikanz                                                           .NET

0           .NET         0             0              5
                                                                                            6           PKI
1           Java         1             1              5
2           PKI          2             1              6
3        NoSQL           2             3              10
                         3             0              7
                         3             1              7
                                                                    7
ÜBERBLICK
                                                  Abgrenzung zu RDBMS - Property graph
                                                               RDBMS GraphDB
     Person                      Kennt_rel
                                                                                               2
Id       Name                   Id_1       Id_2                                                                  3
0     Henning Rauch                                                     Java
                                 1          0
1       René Peinl               1          2
                                                                                                                     10
2        Foo Bar                 1          3
                                                                               5
3     Bruce Schneier             1          4
                                                                                                                             4
4     Linus Torwalds             0          1                                      1
                                 0          2
                                 0          3
                                 0          4
                                 3          4                           7

                                 4          3                                                      0


                                                                                                       5
      Tag                        Tags_rel                               NoSQL              7
Id       Name          Tag_Id   Person_Id         Signifikanz                                                              .NET

0           .NET         0             0              5
                                                                                               6           PKI
1           Java         1             1              5
2           PKI          2             1              6
3        NoSQL           2
                         3
                                       3
                                       0
                                                      10
                                                      7
                                                                                              Knoten =
                         3             1              7
                                                                    7                  Eigenschaften + Kanten
ÜBERBLICK
                           Abgrenzung zu RDBMS - Skalierbarkeit
                                                                     Kennt_rel
                                                                    Id_1       Id_2

•   Relations-Tabellen sind das Problem, sie agieren als             1
                                                                     1
                                                                                0
                                                                                2

    globaler Index über Beziehungen zwischen Daten                   1
                                                                     1
                                                                                3
                                                                                4
                                                                     0          1


    Je größer die Relation, desto länger dauert es die
                                                                     0          2
•                                                                    0          3


    interessante Information (z.B. Nachbarschaft) zu                 0
                                                                     3
                                                                                4
                                                                                4

    finden                                                            4          3



                                                                     Tags_rel

•   Lösung der Graphendatenbank: Information über          Tag_Id
                                                             0
                                                                    Person_Id
                                                                           0
                                                                                      Signifikanz
                                                                                          5

    Beziehungen (Kanten) werden lokal am Knoten              1             1              5


    abgelegt
                                                             2             1              6
                                                             2             3              10
                                                             3             0              7
                                                             3             1              7

                                    8
ÜBERBLICK
                         Abgrenzung zu RDBMS - Aber aber aber

•   Aufgabe: Finde Personen, welche 0 kennt.

    •   Lineares Scannen der Relationen-Tabelle: O(n)       Kennt_rel
                                                           Id_1   Id_2
                                                            1      0
                                                            1      2
    •   Abfragen eines Index: O(log n)                      1      3
                                                            1      4
                                                            0      1

•   Bei RDBMS große Performance-Einbrüche bei               0
                                                            0
                                                                   2
                                                                   3

    rekursiven Such-Algorithmen (da Abhängigkeit zu n)      0      4
                                                            3      4
                                                            4      3

•   Graphendatenbanken lösen diese Aufgabe i.A. in O(1),
    unabhängig von der Gesamtgröße des Graphen
                                     9
ÜBERBLICK
        Abgrenzung zu anderen NoSQL Produkten
Größe




             > 90% der Anwendungsfälle



                                                                                                       Komplexität

                                         Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german

                         10
ÜBERBLICK
                    Abgrenzung zu anderen NoSQL Produkten
Größe
        Key/Value
         stores




                         > 90% der Anwendungsfälle



                                                                                                                   Komplexität

                                                     Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german

                                     10
ÜBERBLICK
                               Abgrenzung zu anderen NoSQL Produkten
Größe
        Key/Value
         stores
                    Bigtable
                     clones




                                    > 90% der Anwendungsfälle



                                                                                                                              Komplexität

                                                                Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german

                                                10
ÜBERBLICK
                               Abgrenzung zu anderen NoSQL Produkten
Größe
        Key/Value
         stores
                    Bigtable
                     clones
                                 Dokument
                                Datenbanken




                                              > 90% der Anwendungsfälle



                                                                                                                                        Komplexität

                                                                          Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german

                                                          10
ÜBERBLICK
                               Abgrenzung zu anderen NoSQL Produkten
Größe
        Key/Value
         stores
                    Bigtable
                     clones
                                 Dokument
                                Datenbanken


                                                           Graphendatenbanken




                                              > 90% der Anwendungsfälle



                                                                                                                                        Komplexität

                                                                          Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german

                                                          10
ÜBERBLICK
                               Abgrenzung zu anderen NoSQL Produkten
Größe
        Key/Value
         stores
                    Bigtable
                     clones
                                 Dokument
                                Datenbanken


                                                           Graphendatenbanken
                                                                                                                In-Memory
                                                                                                            Graphendatenbanken




                                              > 90% der Anwendungsfälle



                                                                                                                                        Komplexität

                                                                          Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german

                                                          10
ÜBERBLICK
       Graphenprozessierung vs. Graphendatenbank




OLAP               Graph affin
                   Universell                                                            OLTP




                                Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx

                          11
ÜBERBLICK
       Graphenprozessierung vs. Graphendatenbank




OLAP               Graph affin                                                               OLTP




                                RDBMS
                   Universell




                                   Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx

                          11
ÜBERBLICK
       Graphenprozessierung vs. Graphendatenbank




OLAP               Graph affin                                                               OLTP


          Hadoop


                                RDBMS
                   Universell




                                   Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx

                          11
ÜBERBLICK
                Graphenprozessierung vs. Graphendatenbank




                            Graph affin
       Pregel




OLAP                                                                                                 OLTP


                   Hadoop


                                         RDBMS
                            Universell




                                            Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx

                                   11
ÜBERBLICK
                Graphenprozessierung vs. Graphendatenbank




                            Graph affin
                                     Graphendatenbanken


       Pregel




OLAP                                                                                                 OLTP


                   Hadoop


                                         RDBMS
                            Universell




                                            Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx

                                   11
ÜBERBLICK
                Graphenprozessierung vs. Graphendatenbank




                            Graph affin
                                                                      In-Memory
                                     Graphendatenbanken
                                                                  Graphendatenbanken


       Pregel




OLAP                                                                                                 OLTP


                   Hadoop


                                         RDBMS
                            Universell




                                            Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx

                                   11
ÜBERBLICK
                                                      Graphendatenbanken

•   Neo4J                             •   HypergraphDB
•   InfiniteGraph (Objectivity)        •   DEX
•   Sones GraphDB                     •   FlockDB (Twitter)
•   AllegroGraph                      •   Trinity (Microsoft)
•   OrientDB                          •   Fallen-8


                                             Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german

                                 12
13
NEO4J
                                                            Überblick

•   Graphendatenbank + Lucene Index

•   ACID (Isolationsgrad read committed)

•   Hoch-Verfügbarkeit (HA) in Enterprise Edition

•   32 Mrd. Knoten, 32 Mrd. Kanten, 64 Mrd. Eigenschaften

•   Embedded oder via REST-API

•   Support für Blueprints
                                  14
NEO4J
                                                                        Architektur


       Cypher/Gremlin                 Java/Ruby/.../C# API

                          REST API

                        Core API (Java)

Caches (Dateisystem & Objekt)                   HA

       Record Dateien                     Transaktions-Log

                            Disk(s)

                                                      Quelle: http://www.slideshare.net/rheehot/eo4j-12713065

                              15
NEO4J
                      kennt
                                   Ondisk Layout Beispiel
                                               Name: Bob
                                               Alter: 42




Name: Alice
Alter: 23
                                              kennt




              kennt


                                     Name: Carol
                                     Alter: 22



                                                   Quelle: https://github.com/thobe/presentations

                              16
NEO4J
                              kennt
                                           Ondisk Layout Beispiel
                                                       Name: Bob
                                                       Alter: 42




                                                                           Name
        Name: Alice                                                         Bob
Name    Alter: 23
Alice                                                 kennt
                                                                            Alter
                                                                             42
Alter
 23
                      kennt
                                                                Name
                                                                Carol
                                             Name: Carol
                                             Alter: 22
                                                                Alter
                                                                  22
                                                           Quelle: https://github.com/thobe/presentations

                                      16
NEO4J
                                    kennt
                                                           Ondisk Layout Beispiel
                                     SP     EP                            Name: Bob
                                     SN EN                                Alter: 42
                                         kennt



                                                                                              Name
              Name: Alice                             SP   EP                                  Bob
Name          Alter: 23
                            SP      EP                SN EN
Alice                                                                    kennt
                            SN EN                      kennt                                   Alter
                             kennt                                                              42
Alter
 23
                            kennt
                                                                                   Name
 SP Source Previous
                                                                                   Carol
SN Source Next                                                  Name: Carol
EP End Previous                                                 Alter: 22
EN End Next                                                                        Alter
                                                                                     22
        Vorhanden
        Nicht vorhanden                                                       Quelle: https://github.com/thobe/presentations

                                                 16
NEO4J
                                    kennt
                                                           Ondisk Layout Beispiel
                                     SP     EP                            Name: Bob
                                     SN EN                                Alter: 42
                                         kennt



                                                                                              Name
              Name: Alice                             SP   EP                                  Bob
Name          Alter: 23
                            SP      EP                SN EN
Alice                                                                    kennt
                            SN EN                      kennt                                   Alter
                             kennt                                                              42
Alter
 23
                            kennt
                                                                                   Name
 SP Source Previous
                                                                                   Carol
SN Source Next                                                  Name: Carol
EP End Previous                                                 Alter: 22
EN End Next                                                                        Alter
                                                                                     22
        Vorhanden
        Nicht vorhanden                                                       Quelle: https://github.com/thobe/presentations

                                                 16
NEO4J
                                                                          InMemory Layout (Cache)
         ID
                                Relationship ID refs
                         in:    R1      R2       ...    Rn
         Typ 1
                         out    R1       R2      ...    Rn
                                                                            •   Transformation von
Knoten        ...       Nach Typ gruppiert (Typ = z.B. „kennt“)                 doppelt verketteter Liste
         Typ 1
                        in:     R1       R2     ...    Rn                       zu Objekten
                        out     R1       R2     ...    Rn


           Key 1                Key 2            ...          Key n         •   Erhöhung der
                                                                                Traversierungs-
                Val 1




                                 Val 2




                                                                  Val n
                                                                                Geschwindigkeit
         ID             start            end           type
Kante
           Key 1                Key 2            ...          Key n
                Val 1




                                 Val 2




                                                                  Val n




                                                                                         Quelle: https://github.com/thobe/presentations

                                                         17
NEO4J
                                                       Traversierung

•   Relationship-Expander (liefert Kanten, welche von einem Knoten
    abgehen)

•   Evaluatoren (evaluieren ob ein Knoten traversiert werden soll
    oder z.B. in die Ergebnis-Menge aufgenommen wird)

•   Projektion der Ergebnismenge (z.B. „nimm nur den letzten Knoten
    des Pfades“

•   Uniqueness level (legt in Abstufungen fest, ob ein Knoten
    mehrmals besucht werden darf)
                                                      Quelle: https://github.com/thobe/presentations

                                   18
NEO4J
                                                                                           Cypher & Gremlin
  Merkmal                         Gremlin                                                       Cypher

 Paradigma               Imperative Programmierung                                   Deklarative Programmierung

             •Entwickelt von Marko Rodriguez (Tinkerpop)          •Eigenentwicklung
             •Basiert auf xpath um Traversierung zu beschreiben   •Annäherung an SQL
Beschreibung •Umgesetzt mit Groovy                                •Cypher bietet mehr Möglichkeiten für Optimierungen
             •Bei „einfachen“ Traversierungen ist Gremlin         •Ideal für Traversierungen, bei denen back tracking erforderlich ist.
              30-50% schneller                                    •Zeilenweise Ausgabe des Ergebnisses
                                                                  START
                                                                   me=node:people(name={myname})
                                                                  MATCH
                                                                   me-[:HAS_CART]->cart-[:CONTAINS_ITEM]->item
              outE[label=HAS_CART].inV                             item<-[:PURCHASED]-user-[:PURCHASED]->recommendation
               .outE[label=CONTAINS_ITEM].inV                     RETURN recommendation
  Beispiel
               .inE[label=PURCHASED].outV
               .outE[label=PURCHASED].inV                         START
                                                                   d=node(1), e=node(2)
                                                                  MATCH
                                                                   p = shortestPath( d-[*..15]->e )
                                                                  RETURN p
                                                                                                      Quelle: https://github.com/thobe/presentations

                                                             19
NEO4J
                                                   WebAdmin




     Quelle: http://docs.neo4j.org/chunked/stable/images/operations/webadmin-overview.png

20
NEO4J
                                                                                  Preise

                                                                        Preis
  Edition            Lizenz                     Beschreibung
                                                                     (jährlich)


                                          Komplette Datenbank mit
                  Open Source
„Community“                                   grundlegender             0 €
                   (GPLv3)
                                          Management-Oberfläche



                                                    +
                                           Monitoring, erweiterte
„Advanced“     Commercial and AGPL                                   6.000 €
                                          Management-Oberfläche
                                               und Support



                                                      +
„Enterprise“   Commercial and AGPL        Enterprise Oberfläche, HA   24.000 €
                                            und premium Support



                                     21
22
INFINITEGRAPH
                                                                Überblick

•   Verteilte Graphendatenbank

    •   Implementiert in C++ (APIs in Java, C#, Python, etc.)

•   Basiert auf Objectivity/DB (verteilte Objektdatenbank)

    •   Seit 1988 in Sunnyvale, California

    •   Enterprise-Kunden + US-Regierung

•   Support für Blueprints
                                      23
INFINITEGRAPH
                                                                        Architektur
               User Apps
                                                     Blueprints#


                                IG#Core/API#


Management#       Naviga0on#                    Session#/#TX#
                                 Placement#                        Configura0on#
 Extensions#      Execu0on#                     Management#



                     Objec0vity/DB#Distributed#Database#




                                                                              Copyright © InfiniteGraph

                                     24
INFINITEGRAPH
                                                                   Einfügen
                              AppD2#
   AppD1#                                              AppD3#
                           (Ingest#V2)#
(Ingest#V1)#                                        (Ingest#V3)#
                                #

                          IG#Core/API#


        Standard#Blocking#Ingest/Placement#(MDP#Plugin)#
                        Objec@vity/DB#




                                                                   Copyright © InfiniteGraph

                               25
INFINITEGRAPH
                                                                   Einfügen
                              AppD2#
   AppD1#                                              AppD3#
                           (Ingest#V2)#
(Ingest#V1)#                                        (Ingest#V3)#
                                #

                          IG#Core/API#


        Standard#Blocking#Ingest/Placement#(MDP#Plugin)#
                        Objec@vity/DB#



V1#                             V2#                           V3#



                                                                    Copyright © InfiniteGraph

                               25
INFINITEGRAPH
                                                                     Einfügen
                               AppD2#
   App#1%
    AppD1#                     App#2%                    App#3%
                                                         AppD3#
                            (Ingest#V2)#
 (Ingest#V )#
(E1%2{%V1V21})%             (E23{%V2V3})%             (Ingest#V3)#
                                                           %
                                  #

                            IG#Core/API#


          Standard#Blocking#Ingest/Placement#(MDP#Plugin)#
                          Objec@vity/DB#



V1#                              V2#                            V3#



                                                                      Copyright © InfiniteGraph

                                25
INFINITEGRAPH
                                                                      Einfügen
                               AppD2#
   App#1%
    AppD1#                     App#2%                     App#3%
                                                          AppD3#
                            (Ingest#V2)#
 (Ingest#V )#
(E1%2{%V1V21})%             (E23{%V2V3})%              (Ingest#V3)#
                                                            %
                                  #

                            IG#Core/API#


          Standard#Blocking#Ingest/Placement#(MDP#Plugin)#
                          Objec@vity/DB#



V1#               E12$           V2#            E23$             V3#



                                                                       Copyright © InfiniteGraph

                                25
INFINITEGRAPH
                                                                      Einfügen
                               AppD2#
   App#1%
    AppD1#                     App#2%                     App#3%
                                                          AppD3#
                            (Ingest#V2)#
 (Ingest#V )#
(E1%2{%V1V21})%             (E23{%V2V3})%              (Ingest#V3)#
                                                            %
                                  #

                            IG#Core/API#


          Standard#Blocking#Ingest/Placement#(MDP#Plugin)#
                          Objec@vity/DB#



V1#               E12$           V2#            E23$             V3#



                                                                       Copyright © InfiniteGraph

                                25
INFINITEGRAPH
                                                             Code (Einfügen)



Vertex alice = myGraph.addVertex(new Person(“Alice”));
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);
bob.addEdge(new Call(timestamp), charlie);



                                                                    Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                               Code (Einfügen)

                                                             Alice



Vertex alice = myGraph.addVertex(new Person(“Alice”));
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);
bob.addEdge(new Call(timestamp), charlie);



                                                                      Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                               Code (Einfügen)

                                                             Alice



Vertex alice = myGraph.addVertex(new Person(“Alice”));                    Bob
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);
bob.addEdge(new Call(timestamp), charlie);



                                                                      Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                               Code (Einfügen)

                                                             Alice



Vertex alice = myGraph.addVertex(new Person(“Alice”));                    Bob
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);                        Carlos
bob.addEdge(new Call(timestamp), charlie);



                                                                      Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                                Code (Einfügen)

                                                              Alice



Vertex alice = myGraph.addVertex(new Person(“Alice”));                     Bob
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);                         Carlos
bob.addEdge(new Call(timestamp), charlie);


                                                             Charlie
                                                                       Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                                Code (Einfügen)

                                                              Alice
                                                                       meets



Vertex alice = myGraph.addVertex(new Person(“Alice”));                             Bob
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);                                 Carlos
bob.addEdge(new Call(timestamp), charlie);


                                                             Charlie
                                                                               Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                                Code (Einfügen)

                                                              Alice
                                                                       meets



Vertex alice = myGraph.addVertex(new Person(“Alice”));                             Bob
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));
                                                                                        calls

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);                                 Carlos
bob.addEdge(new Call(timestamp), charlie);


                                                             Charlie
                                                                               Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                                Code (Einfügen)

                                                              Alice
                                                                       meets



Vertex alice = myGraph.addVertex(new Person(“Alice”));                             Bob
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));
                                                                                        calls

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);                                 Carlos
bob.addEdge(new Call(timestamp), charlie);
                                                                       pays


                                                             Charlie
                                                                               Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                                Code (Einfügen)

                                                              Alice
                                                                               meets



Vertex alice = myGraph.addVertex(new Person(“Alice”));                                     Bob
Vertex bob = myGraph.addVertex(new Person(“Bob”));
Vertex carlos = myGraph.addVertex(new Person(“Carlos”));
Vertex charlie = myGraph.addVertex(new Person(“Charlie”));
                                                                       calls                    calls

alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob);
bob.addEdge(new Call(timestamp), carlos);
carlos.addEdge(new Payment(100000.00), charlie);                                         Carlos
bob.addEdge(new Call(timestamp), charlie);
                                                                               pays


                                                             Charlie
                                                                                       Copyright © InfiniteGraph

                                              26
INFINITEGRAPH
                                                                       Code (Navigator)

// Create a qualifier that describes the target vertex
Qualifier findCharliePredicate =
	

 new VertexPredicate(personType, "name == ’Charlie'");

// Construct a navigator which starts with Alice and uses a result qualifier
// to find all paths in the graph to Charlie
Navigator charlieFinder = alice.navigate(
	

 Guide.SIMPLE_BREADTH_FIRST,	

 // default guide 	

     Qualifier.ANY, 	

 	

 	

 // no path constraints
	

 findCharliePredicate ,	

	

 // find paths ending with Charlie
     myResultHandler);	

       // fire results to supplied handler

// Start the navigator
charlieFinder.start();
                                                                               Copyright © InfiniteGraph

                                                 27
INFINITEGRAPH
        Visualisierung




             Copyright © InfiniteGraph

28
INFINITEGRAPH
                                                                                                        Preise

                                                                                       Preis
        Edition              Lizenz                 Beschreibung
                                                                                    (jährlich)



                                              Beschränkung auf 1 Million
„InfiniteGraph FREE“           Frei                                                      0 €
                                                 Knoten oder Kanten




                                                                              fängt bei ca. 5000 € an
   „Pay as you go“         Kommerziell           Volle Funktionalität      (in Abhängigkeit der Anzahl
                                                                                Knoten und Kanten)



                                                 Volle Funktionalität,
                                                                                      >..... €
„Unit or site licensing“   Kommerziell         fokussiert auf „größere“
                                                                           (Betrag wird nicht genannt)
                                                    Umgebungen

                                                                                Quelle: http://www.infinitegraph.com/options/

                                         29
30
FALLEN-8
                                                           Überblick

•   In-Memory Graphendatenbank

•   Entwickelt in C# (Plattform unabhängig)

•   4 Mrd. Knoten oder Kanten, jedes Element kann ca. 200 Mio.
    Eigenschaften haben

•   Indexe auf Knoten oder/und Kanten

•   Kern ist Open Source (MIT-Lizenz), Plugins sind variabel

                                   31
FALLEN-8
                                                          Persistenz

•   Persistenz in Form von „Save-Points“, d.h. alle Knoten und Kanten
    werden komplett serialisiert

•   Je nach Geschwindigkeit der HDD können ca. 2 Mio. Knoten oder
    Kanten pro Sekunde (de)serialisiert werden.

•   Das Speichern des Graphen blockiert lediglich schreibende
    Operationen

•   Performance + Verlässlichkeit

                                    32
FALLEN-8
                                 Architektur


      Services

Traversierungs-         Index-
  Framework          Framework

      Core API

 Knoten und Kanten

        RAM




         33
FALLEN-8
                            Architektur inklusive Plugins


         HA inklusive ACID Transaktionen

REST API (via JSON) + Management/Query Oberfläche

     Traversierungs-Framework       Index-Framework
         (inkl Pfad Analyse)       (inkl R* Tree Index)

                    Core API

               Knoten und Kanten

                      RAM


                       34
FALLEN-8
Benchmark - friends of a friend




35
FALLEN-8
    Benchmark - friends of a friend




1




    35
FALLEN-8
        Benchmark - friends of a friend



    2




    3


1


    4




    5




        35
FALLEN-8
        Benchmark - friends of a friend
                    6


                    7


                    8
    2

                    9



    3               10


1
                    11

    4
                    12


                    13
    5

                    14


                    15


                    16
        35
FALLEN-8
                             Benchmark - friends of a friend

                  Fallen-8                Neo4J
          5.000


          4.000


          3.000
t in ms




          2.000


          1.000


             0
                              Durchlauf
                                                      Quelle: Martin Junghanns

                             36
FALLEN-8
Benchmark - traversals per second




                         Quelle: Sebastian Dechant

   37
FALLEN-8
    Benchmark - traversals per second

1




                             Quelle: Sebastian Dechant

       37
FALLEN-8
    Benchmark - traversals per second

1




                             Quelle: Sebastian Dechant

       37
FALLEN-8
    Benchmark - traversals per second

1                     2




                             Quelle: Sebastian Dechant

       37
FALLEN-8
                                      Benchmark - traversals per second

             1                                                           2



Graph: |V| = 10000, |E| = 600.000 (gleichverteilt)
System: Windows Server 2008 R2, Intel Xeon E5620 (2,40 GHz), 6 GB RAM




                                                                             Quelle: Sebastian Dechant

                                               37
FALLEN-8
                                                           Benchmark - traversals per second

                                 1                                                                        2



                    Graph: |V| = 10000, |E| = 600.000 (gleichverteilt)
                    System: Windows Server 2008 R2, Intel Xeon E5620 (2,40 GHz), 6 GB RAM


     MySQL                                                      62.168
 PostgreSQL                                                      78.449
      Neo4J                                                                  943.580
InfiniteGraph                                                              1.243.084
     Fallen-8                                                                                           196.930.256
                1          10          100         1.000        10.000       100.000        1.000.000    10.000.000   100.000.000 1.000.000.000

                                                                 traversals / sec
                                                                                                                          Quelle: Sebastian Dechant

                                                                   37
FALLEN-8
                                                      Roadmap

•   Release: 23.05.2012

•   Q3 2012

    •   Spatial index (MIT)

    •   High availability (MIT) using Amazon EC2

•   2013

    •   Graph partitioning (MIT or ???)
                                      38
DANKE
                           &
                          Q&A
Email: Henning@RauchEntwicklung.biz
Url: http://www.NoSQL-Database.com
Twitter: http://www.twitter.com/cosh23


                                39

Weitere ähnliche Inhalte

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Vorlesung Graphendatenbanken an der Universität Hof

  • 1. GRAPHENDATENBANKEN Henning Rauch Universität Hof - 04.05.2012 1
  • 2. AGENDA • Überblick • Neo4J • InfiniteGraph • Fallen-8 2
  • 3. ÜBERBLICK Warum macht es Sinn sich damit zu beschäftigen „Graph databases will come into vogue. One key gap in the Hadoop ecosystem is for graph databases, which support rich mining and visualization of relationships, influence, and behavioral propensities. The market for graph databases will boom in 2012 as companies everywhere adopt them for social media analytics, marketing campaign optimization, and customer experience fine-tuning. We will see VCs put big money behind graph database and analytics startups. Many big data platform and tool vendors will acquire the startups to supplement their expanding Hadoop, NoSQL, and enterprise data warehousing (EDW) portfolios. Social graph analysis, although not a brand-new field, will become one of the most prestigious specialties in the data science arena, focusing on high-powered drilldown into polystructured behavioral data sets.“ Quelle: http://blogs.forrester.com/james_kobielus/11-12-19-the_year_ahead_in_big_data_big_cool_new_stuff_looms_large 3
  • 4. ÜBERBLICK Beispiel eines Realworld Graphen - facebook Quelle: http://www.facebook.com/press/info.php?statistics 4
  • 5. ÜBERBLICK Beispiel eines Realworld Graphen - NYT „Cascade“ Quelle: http://nytlabs.com/projects/cascade.html 5
  • 6. ÜBERBLICK Beispiel eines Realworld Graphen - Telefon-Rechnung 6
  • 7. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB 7
  • 8. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Id Name 0 Henning Rauch 1 René Peinl 2 Foo Bar 3 Bruce Schneier 4 Linus Torwalds 7
  • 9. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person 2 Id Name 3 0 Henning Rauch 1 René Peinl 2 Foo Bar 3 Bruce Schneier 4 4 Linus Torwalds 1 0 7
  • 10. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Kennt_rel 2 Id Name Id_1 Id_2 3 0 Henning Rauch 1 0 1 René Peinl 1 2 2 Foo Bar 1 3 3 Bruce Schneier 1 4 4 4 Linus Torwalds 0 1 1 0 2 0 3 0 4 3 4 4 3 0 7
  • 11. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Kennt_rel 2 Id Name Id_1 Id_2 3 0 Henning Rauch 1 0 1 René Peinl 1 2 2 Foo Bar 1 3 3 Bruce Schneier 1 4 4 4 Linus Torwalds 0 1 1 0 2 0 3 0 4 3 4 4 3 0 7
  • 12. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Kennt_rel 2 Id Name Id_1 Id_2 3 0 Henning Rauch 1 0 1 René Peinl 1 2 2 Foo Bar 1 3 3 Bruce Schneier 1 4 4 4 Linus Torwalds 0 1 1 0 2 0 3 0 4 3 4 4 3 0 Tag Id Name 0 .NET 1 Java 2 PKI 3 NoSQL 7
  • 13. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Kennt_rel 2 Id Name Id_1 Id_2 3 0 Henning Rauch Java 1 0 1 René Peinl 1 2 2 Foo Bar 1 3 3 Bruce Schneier 1 4 4 4 Linus Torwalds 0 1 1 0 2 0 3 0 4 3 4 4 3 0 Tag NoSQL Id Name .NET 0 .NET PKI 1 Java 2 PKI 3 NoSQL 7
  • 14. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Kennt_rel 2 Id Name Id_1 Id_2 3 0 Henning Rauch Java 1 0 1 René Peinl 1 2 2 Foo Bar 1 3 3 Bruce Schneier 1 4 4 4 Linus Torwalds 0 1 1 0 2 0 3 0 4 3 4 4 3 0 Tag Tags_rel NoSQL Id Name Tag_Id Person_Id Signifikanz .NET 0 .NET 0 0 5 PKI 1 Java 1 1 5 2 PKI 2 1 6 3 NoSQL 2 3 10 3 0 7 3 1 7 7
  • 15. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Kennt_rel 2 Id Name Id_1 Id_2 3 0 Henning Rauch Java 1 0 1 René Peinl 1 2 10 2 Foo Bar 1 3 5 3 Bruce Schneier 1 4 4 4 Linus Torwalds 0 1 1 0 2 0 3 0 4 3 4 7 4 3 0 5 Tag Tags_rel NoSQL 7 Id Name Tag_Id Person_Id Signifikanz .NET 0 .NET 0 0 5 6 PKI 1 Java 1 1 5 2 PKI 2 1 6 3 NoSQL 2 3 10 3 0 7 3 1 7 7
  • 16. ÜBERBLICK Abgrenzung zu RDBMS - Property graph RDBMS GraphDB Person Kennt_rel 2 Id Name Id_1 Id_2 3 0 Henning Rauch Java 1 0 1 René Peinl 1 2 10 2 Foo Bar 1 3 5 3 Bruce Schneier 1 4 4 4 Linus Torwalds 0 1 1 0 2 0 3 0 4 3 4 7 4 3 0 5 Tag Tags_rel NoSQL 7 Id Name Tag_Id Person_Id Signifikanz .NET 0 .NET 0 0 5 6 PKI 1 Java 1 1 5 2 PKI 2 1 6 3 NoSQL 2 3 3 0 10 7 Knoten = 3 1 7 7 Eigenschaften + Kanten
  • 17. ÜBERBLICK Abgrenzung zu RDBMS - Skalierbarkeit Kennt_rel Id_1 Id_2 • Relations-Tabellen sind das Problem, sie agieren als 1 1 0 2 globaler Index über Beziehungen zwischen Daten 1 1 3 4 0 1 Je größer die Relation, desto länger dauert es die 0 2 • 0 3 interessante Information (z.B. Nachbarschaft) zu 0 3 4 4 finden 4 3 Tags_rel • Lösung der Graphendatenbank: Information über Tag_Id 0 Person_Id 0 Signifikanz 5 Beziehungen (Kanten) werden lokal am Knoten 1 1 5 abgelegt 2 1 6 2 3 10 3 0 7 3 1 7 8
  • 18. ÜBERBLICK Abgrenzung zu RDBMS - Aber aber aber • Aufgabe: Finde Personen, welche 0 kennt. • Lineares Scannen der Relationen-Tabelle: O(n) Kennt_rel Id_1 Id_2 1 0 1 2 • Abfragen eines Index: O(log n) 1 3 1 4 0 1 • Bei RDBMS große Performance-Einbrüche bei 0 0 2 3 rekursiven Such-Algorithmen (da Abhängigkeit zu n) 0 4 3 4 4 3 • Graphendatenbanken lösen diese Aufgabe i.A. in O(1), unabhängig von der Gesamtgröße des Graphen 9
  • 19. ÜBERBLICK Abgrenzung zu anderen NoSQL Produkten Größe > 90% der Anwendungsfälle Komplexität Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german 10
  • 20. ÜBERBLICK Abgrenzung zu anderen NoSQL Produkten Größe Key/Value stores > 90% der Anwendungsfälle Komplexität Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german 10
  • 21. ÜBERBLICK Abgrenzung zu anderen NoSQL Produkten Größe Key/Value stores Bigtable clones > 90% der Anwendungsfälle Komplexität Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german 10
  • 22. ÜBERBLICK Abgrenzung zu anderen NoSQL Produkten Größe Key/Value stores Bigtable clones Dokument Datenbanken > 90% der Anwendungsfälle Komplexität Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german 10
  • 23. ÜBERBLICK Abgrenzung zu anderen NoSQL Produkten Größe Key/Value stores Bigtable clones Dokument Datenbanken Graphendatenbanken > 90% der Anwendungsfälle Komplexität Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german 10
  • 24. ÜBERBLICK Abgrenzung zu anderen NoSQL Produkten Größe Key/Value stores Bigtable clones Dokument Datenbanken Graphendatenbanken In-Memory Graphendatenbanken > 90% der Anwendungsfälle Komplexität Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german 10
  • 25. ÜBERBLICK Graphenprozessierung vs. Graphendatenbank OLAP Graph affin Universell OLTP Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx 11
  • 26. ÜBERBLICK Graphenprozessierung vs. Graphendatenbank OLAP Graph affin OLTP RDBMS Universell Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx 11
  • 27. ÜBERBLICK Graphenprozessierung vs. Graphendatenbank OLAP Graph affin OLTP Hadoop RDBMS Universell Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx 11
  • 28. ÜBERBLICK Graphenprozessierung vs. Graphendatenbank Graph affin Pregel OLAP OLTP Hadoop RDBMS Universell Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx 11
  • 29. ÜBERBLICK Graphenprozessierung vs. Graphendatenbank Graph affin Graphendatenbanken Pregel OLAP OLTP Hadoop RDBMS Universell Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx 11
  • 30. ÜBERBLICK Graphenprozessierung vs. Graphendatenbank Graph affin In-Memory Graphendatenbanken Graphendatenbanken Pregel OLAP OLTP Hadoop RDBMS Universell Quelle: http://jim.webber.name/2011/08/24/66f1fb4b-83c3-4f52-af40-ee6382ad2155.aspx 11
  • 31. ÜBERBLICK Graphendatenbanken • Neo4J • HypergraphDB • InfiniteGraph (Objectivity) • DEX • Sones GraphDB • FlockDB (Twitter) • AllegroGraph • Trinity (Microsoft) • OrientDB • Fallen-8 Quelle: http://www.slideshare.net/jexp/neo4j-graph-database-presentation-german 12
  • 32. 13
  • 33. NEO4J Überblick • Graphendatenbank + Lucene Index • ACID (Isolationsgrad read committed) • Hoch-Verfügbarkeit (HA) in Enterprise Edition • 32 Mrd. Knoten, 32 Mrd. Kanten, 64 Mrd. Eigenschaften • Embedded oder via REST-API • Support für Blueprints 14
  • 34. NEO4J Architektur Cypher/Gremlin Java/Ruby/.../C# API REST API Core API (Java) Caches (Dateisystem & Objekt) HA Record Dateien Transaktions-Log Disk(s) Quelle: http://www.slideshare.net/rheehot/eo4j-12713065 15
  • 35. NEO4J kennt Ondisk Layout Beispiel Name: Bob Alter: 42 Name: Alice Alter: 23 kennt kennt Name: Carol Alter: 22 Quelle: https://github.com/thobe/presentations 16
  • 36. NEO4J kennt Ondisk Layout Beispiel Name: Bob Alter: 42 Name Name: Alice Bob Name Alter: 23 Alice kennt Alter 42 Alter 23 kennt Name Carol Name: Carol Alter: 22 Alter 22 Quelle: https://github.com/thobe/presentations 16
  • 37. NEO4J kennt Ondisk Layout Beispiel SP EP Name: Bob SN EN Alter: 42 kennt Name Name: Alice SP EP Bob Name Alter: 23 SP EP SN EN Alice kennt SN EN kennt Alter kennt 42 Alter 23 kennt Name SP Source Previous Carol SN Source Next Name: Carol EP End Previous Alter: 22 EN End Next Alter 22 Vorhanden Nicht vorhanden Quelle: https://github.com/thobe/presentations 16
  • 38. NEO4J kennt Ondisk Layout Beispiel SP EP Name: Bob SN EN Alter: 42 kennt Name Name: Alice SP EP Bob Name Alter: 23 SP EP SN EN Alice kennt SN EN kennt Alter kennt 42 Alter 23 kennt Name SP Source Previous Carol SN Source Next Name: Carol EP End Previous Alter: 22 EN End Next Alter 22 Vorhanden Nicht vorhanden Quelle: https://github.com/thobe/presentations 16
  • 39. NEO4J InMemory Layout (Cache) ID Relationship ID refs in: R1 R2 ... Rn Typ 1 out R1 R2 ... Rn • Transformation von Knoten ... Nach Typ gruppiert (Typ = z.B. „kennt“) doppelt verketteter Liste Typ 1 in: R1 R2 ... Rn zu Objekten out R1 R2 ... Rn Key 1 Key 2 ... Key n • Erhöhung der Traversierungs- Val 1 Val 2 Val n Geschwindigkeit ID start end type Kante Key 1 Key 2 ... Key n Val 1 Val 2 Val n Quelle: https://github.com/thobe/presentations 17
  • 40. NEO4J Traversierung • Relationship-Expander (liefert Kanten, welche von einem Knoten abgehen) • Evaluatoren (evaluieren ob ein Knoten traversiert werden soll oder z.B. in die Ergebnis-Menge aufgenommen wird) • Projektion der Ergebnismenge (z.B. „nimm nur den letzten Knoten des Pfades“ • Uniqueness level (legt in Abstufungen fest, ob ein Knoten mehrmals besucht werden darf) Quelle: https://github.com/thobe/presentations 18
  • 41. NEO4J Cypher & Gremlin Merkmal Gremlin Cypher Paradigma Imperative Programmierung Deklarative Programmierung •Entwickelt von Marko Rodriguez (Tinkerpop) •Eigenentwicklung •Basiert auf xpath um Traversierung zu beschreiben •Annäherung an SQL Beschreibung •Umgesetzt mit Groovy •Cypher bietet mehr Möglichkeiten für Optimierungen •Bei „einfachen“ Traversierungen ist Gremlin •Ideal für Traversierungen, bei denen back tracking erforderlich ist. 30-50% schneller •Zeilenweise Ausgabe des Ergebnisses START me=node:people(name={myname}) MATCH me-[:HAS_CART]->cart-[:CONTAINS_ITEM]->item outE[label=HAS_CART].inV item<-[:PURCHASED]-user-[:PURCHASED]->recommendation .outE[label=CONTAINS_ITEM].inV RETURN recommendation Beispiel .inE[label=PURCHASED].outV .outE[label=PURCHASED].inV START d=node(1), e=node(2) MATCH p = shortestPath( d-[*..15]->e ) RETURN p Quelle: https://github.com/thobe/presentations 19
  • 42. NEO4J WebAdmin Quelle: http://docs.neo4j.org/chunked/stable/images/operations/webadmin-overview.png 20
  • 43. NEO4J Preise Preis Edition Lizenz Beschreibung (jährlich) Komplette Datenbank mit Open Source „Community“ grundlegender 0 € (GPLv3) Management-Oberfläche + Monitoring, erweiterte „Advanced“ Commercial and AGPL 6.000 € Management-Oberfläche und Support + „Enterprise“ Commercial and AGPL Enterprise Oberfläche, HA 24.000 € und premium Support 21
  • 44. 22
  • 45. INFINITEGRAPH Überblick • Verteilte Graphendatenbank • Implementiert in C++ (APIs in Java, C#, Python, etc.) • Basiert auf Objectivity/DB (verteilte Objektdatenbank) • Seit 1988 in Sunnyvale, California • Enterprise-Kunden + US-Regierung • Support für Blueprints 23
  • 46. INFINITEGRAPH Architektur User Apps Blueprints# IG#Core/API# Management# Naviga0on# Session#/#TX# Placement# Configura0on# Extensions# Execu0on# Management# Objec0vity/DB#Distributed#Database# Copyright © InfiniteGraph 24
  • 47. INFINITEGRAPH Einfügen AppD2# AppD1# AppD3# (Ingest#V2)# (Ingest#V1)# (Ingest#V3)# # IG#Core/API# Standard#Blocking#Ingest/Placement#(MDP#Plugin)# Objec@vity/DB# Copyright © InfiniteGraph 25
  • 48. INFINITEGRAPH Einfügen AppD2# AppD1# AppD3# (Ingest#V2)# (Ingest#V1)# (Ingest#V3)# # IG#Core/API# Standard#Blocking#Ingest/Placement#(MDP#Plugin)# Objec@vity/DB# V1# V2# V3# Copyright © InfiniteGraph 25
  • 49. INFINITEGRAPH Einfügen AppD2# App#1% AppD1# App#2% App#3% AppD3# (Ingest#V2)# (Ingest#V )# (E1%2{%V1V21})% (E23{%V2V3})% (Ingest#V3)# % # IG#Core/API# Standard#Blocking#Ingest/Placement#(MDP#Plugin)# Objec@vity/DB# V1# V2# V3# Copyright © InfiniteGraph 25
  • 50. INFINITEGRAPH Einfügen AppD2# App#1% AppD1# App#2% App#3% AppD3# (Ingest#V2)# (Ingest#V )# (E1%2{%V1V21})% (E23{%V2V3})% (Ingest#V3)# % # IG#Core/API# Standard#Blocking#Ingest/Placement#(MDP#Plugin)# Objec@vity/DB# V1# E12$ V2# E23$ V3# Copyright © InfiniteGraph 25
  • 51. INFINITEGRAPH Einfügen AppD2# App#1% AppD1# App#2% App#3% AppD3# (Ingest#V2)# (Ingest#V )# (E1%2{%V1V21})% (E23{%V2V3})% (Ingest#V3)# % # IG#Core/API# Standard#Blocking#Ingest/Placement#(MDP#Plugin)# Objec@vity/DB# V1# E12$ V2# E23$ V3# Copyright © InfiniteGraph 25
  • 52. INFINITEGRAPH Code (Einfügen) Vertex alice = myGraph.addVertex(new Person(“Alice”)); Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); bob.addEdge(new Call(timestamp), charlie); Copyright © InfiniteGraph 26
  • 53. INFINITEGRAPH Code (Einfügen) Alice Vertex alice = myGraph.addVertex(new Person(“Alice”)); Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); bob.addEdge(new Call(timestamp), charlie); Copyright © InfiniteGraph 26
  • 54. INFINITEGRAPH Code (Einfügen) Alice Vertex alice = myGraph.addVertex(new Person(“Alice”)); Bob Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); bob.addEdge(new Call(timestamp), charlie); Copyright © InfiniteGraph 26
  • 55. INFINITEGRAPH Code (Einfügen) Alice Vertex alice = myGraph.addVertex(new Person(“Alice”)); Bob Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); Carlos bob.addEdge(new Call(timestamp), charlie); Copyright © InfiniteGraph 26
  • 56. INFINITEGRAPH Code (Einfügen) Alice Vertex alice = myGraph.addVertex(new Person(“Alice”)); Bob Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); Carlos bob.addEdge(new Call(timestamp), charlie); Charlie Copyright © InfiniteGraph 26
  • 57. INFINITEGRAPH Code (Einfügen) Alice meets Vertex alice = myGraph.addVertex(new Person(“Alice”)); Bob Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); Carlos bob.addEdge(new Call(timestamp), charlie); Charlie Copyright © InfiniteGraph 26
  • 58. INFINITEGRAPH Code (Einfügen) Alice meets Vertex alice = myGraph.addVertex(new Person(“Alice”)); Bob Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); calls alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); Carlos bob.addEdge(new Call(timestamp), charlie); Charlie Copyright © InfiniteGraph 26
  • 59. INFINITEGRAPH Code (Einfügen) Alice meets Vertex alice = myGraph.addVertex(new Person(“Alice”)); Bob Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); calls alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); Carlos bob.addEdge(new Call(timestamp), charlie); pays Charlie Copyright © InfiniteGraph 26
  • 60. INFINITEGRAPH Code (Einfügen) Alice meets Vertex alice = myGraph.addVertex(new Person(“Alice”)); Bob Vertex bob = myGraph.addVertex(new Person(“Bob”)); Vertex carlos = myGraph.addVertex(new Person(“Carlos”)); Vertex charlie = myGraph.addVertex(new Person(“Charlie”)); calls calls alice.addEdge(new Meeting(“Denver”, “5-27-10”), bob); bob.addEdge(new Call(timestamp), carlos); carlos.addEdge(new Payment(100000.00), charlie); Carlos bob.addEdge(new Call(timestamp), charlie); pays Charlie Copyright © InfiniteGraph 26
  • 61. INFINITEGRAPH Code (Navigator) // Create a qualifier that describes the target vertex Qualifier findCharliePredicate = new VertexPredicate(personType, "name == ’Charlie'"); // Construct a navigator which starts with Alice and uses a result qualifier // to find all paths in the graph to Charlie Navigator charlieFinder = alice.navigate( Guide.SIMPLE_BREADTH_FIRST, // default guide Qualifier.ANY, // no path constraints findCharliePredicate , // find paths ending with Charlie myResultHandler); // fire results to supplied handler // Start the navigator charlieFinder.start(); Copyright © InfiniteGraph 27
  • 62. INFINITEGRAPH Visualisierung Copyright © InfiniteGraph 28
  • 63. INFINITEGRAPH Preise Preis Edition Lizenz Beschreibung (jährlich) Beschränkung auf 1 Million „InfiniteGraph FREE“ Frei 0 € Knoten oder Kanten fängt bei ca. 5000 € an „Pay as you go“ Kommerziell Volle Funktionalität (in Abhängigkeit der Anzahl Knoten und Kanten) Volle Funktionalität, >..... € „Unit or site licensing“ Kommerziell fokussiert auf „größere“ (Betrag wird nicht genannt) Umgebungen Quelle: http://www.infinitegraph.com/options/ 29
  • 64. 30
  • 65. FALLEN-8 Überblick • In-Memory Graphendatenbank • Entwickelt in C# (Plattform unabhängig) • 4 Mrd. Knoten oder Kanten, jedes Element kann ca. 200 Mio. Eigenschaften haben • Indexe auf Knoten oder/und Kanten • Kern ist Open Source (MIT-Lizenz), Plugins sind variabel 31
  • 66. FALLEN-8 Persistenz • Persistenz in Form von „Save-Points“, d.h. alle Knoten und Kanten werden komplett serialisiert • Je nach Geschwindigkeit der HDD können ca. 2 Mio. Knoten oder Kanten pro Sekunde (de)serialisiert werden. • Das Speichern des Graphen blockiert lediglich schreibende Operationen • Performance + Verlässlichkeit 32
  • 67. FALLEN-8 Architektur Services Traversierungs- Index- Framework Framework Core API Knoten und Kanten RAM 33
  • 68. FALLEN-8 Architektur inklusive Plugins HA inklusive ACID Transaktionen REST API (via JSON) + Management/Query Oberfläche Traversierungs-Framework Index-Framework (inkl Pfad Analyse) (inkl R* Tree Index) Core API Knoten und Kanten RAM 34
  • 70. FALLEN-8 Benchmark - friends of a friend 1 35
  • 71. FALLEN-8 Benchmark - friends of a friend 2 3 1 4 5 35
  • 72. FALLEN-8 Benchmark - friends of a friend 6 7 8 2 9 3 10 1 11 4 12 13 5 14 15 16 35
  • 73. FALLEN-8 Benchmark - friends of a friend Fallen-8 Neo4J 5.000 4.000 3.000 t in ms 2.000 1.000 0 Durchlauf Quelle: Martin Junghanns 36
  • 74. FALLEN-8 Benchmark - traversals per second Quelle: Sebastian Dechant 37
  • 75. FALLEN-8 Benchmark - traversals per second 1 Quelle: Sebastian Dechant 37
  • 76. FALLEN-8 Benchmark - traversals per second 1 Quelle: Sebastian Dechant 37
  • 77. FALLEN-8 Benchmark - traversals per second 1 2 Quelle: Sebastian Dechant 37
  • 78. FALLEN-8 Benchmark - traversals per second 1 2 Graph: |V| = 10000, |E| = 600.000 (gleichverteilt) System: Windows Server 2008 R2, Intel Xeon E5620 (2,40 GHz), 6 GB RAM Quelle: Sebastian Dechant 37
  • 79. FALLEN-8 Benchmark - traversals per second 1 2 Graph: |V| = 10000, |E| = 600.000 (gleichverteilt) System: Windows Server 2008 R2, Intel Xeon E5620 (2,40 GHz), 6 GB RAM MySQL 62.168 PostgreSQL 78.449 Neo4J 943.580 InfiniteGraph 1.243.084 Fallen-8 196.930.256 1 10 100 1.000 10.000 100.000 1.000.000 10.000.000 100.000.000 1.000.000.000 traversals / sec Quelle: Sebastian Dechant 37
  • 80. FALLEN-8 Roadmap • Release: 23.05.2012 • Q3 2012 • Spatial index (MIT) • High availability (MIT) using Amazon EC2 • 2013 • Graph partitioning (MIT or ???) 38
  • 81. DANKE & Q&A Email: Henning@RauchEntwicklung.biz Url: http://www.NoSQL-Database.com Twitter: http://www.twitter.com/cosh23 39