SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
On Graph Databases



  Pere Urbón Bayes
         purbon@purbon.com


        May of 2010



   BcnOnRails May - 2010 - On Graph Databases   1
On Graph Databases

●   NoSQL movement.
●   Graph databases.
●   Pros and cons.
●   Use cases.
●   Technology overview.
●   Example.


                 BcnOnRails May - 2010 - On Graph Databases   2
NoSQL Movement

●   Next Generation of Databases.
●   Innovative. (?)
●   Open Source. (?)
●   Non-Relational.
●   Schema-less.
●   Distributed.
●   Scalable.



                      BcnOnRails May - 2010 - On Graph Databases   3
NoSQL Movement

●   Stores.                                  ●   More Stores.
        –   Document.                                    –   Grid database.
        –   Key/Value.                                   –   XML Database.
        –   Object oriented.                             –   RDF.
        –   Column.                                      –   .....
        –   Graph database.




                      BcnOnRails May - 2010 - On Graph Databases              4
NoSQL Movement

●   NoSQL is not the holy grail, never forget it.
●   Precursors & roots begun at the early 70's.
        –   Network databases, Charles Bachman 1969.




    案ずるより産むが易し。
               –   Giving birth to a baby is easier than worrying about it.



                         BcnOnRails May - 2010 - On Graph Databases           5
Graph Databases

●   Data strongly related.
        –   Social networks.
        –   GIS Systems.
        –   Transportation.
        –   Bibliographic.
        –   File systems.
        –   ........

                                                       GitHub Ruby community by country


                         BcnOnRails May - 2010 - On Graph Databases                       6
Graph Databases

●   The Property Graph.
        –   Labeled.
        –   Directed.
        –   Attributed.
        –   Multigraph.
●   Talk about.
        –   Nodes with types.
        –   Edges with types.
        –   Attributes.
                          BcnOnRails May - 2010 - On Graph Databases   7
Graph Databases

●   Graph storage.
       –   Adjacency Matrix.
       –   Adjacency List.
       –   Incidence Matrix.
       –   Incidence List.
●   GraphDB's.
       –   Bitmaps.
       –   B+Trees.
       –   RB Trees.
                       BcnOnRails May - 2010 - On Graph Databases   8
Graph Databases

                                                        Query           MySQL      OIM      DEX

                                                   Q1:count              20,38     17,35      0

            RDBMS       OIM            DEX         Q2:scan               32,76    174,64     3,14

  data      27.36 GB   54 GB         9.69 GB       Q3:select              7,34     5,43      0,84

                                                   Q4:projection         17,34     43,7     33,19
  ratio       10,9      21,51          3,86
overhead                                           Q5:combine             0,74     2,61      0,01
load time   52891 s    17543 s       95579 s
                                                   Q6:explode             0,07    202,07     0,01

                                                   Q7:values             12,28     20,77     0,01

                                                   Q8:hub               >3hours   >3hours   624,68



                                 BcnOnRails May - 2010 - On Graph Databases                       9
Graph Databases




  BcnOnRails May - 2010 - On Graph Databases   10
Use cases

●   Network analysis.
●   Link analysis.
●   Graph mining.
●   Neural networks.
●   Bibliographic search.
●   Semantic web.


                 BcnOnRails May - 2010 - On Graph Databases   11
Use cases

●   Algorithmic recruitment with GitHub.
       –   Centrality: The importance of a vertex within a
            graph.
               ●   Betweens: Vertex that occur on many shortest
                    path have higher centrality.
                        –   O(v^3) without any optimization.

               ●   Another possible choices:
                        –   Closeness: Vertex with a short geodesic distance
                              to other ones have a high closeness.
                                  ● Usually preferred on network analysis.




                       BcnOnRails May - 2010 - On Graph Databases              12
Graph Databases

●   Shortest Paths.                            ●   Centrality.
        –   BFS/DFS.                                       –   Betweenness.
        –   Dijkstra.                                      –   Closeness.
        –   Floyd-Warshall.                                –   Diameter.
        –   Ford.                                          –   Radius.
●   Connectivity.                              ●   Traversals.
        –   Strongly connected.                            –   BFS/DFS.
        –   Weakly connected.                  ●   Communities.
                                               ●   Staining.
                        BcnOnRails May - 2010 - On Graph Databases            13
Pros and cons

●   Data facts.                             ●   Relational model facts.
        –   Growths                                     –   E.F Codd model.
             exponentially.                             –   Normalization.
        –   Hugh                                        –   Object-Relational
             interdependency                                 impedance
             and complexity.                                 mismatch.
        –   Relationships are                           –   Join's doesn't scale.
             important.
                                                        –   Big tables.
        –   Structure change
              over time.                                –   Denormalization.

                     BcnOnRails May - 2010 - On Graph Databases                 14
Technology overview

●   Neo4J: Open source database NoSQL graph.
●   Dex: The high performance graph database.
●   HyperGraphDB: An IA and semantic web
     graph database.
●   Infogrid: The Internet Graph database.
●   Sones: SaaS dot Net Graph database.
●   VertexDB: High performance database server.

                 BcnOnRails May - 2010 - On Graph Databases   15
Benchmarking

Kernel      Scale 15   DEX        Neo4j        Jena      HypergraphDB
K1 Load (s)               7,44        697         141 +24h

K2 Scan edges (s)       0,0010       2,71        0,689
K3 2-hops (s)           0,0120     0,0260        0,443
                                                          Kernel           DEX          Neo4j     Jena     Hypergr
K4 BC (s)                 14,8       8,24         138                                                      aphDB
                                                                Scale 20
Db size (MB)                 30           17      207     K1 Load (s)             317    32.094    4.560 +24h

                                                          K2 Scan           0,005           751     18,6
 Graph Database Performance on the                        edges (s)
 HPC Scalable Graph Analysis Benchmark                    K3 2-hops (s)     0,033        0,0230 0,4580
                                                          K4 BC (s)               617     7.027 59.512

                                                          Db size (MB)            893       539    6.656


                                     BcnOnRails May - 2010 - On Graph Databases                              16
Technology overview




    BcnOnRails May - 2010 - On Graph Databases   17
Technology overview
●   Neo4J.rb ( JRuby target )
        –   Active record integration.
        –   Dynamic and schema free.
        –   Fast traversal of relationships.
        –   Transactions with rollbacks support.
        –   Indexing and querying of ruby objects.
        –   Massive loaders.
                                   http://wiki.neo4j.org/content/Ruby
        –   Ruby on Rails integration.
        –   Accessible throw REST.

                        BcnOnRails May - 2010 - On Graph Databases   18
Technology overview
    Creating nodes                                Properties
 require "rubygems"                        node = Neo4j::Node.new
 require 'neo4j'                           node[:name] = 'foo'
                                           node[:age] = 123
 Neo4j::Transaction.run do                 node[:hungry] = false
  node = Neo4j::Node.new                   node[4] = 3.14
 end                                       node[:age] # => 123

 Transactions over blocks                    Creating relationships

Neo4j::Transaction.run do                node1 = Neo4j::Node.new
  # neo4j operations goes here           node2 = Neo4j::Node.new
 end                                     Neo4j::Relationship.new(:friends, node1, node2)

                                         # which is same as
                                         node1.rels.outgoing(:friends) << node2



                             BcnOnRails May - 2010 - On Graph Databases                    19
Technology overview
 Accessing relationships
node1.rels.empty? # => false

# The rels method returns an enumeration of relationship objects.
# The nodes method on the relationships returns the nodes instead.
node1.rels.nodes.include?(node2) # => true

node1.rels.first # => the first relationship this node1 has.
node1.rels.nodes.first # => node2 first node of any relationship type
node2.rels.incoming(:friends).nodes.first # => node1 first node of relationship type 'friends'
node2.rels.incoming(:friends).first # => a relationship object between node1 and node2

 Properties on Relationships
rel = node1.rels.outgoing(:friends).first

rel[:since] = 1982
node1.rels.first[:since] # => 1982

                               BcnOnRails May - 2010 - On Graph Databases                  20
Example



For the joy of someone, lets play a little with a
                graph database.




               BcnOnRails May - 2010 - On Graph Databases   21
On Graph Databases




    Thanks you!
    Pere Urbón Bayes
         purbon@purbon.com




   BcnOnRails May - 2010 - On Graph Databases   22

Contenu connexe

En vedette

Advantages in Place: Federal Funding
Advantages in Place: Federal Funding Advantages in Place: Federal Funding
Advantages in Place: Federal Funding Illinois ResourceNet
 
Graph Databases introduction to rug-b
Graph Databases introduction to rug-bGraph Databases introduction to rug-b
Graph Databases introduction to rug-bPere Urbón-Bayes
 
Try NoSQL it doesn't hurts and is fun
Try NoSQL it doesn't hurts and is funTry NoSQL it doesn't hurts and is fun
Try NoSQL it doesn't hurts and is funPere Urbón-Bayes
 
Graph Databases, The Web of Data Storage Engines
Graph Databases, The Web of Data Storage EnginesGraph Databases, The Web of Data Storage Engines
Graph Databases, The Web of Data Storage EnginesPere Urbón-Bayes
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

En vedette (6)

Advantages in Place: Federal Funding
Advantages in Place: Federal Funding Advantages in Place: Federal Funding
Advantages in Place: Federal Funding
 
Graph Databases introduction to rug-b
Graph Databases introduction to rug-bGraph Databases introduction to rug-b
Graph Databases introduction to rug-b
 
Try NoSQL it doesn't hurts and is fun
Try NoSQL it doesn't hurts and is funTry NoSQL it doesn't hurts and is fun
Try NoSQL it doesn't hurts and is fun
 
Graph Databases, The Web of Data Storage Engines
Graph Databases, The Web of Data Storage EnginesGraph Databases, The Web of Data Storage Engines
Graph Databases, The Web of Data Storage Engines
 
Graph Theory and Databases
Graph Theory and DatabasesGraph Theory and Databases
Graph Theory and Databases
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similaire à Bcn On Rails May2010 On Graph Databases

Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011jexp
 
An Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBAn Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBWilliam LaForest
 
Django and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assDjango and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assTobias Lindaaker
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloudboorad
 
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)Emil Eifrem
 
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...Reynold Xin
 
Big data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-finalBig data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-finalramazan fırın
 
What is the "Big Data" version of the Linpack Benchmark? ; What is “Big Data...
What is the "Big Data" version of the Linpack Benchmark?; What is “Big Data...What is the "Big Data" version of the Linpack Benchmark?; What is “Big Data...
What is the "Big Data" version of the Linpack Benchmark? ; What is “Big Data...Geoffrey Fox
 
CSC 8101 Non Relational Databases
CSC 8101 Non Relational DatabasesCSC 8101 Non Relational Databases
CSC 8101 Non Relational Databasessjwoodman
 
Data-Intensive Text Processing with MapReduce
Data-Intensive Text Processing  with MapReduce Data-Intensive Text Processing  with MapReduce
Data-Intensive Text Processing with MapReduce George Ang
 
Data-Intensive Text Processing with MapReduce
Data-Intensive Text Processing with MapReduceData-Intensive Text Processing with MapReduce
Data-Intensive Text Processing with MapReduceGeorge Ang
 
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)Emil Eifrem
 
NoSQL & Big Data Analytics: History, Hype, Opportunities
NoSQL & Big Data Analytics: History, Hype, OpportunitiesNoSQL & Big Data Analytics: History, Hype, Opportunities
NoSQL & Big Data Analytics: History, Hype, OpportunitiesVishy Poosala
 
DevNation Atlanta
DevNation AtlantaDevNation Atlanta
DevNation Atlantaboorad
 
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)Emil Eifrem
 

Similaire à Bcn On Rails May2010 On Graph Databases (20)

Anti-social Databases
Anti-social DatabasesAnti-social Databases
Anti-social Databases
 
Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011
 
Drill njhug -19 feb2013
Drill njhug -19 feb2013Drill njhug -19 feb2013
Drill njhug -19 feb2013
 
Grails goes Graph
Grails goes GraphGrails goes Graph
Grails goes Graph
 
An Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBAn Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDB
 
Django and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assDjango and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks ass
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloud
 
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
 
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
 
RTree Spatial Indexing with MongoDB - MongoDC
RTree Spatial Indexing with MongoDB - MongoDC RTree Spatial Indexing with MongoDB - MongoDC
RTree Spatial Indexing with MongoDB - MongoDC
 
Big data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-finalBig data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-final
 
What is the "Big Data" version of the Linpack Benchmark? ; What is “Big Data...
What is the "Big Data" version of the Linpack Benchmark?; What is “Big Data...What is the "Big Data" version of the Linpack Benchmark?; What is “Big Data...
What is the "Big Data" version of the Linpack Benchmark? ; What is “Big Data...
 
CSC 8101 Non Relational Databases
CSC 8101 Non Relational DatabasesCSC 8101 Non Relational Databases
CSC 8101 Non Relational Databases
 
Data-Intensive Text Processing with MapReduce
Data-Intensive Text Processing  with MapReduce Data-Intensive Text Processing  with MapReduce
Data-Intensive Text Processing with MapReduce
 
Data-Intensive Text Processing with MapReduce
Data-Intensive Text Processing with MapReduceData-Intensive Text Processing with MapReduce
Data-Intensive Text Processing with MapReduce
 
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
 
Relational vs. Non-Relational
Relational vs. Non-RelationalRelational vs. Non-Relational
Relational vs. Non-Relational
 
NoSQL & Big Data Analytics: History, Hype, Opportunities
NoSQL & Big Data Analytics: History, Hype, OpportunitiesNoSQL & Big Data Analytics: History, Hype, Opportunities
NoSQL & Big Data Analytics: History, Hype, Opportunities
 
DevNation Atlanta
DevNation AtlantaDevNation Atlanta
DevNation Atlanta
 
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
 

Dernier

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Bcn On Rails May2010 On Graph Databases

  • 1. On Graph Databases Pere Urbón Bayes purbon@purbon.com May of 2010 BcnOnRails May - 2010 - On Graph Databases 1
  • 2. On Graph Databases ● NoSQL movement. ● Graph databases. ● Pros and cons. ● Use cases. ● Technology overview. ● Example. BcnOnRails May - 2010 - On Graph Databases 2
  • 3. NoSQL Movement ● Next Generation of Databases. ● Innovative. (?) ● Open Source. (?) ● Non-Relational. ● Schema-less. ● Distributed. ● Scalable. BcnOnRails May - 2010 - On Graph Databases 3
  • 4. NoSQL Movement ● Stores. ● More Stores. – Document. – Grid database. – Key/Value. – XML Database. – Object oriented. – RDF. – Column. – ..... – Graph database. BcnOnRails May - 2010 - On Graph Databases 4
  • 5. NoSQL Movement ● NoSQL is not the holy grail, never forget it. ● Precursors & roots begun at the early 70's. – Network databases, Charles Bachman 1969. 案ずるより産むが易し。 – Giving birth to a baby is easier than worrying about it. BcnOnRails May - 2010 - On Graph Databases 5
  • 6. Graph Databases ● Data strongly related. – Social networks. – GIS Systems. – Transportation. – Bibliographic. – File systems. – ........ GitHub Ruby community by country BcnOnRails May - 2010 - On Graph Databases 6
  • 7. Graph Databases ● The Property Graph. – Labeled. – Directed. – Attributed. – Multigraph. ● Talk about. – Nodes with types. – Edges with types. – Attributes. BcnOnRails May - 2010 - On Graph Databases 7
  • 8. Graph Databases ● Graph storage. – Adjacency Matrix. – Adjacency List. – Incidence Matrix. – Incidence List. ● GraphDB's. – Bitmaps. – B+Trees. – RB Trees. BcnOnRails May - 2010 - On Graph Databases 8
  • 9. Graph Databases Query MySQL OIM DEX Q1:count 20,38 17,35 0 RDBMS OIM DEX Q2:scan 32,76 174,64 3,14 data 27.36 GB 54 GB 9.69 GB Q3:select 7,34 5,43 0,84 Q4:projection 17,34 43,7 33,19 ratio 10,9 21,51 3,86 overhead Q5:combine 0,74 2,61 0,01 load time 52891 s 17543 s 95579 s Q6:explode 0,07 202,07 0,01 Q7:values 12,28 20,77 0,01 Q8:hub >3hours >3hours 624,68 BcnOnRails May - 2010 - On Graph Databases 9
  • 10. Graph Databases BcnOnRails May - 2010 - On Graph Databases 10
  • 11. Use cases ● Network analysis. ● Link analysis. ● Graph mining. ● Neural networks. ● Bibliographic search. ● Semantic web. BcnOnRails May - 2010 - On Graph Databases 11
  • 12. Use cases ● Algorithmic recruitment with GitHub. – Centrality: The importance of a vertex within a graph. ● Betweens: Vertex that occur on many shortest path have higher centrality. – O(v^3) without any optimization. ● Another possible choices: – Closeness: Vertex with a short geodesic distance to other ones have a high closeness. ● Usually preferred on network analysis. BcnOnRails May - 2010 - On Graph Databases 12
  • 13. Graph Databases ● Shortest Paths. ● Centrality. – BFS/DFS. – Betweenness. – Dijkstra. – Closeness. – Floyd-Warshall. – Diameter. – Ford. – Radius. ● Connectivity. ● Traversals. – Strongly connected. – BFS/DFS. – Weakly connected. ● Communities. ● Staining. BcnOnRails May - 2010 - On Graph Databases 13
  • 14. Pros and cons ● Data facts. ● Relational model facts. – Growths – E.F Codd model. exponentially. – Normalization. – Hugh – Object-Relational interdependency impedance and complexity. mismatch. – Relationships are – Join's doesn't scale. important. – Big tables. – Structure change over time. – Denormalization. BcnOnRails May - 2010 - On Graph Databases 14
  • 15. Technology overview ● Neo4J: Open source database NoSQL graph. ● Dex: The high performance graph database. ● HyperGraphDB: An IA and semantic web graph database. ● Infogrid: The Internet Graph database. ● Sones: SaaS dot Net Graph database. ● VertexDB: High performance database server. BcnOnRails May - 2010 - On Graph Databases 15
  • 16. Benchmarking Kernel Scale 15 DEX Neo4j Jena HypergraphDB K1 Load (s) 7,44 697 141 +24h K2 Scan edges (s) 0,0010 2,71 0,689 K3 2-hops (s) 0,0120 0,0260 0,443 Kernel DEX Neo4j Jena Hypergr K4 BC (s) 14,8 8,24 138 aphDB Scale 20 Db size (MB) 30 17 207 K1 Load (s) 317 32.094 4.560 +24h K2 Scan 0,005 751 18,6 Graph Database Performance on the edges (s) HPC Scalable Graph Analysis Benchmark K3 2-hops (s) 0,033 0,0230 0,4580 K4 BC (s) 617 7.027 59.512 Db size (MB) 893 539 6.656 BcnOnRails May - 2010 - On Graph Databases 16
  • 17. Technology overview BcnOnRails May - 2010 - On Graph Databases 17
  • 18. Technology overview ● Neo4J.rb ( JRuby target ) – Active record integration. – Dynamic and schema free. – Fast traversal of relationships. – Transactions with rollbacks support. – Indexing and querying of ruby objects. – Massive loaders. http://wiki.neo4j.org/content/Ruby – Ruby on Rails integration. – Accessible throw REST. BcnOnRails May - 2010 - On Graph Databases 18
  • 19. Technology overview Creating nodes Properties require "rubygems" node = Neo4j::Node.new require 'neo4j' node[:name] = 'foo' node[:age] = 123 Neo4j::Transaction.run do node[:hungry] = false node = Neo4j::Node.new node[4] = 3.14 end node[:age] # => 123 Transactions over blocks Creating relationships Neo4j::Transaction.run do node1 = Neo4j::Node.new # neo4j operations goes here node2 = Neo4j::Node.new end Neo4j::Relationship.new(:friends, node1, node2) # which is same as node1.rels.outgoing(:friends) << node2 BcnOnRails May - 2010 - On Graph Databases 19
  • 20. Technology overview Accessing relationships node1.rels.empty? # => false # The rels method returns an enumeration of relationship objects. # The nodes method on the relationships returns the nodes instead. node1.rels.nodes.include?(node2) # => true node1.rels.first # => the first relationship this node1 has. node1.rels.nodes.first # => node2 first node of any relationship type node2.rels.incoming(:friends).nodes.first # => node1 first node of relationship type 'friends' node2.rels.incoming(:friends).first # => a relationship object between node1 and node2 Properties on Relationships rel = node1.rels.outgoing(:friends).first rel[:since] = 1982 node1.rels.first[:since] # => 1982 BcnOnRails May - 2010 - On Graph Databases 20
  • 21. Example For the joy of someone, lets play a little with a graph database. BcnOnRails May - 2010 - On Graph Databases 21
  • 22. On Graph Databases Thanks you! Pere Urbón Bayes purbon@purbon.com BcnOnRails May - 2010 - On Graph Databases 22