Connecting the Dots: Graph Databases and Laravel

Connecting the Dots: Graph Databases and Laravel

Presented at Laracon US 2019

21857d592f37798b624043522d0c2125?s=128

Keith Damiani

July 23, 2019
Tweet

Transcript

  1. Graph Databases and Laravel DOTS the CONNECTING LARACON US 2019

    KEITH DAMIANI
  2. Graph Databases and Laravel KEITH DAMIANI DOTS the CONNECTING LARACON

    US 2019
  3. None
  4. None
  5. None
  6. Graph Databases and Laravel KEITH DAMIANI DOTS the CONNECTING LARACON

    US 2019
  7. None
  8. KEITH DAMIANI PRINCIPAL PROGRAMMER !

  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. "

  18. What is a graph database? CONNECTING THE DOTS

  19. What is a graph database? CONNECTING THE DOTS

  20. What is a graph database? CONNECTING THE DOTS

  21. What is a graph database? CONNECTING THE DOTS

  22. What is a graph database? CONNECTING THE DOTS Graph DBs

    vs. relational DBs Use cases Writing queries Laravel graph DBs
  23. What is a graph database? CONNECTING THE DOTS

  24. What is a graph database? CONNECTING THE DOTS © JACK

    MCDADE
  25. © JACK MCDADE

  26. None
  27. None
  28. Nodes "VERTICES"

  29. Nodes "VERTICES" "EDGES" Relationships

  30. Nodes "VERTICES" "EDGES" Relationships

  31. Keith's Family Tree

  32. Keith's Family Tree Keith

  33. WAIT A MINUTE

  34. WAIT A MINUTE RELATIONAL DATABASES

  35. WAIT A MINUTE RELATIONAL DATABASES “ ”

  36. L 14th St./8th Ave. Union Square 6th Ave. Washington Square

    Houston St. 1st Ave. L L K B B K B B
  37. stations id name 1 14th St./8th Ave. 2 6th Ave.

    3 Union Square 4 1st Ave. 5 Washington Square 6 Houston St. lines id name 1 3 2 4 3 5 4 L 5 B 6 K line_station id station_id line_id connected_to 1 3 4 2 2 4 4 7 3 5 5 4 4 5 6 8 5 6 5 6 6 6 6 9
  38. stations id name 1 14th St./8th Ave. 2 6th Ave.

    3 Union Square 4 1st Ave. 5 Washington Square 6 Houston St. lines id name 1 3 2 4 3 5 4 L 5 B 6 K line_station id station_id line_id connected_to 1 3 4 2 2 4 4 7 3 5 5 4 4 5 6 8 5 6 5 6 6 6 6 9
  39. L 14th St./8th Ave. Union Square 6th Ave. Washington Square

    Houston St. 1st Ave. L L K B B K B B
  40. 1735 KALININGRAD

  41. KÖNIGSBERG

  42. © HISTORIC CITIES RESEARCH PROJECT / OZGUR TUFECKI

  43. © HISTORIC CITIES RESEARCH PROJECT / OZGUR TUFECKI

  44. © HISTORIC CITIES RESEARCH PROJECT / OZGUR TUFECKI No sweat,

    
 I got this.
  45. © HISTORIC CITIES RESEARCH PROJECT / OZGUR TUFECKI No sweat,

    
 I got this. e 2.718281828459045
  46. © HISTORIC CITIES RESEARCH PROJECT / OZGUR TUFECKI

  47. None
  48. None
  49. JOINS

  50. JOINS

  51. L 14th St./8th Ave. Union Square 6th Ave. Washington Square

    Houston St. 1st Ave. L L K B B K B B
  52. None
  53. What is a graph database? CONNECTING THE DOTS Graph DBs

    vs. relational DBs Use cases
  54. Highly-connected data THE NATURE OF YOUR DATA Hierarchical/tree-shaped

  55. FRIEND-OF-A-FRIEND QUERY Depth Relational DB Neo4j Graph DB Records 2

    0.02 0.01 2500 3 30 0.17 110,000 4 1,544 1.36 600,000 5 Unfinished 2.13 800,000 PERFORMANCE, IN SECONDS
  56. Highly-connected data THE NATURE OF YOUR DATA Hierarchical/tree-shaped Many-to-many and/or

    polymorphic Schema-less
  57. Social networks COMMON USE CASES Real-time product recommendations Social +

    Recommendation
  58. Social networks COMMON USE CASES Real-time product recommendations Would you

    like to 
 Join my Professional Network? Social + Recommendation
  59. Social networks COMMON USE CASES Real-time product recommendations Social +

    Recommendation Geospatial Geospatial + Recommendation
  60. Digital asset management COMMON USE CASES (MORE!) Textual analysis /

    search PageRank search Financial / fraud detection Public policy / journalism
  61. None
  62. Disconnected data BAD FITS Bulk data scans Aggregating across nodes

    When write speed is paramount BLOBs / large amounts of text
  63. None
  64. NEO4J.COM

  65. OrientDB Apache TinkerPop Amazon Neptune JanusGraph ArangoDB

  66. CYPHER

  67. CYPHER ( )-[ ]->( )

  68. CYPHER ( )-[ ]->( ) MATCH RETURN

  69. CYPHER MATCH (me:User {name: 'Me'})

  70. (DEMO TIME!)

  71. What is a graph database? CONNECTING THE DOTS Graph DBs

    vs. relational DBs Use cases Writing queries Laravel graph DBs
  72. NeoEloquent THREE OPTIONS FOR LARAVEL

  73. NeoEloquent THREE OPTIONS FOR LARAVEL

  74. NeoEloquent THREE OPTIONS FOR LARAVEL GraphAware neo4j-php-client

  75. NeoEloquent THREE OPTIONS FOR LARAVEL GraphAware neo4j-php-client

  76. NeoEloquent THREE OPTIONS FOR LARAVEL GraphAware neo4j-php-client ¯\_(ツ)_/¯

  77. Vapor Laravel

  78. Neo4Laravel

  79. Larapals.com

  80. ! @keithdamiani keithdamiani.com