SlideShare une entreprise Scribd logo
1  sur  19
Introduction to Graph Databases Josh Adell <josh.adell@gmail.com> 20110806
Who am I? ,[object Object],[object Object],[object Object]
The Problem
The Solution? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Find Every Actor at Each Degree ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Truth ,[object Object],Data RDBMs
The Real Problem ,[object Object],[object Object],[object Object]
The Real Solution
Graph Examples
Relational Databases are Graphs!
Some Graph Use Cases ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modelling a Domain with Graphs ,[object Object],[object Object],[object Object],[object Object]
Graph Mining ,[object Object],[object Object],[object Object]
New Solution to the Bacon Problem $keanu = $actorIndex->find('name', 'Keanu Reeves'); $kevin = $actorIndex->find('name', 'Kevin Bacon'); $path = $keanu->findPathTo($kevin);
Cypher ,[object Object],// Find all the directors who have directed a movie scored by John Williams // that starred Kevin Bacon START actor=(actors, 'Kevin Bacon'), composer=(compsers, 'John Williams') MATCH  (actor)-[:IN]->(movie)<-[:DIRECTED]-(director),        (movie)<-[:SCORED]-(composer) RETURN director
Are RDBs Useful At All? ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions?
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Similaire à Introduction to Graph Databases

Graph Databases
Graph DatabasesGraph Databases
Graph Databases
Josh Adell
 
Writing Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniterWriting Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniter
CodeIgniter Conference
 

Similaire à Introduction to Graph Databases (10)

Graph Databases
Graph DatabasesGraph Databases
Graph Databases
 
Microdata, Authorship and Semantic HTML - Ruth Cheesley - J and Beyond 2013
Microdata, Authorship and Semantic HTML - Ruth Cheesley - J and Beyond 2013Microdata, Authorship and Semantic HTML - Ruth Cheesley - J and Beyond 2013
Microdata, Authorship and Semantic HTML - Ruth Cheesley - J and Beyond 2013
 
Ruth Cheesley - Joomla!Day Kenya - Microdata, Authorship, and why you can't a...
Ruth Cheesley - Joomla!Day Kenya - Microdata, Authorship, and why you can't a...Ruth Cheesley - Joomla!Day Kenya - Microdata, Authorship, and why you can't a...
Ruth Cheesley - Joomla!Day Kenya - Microdata, Authorship, and why you can't a...
 
Dropping ACID with MongoDB
Dropping ACID with MongoDBDropping ACID with MongoDB
Dropping ACID with MongoDB
 
Ruth Cheesley - Joomla!Day Spain - Microdata and Semantic Search
Ruth Cheesley - Joomla!Day Spain - Microdata and Semantic SearchRuth Cheesley - Joomla!Day Spain - Microdata and Semantic Search
Ruth Cheesley - Joomla!Day Spain - Microdata and Semantic Search
 
Freebasing for Fun and Enhancement
Freebasing for Fun and EnhancementFreebasing for Fun and Enhancement
Freebasing for Fun and Enhancement
 
Pick-a-Plex App: The Pinnacle of Cinema Experiences
Pick-a-Plex App: The Pinnacle of Cinema ExperiencesPick-a-Plex App: The Pinnacle of Cinema Experiences
Pick-a-Plex App: The Pinnacle of Cinema Experiences
 
Writing Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniterWriting Friendly libraries for CodeIgniter
Writing Friendly libraries for CodeIgniter
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With Php
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
 

Dernier

Dernier (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Introduction to Graph Databases

Notes de l'éditeur

  1. * graph db usage poll
  2. * Six degrees game * Relational databases can&apos;t easily answer certain types of questions
  3. * first pass using a relational database * cast table: actor_name, movie_title * hard to visualize the solution * In order to do this, you need to do multiple passes or joins
  4. * Each degree adds a join * Increases complexity * Decreases performance * Stop when the actor you&apos;re looking for is in the list
  5. * this problem highlights the ugly truth about RDBs * they weren&apos;t designed to handle these types of problems. * arbitrary path query * RDB relationships join data, but are not data in themselves * Set math * Gather everything in the set that matches these criteria, then tell me if this thing is in the set * 1 set, no problem * 2nd set no problem * 3rd set not related to 1st * 4th not related to 2nd * 5th related to 1st and 4th * etc. * Relationships are only available between overlapping sets
  6. * disjoint sets
  7. * Graphs * Not X-Y * Computer Science definition of graphs * A graph is an ordered pair  G = (V, E)  where V is a set of  vertices  and E is a set of  edges , which are pairs of vertices. * Node : vertex * Relationship : edge * Property : meta-datum attached to a node or relationship * Nodes can have arbitrary properties * Relationships are first-class citizens Have a type Have properties Have a direction Domain semantics Traversable in any direction * This is how graph dbs solve the problems that RDBs can&apos;t * Path : an ordered list of nodes and relationships * Paths are found using traversal algorithms
  8. * Tree data-structures * Networks * Maps * vehicles on streets == packets through network * Relational databases are graphs!
  9. * Make each record a node * Make every foreign key a relationship * RDB indexes are usually stored in a tree structure * Trees are graphs * Why not use RDBs? * The trouble with RDBs is how they are stored in memory and queried   * Require a translation step from memory blocks to graph structure * Relationships not first-class citizens * Many problem domains map poorly to rows/tables
  10. * Big Data ** billions of nodes and relationships in a single instance * &amp;quot;Internet of Things&amp;quot; buzzword * Social networking - friends of friends of friends of friends * Assembly/Manufacturing - 1 widget contains 3 gadgets each contain 2 gizmos * Map directions - starting at my house find a route to the office that goes past the pub * Multi-tenancy - root node per tenant * all queries start at root * No overlap between graphs = no accidental data spillage * Fraud: track transactions back to origination * Pretty much anything that can be drawn on a whiteboard
  11. * Example: retail system * Customer makes Order * Store sells Order * Order contains Items * Supplier supplied Items * Customer rates Items * Did this customer rank supplier X highly? * Which suppliers sell the highest rated items? * Does item A get rated higher when ordered with Item B? * All can be answered with RDBs as well * Not as elegant * Not as performant
  12. * This is where the power of graph dbs comes from * Paths - find any relationship chain between A and B * Kevin Bacon example, known start and end * Traversal - filter out paths that don&apos;t meet criteria * Complex path finding, base next decision on existing path from start to current position * Define path-finding (prune) and result filtering functions * Queries - Here is what I want, find it however you can * SPARQL, Gremlin, Cypher
  13. * Actors are nodes * Movies are nodes * Relationship: Actor is IN a movie * pseudo-code shortened for brevity * Compare to degree selection join queries
  14. * Cypher is &amp;quot;what to find&amp;quot; * describe the &amp;quot;shape&amp;quot; of the thing you&apos;re looking for * Very white-board friendly * Pros: easy to understand, query looks like domain model * Cons: not as powerful, not fully featured (YET) * result set is an array of arrays 
  15. * RDBs are really good at data aggregation * Set math, duh * Have to traverse the whole graph in order to do aggregation * Truly tabular means not a lot of relationships between the data types
  16. * billions of nodes and relationships in a single instance * cluster replication * transactions * native bindings for Ruby, Python, and language that can run in JVM * Licensing