SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Neo4j Graph Database
      From PHP

  February 28, 2013
   Confoo 2013, Montréal
How I got here




                     R.I.P.
Had a short life, but left before it was too late.
Why Neo4j?
●   Simple set-up
●   Well documented
●   Open source
●   ... with “Enterprise” support
●   Not purely academic
What is a graph database?




A database providing persistance for graphs.
Ok, but what is a graph?
Ok, but what is a graph?
Neo4j
            Out of the Box
Data: http://www.neo4j.org/develop/example_data
Gremlin
●   Provides control over the traversal
    algorithm
●   Pipe & Filter – similar to jQuery
●   Works across different graph databases
●   Based on Groovy (limited to Java)
Gremlin

g.v(1)
 .in('COMPANION_OF')
  .out('APPEARED_IN')
  .has('title', "The Doctor's Daughter")
 .back(2)
Gremlin
●   Can modify the graph
●   Allows to run arbitrary code
●   Implementation not as stable in Neo4j
Cypher

START doctor = node(1)
MATCH
 doctor <-[:COMPANION_OF]- companion,
 companion -[:APPEARED_IN]-> episode
WHERE
 episode.title = "The Doctor's Daughter"
RETURN companion, companion.character
Enough theory

Neo4j in action
REST API
●   JSON over HTTP
●   Well supported
●   Used by the web admin
●   Meaningful work requires many HTTP
    requests
●   http://docs.neo4j.org/chunked/stable/rest-api.html
everyman/neo4jphp
●   Complete? REST API implementation
●   Basic wrappers for all components
●   https://github.com/jadell/neo4jphp/wiki
everyman/neo4jphp

    Pros:                 Cons:
●   Well maintained   ●   Tedious API
●   Good              ●   Error-prone
    documentation     ●   Low-level
●   Predictable
    behavior
hirevoice/neo4jphp-ogm
●   Bias: I am the author
●   Inspired by Doctrine
●   Uses annotations on classes
●   Built on top of everyman/neo4jphp
●   https://github.com/lphuberdeau/Neo4j-PHP-OGM
hirevoice/neo4jphp-ogm

    Pros:                        Cons:
●   Fast (bulk operations)   ●   Supported by me
●   Feels like Doctrine      ●   Skim
●   Benefits from type           documentation
    checking                 ●   Implementation still
●   Well tested                  partial
●   Bundles and
    modules available
    (many)
Others
●   neoxygen/updown
●   neoxygen/neox
●   neoxygen/GraphQuest
Demo




                 Code
https://github.com/lphuberdeau/confoo-demo
Contact



Louis-Philippe Huberdeau
      lp@huberdeau.info

Weitere ähnliche Inhalte

Was ist angesagt?

Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
smithmilner
 

Was ist angesagt? (20)

Php Inspections (EA Extended): The Cookbook
Php Inspections (EA Extended): The CookbookPhp Inspections (EA Extended): The Cookbook
Php Inspections (EA Extended): The Cookbook
 
TDD in Go with Ginkgo and Gomega
TDD in Go with Ginkgo and GomegaTDD in Go with Ginkgo and Gomega
TDD in Go with Ginkgo and Gomega
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
 
TDD with Python and App Engine
TDD with Python and App EngineTDD with Python and App Engine
TDD with Python and App Engine
 
7 recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...
7 recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...7 recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...
7 recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
 
Phpactor and VIM
Phpactor and VIMPhpactor and VIM
Phpactor and VIM
 
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
 
Goodpractice
GoodpracticeGoodpractice
Goodpractice
 
Patterns: The new Javascript framweork
Patterns: The new Javascript framweorkPatterns: The new Javascript framweork
Patterns: The new Javascript framweork
 
Cpu profiling
Cpu profilingCpu profiling
Cpu profiling
 
Civilized Git Process
Civilized Git ProcessCivilized Git Process
Civilized Git Process
 
Test Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShellTest Driven Development (TDD) with Windows PowerShell
Test Driven Development (TDD) with Windows PowerShell
 
Continuous Integration In Php
Continuous Integration In PhpContinuous Integration In Php
Continuous Integration In Php
 
Behaviour Driven Development Hands-on
Behaviour Driven Development Hands-onBehaviour Driven Development Hands-on
Behaviour Driven Development Hands-on
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
 
PHPUnit Automated Unit Testing Framework
PHPUnit Automated Unit Testing FrameworkPHPUnit Automated Unit Testing Framework
PHPUnit Automated Unit Testing Framework
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with Magento
 
Using Mountebank to inject behavior into test stubs
Using Mountebank to inject behavior into test stubsUsing Mountebank to inject behavior into test stubs
Using Mountebank to inject behavior into test stubs
 
Secure Your Pipeline While Keeping Your Developers and Admins Happy
Secure Your Pipeline While Keeping Your Developers and Admins HappySecure Your Pipeline While Keeping Your Developers and Admins Happy
Secure Your Pipeline While Keeping Your Developers and Admins Happy
 

Ähnlich wie Neo4j Graph Database, from PHP

Lighning Talk: PHP build process
Lighning Talk: PHP build processLighning Talk: PHP build process
Lighning Talk: PHP build process
Bryan Agee
 

Ähnlich wie Neo4j Graph Database, from PHP (20)

Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
apacheairflow-160827123852.pdf
apacheairflow-160827123852.pdfapacheairflow-160827123852.pdf
apacheairflow-160827123852.pdf
 
Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 
Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012Introduction to ZooKeeper - TriHUG May 22, 2012
Introduction to ZooKeeper - TriHUG May 22, 2012
 
Performance Profiling Tools and Tricks
Performance Profiling Tools and TricksPerformance Profiling Tools and Tricks
Performance Profiling Tools and Tricks
 
Performance Profiling Tools & Tricks
Performance Profiling Tools & TricksPerformance Profiling Tools & Tricks
Performance Profiling Tools & Tricks
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetup
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
Lighning Talk: PHP build process
Lighning Talk: PHP build processLighning Talk: PHP build process
Lighning Talk: PHP build process
 
PHP 5.6 New and Deprecated Features
PHP 5.6  New and Deprecated FeaturesPHP 5.6  New and Deprecated Features
PHP 5.6 New and Deprecated Features
 
Xdebug for Beginners
Xdebug for BeginnersXdebug for Beginners
Xdebug for Beginners
 
NodeJS
NodeJSNodeJS
NodeJS
 
An OpenShift Migration: From 3.9 to 4.5
An OpenShift Migration: From 3.9 to 4.5An OpenShift Migration: From 3.9 to 4.5
An OpenShift Migration: From 3.9 to 4.5
 
OpenCV Workshop
OpenCV WorkshopOpenCV Workshop
OpenCV Workshop
 
Introduction to OPA
Introduction to OPAIntroduction to OPA
Introduction to OPA
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 
Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)
 
2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
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
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"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 New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
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...
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

Neo4j Graph Database, from PHP

  • 1. Neo4j Graph Database From PHP February 28, 2013 Confoo 2013, Montréal
  • 2. How I got here R.I.P. Had a short life, but left before it was too late.
  • 3. Why Neo4j? ● Simple set-up ● Well documented ● Open source ● ... with “Enterprise” support ● Not purely academic
  • 4. What is a graph database? A database providing persistance for graphs.
  • 5. Ok, but what is a graph?
  • 6. Ok, but what is a graph?
  • 7. Neo4j Out of the Box Data: http://www.neo4j.org/develop/example_data
  • 8. Gremlin ● Provides control over the traversal algorithm ● Pipe & Filter – similar to jQuery ● Works across different graph databases ● Based on Groovy (limited to Java)
  • 9. Gremlin g.v(1) .in('COMPANION_OF') .out('APPEARED_IN') .has('title', "The Doctor's Daughter") .back(2)
  • 10. Gremlin ● Can modify the graph ● Allows to run arbitrary code ● Implementation not as stable in Neo4j
  • 11. Cypher START doctor = node(1) MATCH doctor <-[:COMPANION_OF]- companion, companion -[:APPEARED_IN]-> episode WHERE episode.title = "The Doctor's Daughter" RETURN companion, companion.character
  • 13. REST API ● JSON over HTTP ● Well supported ● Used by the web admin ● Meaningful work requires many HTTP requests ● http://docs.neo4j.org/chunked/stable/rest-api.html
  • 14. everyman/neo4jphp ● Complete? REST API implementation ● Basic wrappers for all components ● https://github.com/jadell/neo4jphp/wiki
  • 15. everyman/neo4jphp Pros: Cons: ● Well maintained ● Tedious API ● Good ● Error-prone documentation ● Low-level ● Predictable behavior
  • 16. hirevoice/neo4jphp-ogm ● Bias: I am the author ● Inspired by Doctrine ● Uses annotations on classes ● Built on top of everyman/neo4jphp ● https://github.com/lphuberdeau/Neo4j-PHP-OGM
  • 17. hirevoice/neo4jphp-ogm Pros: Cons: ● Fast (bulk operations) ● Supported by me ● Feels like Doctrine ● Skim ● Benefits from type documentation checking ● Implementation still ● Well tested partial ● Bundles and modules available (many)
  • 18. Others ● neoxygen/updown ● neoxygen/neox ● neoxygen/GraphQuest
  • 19. Demo Code https://github.com/lphuberdeau/confoo-demo
  • 20. Contact Louis-Philippe Huberdeau lp@huberdeau.info