Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pouring Coffee into the Matrix: Building Java Applications on Neo4j

Pouring Coffee into the Matrix: Building Java Applications on Neo4j

Many of us have built applications for traditional data structures (like relational database tables), but is it different for graph data stores? In this session, we will cover a brief intro to graphs and build a typical Java application for a graph database. We will interact with the graph data from the application, and explore some deployment possibilities. See how to amplify the power of connected data with applications!

Jennifer Reif

July 09, 2021
Tweet

More Decks by Jennifer Reif

Other Decks in Technology

Transcript

  1. Who Am I? • Developer • Continuous learner • Technical

    content writer • Conference speaker • Other: geek
  2. What is a graph? • Set of discrete objects, each

    of which has some set of relationships with other objects Seven Bridges of Konigsberg problem. Leonhard Euler, 1735
  3. A few graph use cases… Social network Fraud detection Network

    & IT operations Identity & access management Graph-based search
  4. Graph components • Node (vertex) • Objects • Relationship (edge)

    • Connections Michael Jennifer Neo4j Graphs :LIKES :WORKS_FOR :IS_FRIENDS_WITH
  5. Graph components • Node (vertex) • Objects • Relationship (edge)

    • Connections • Label • Node category (optional) Person Person Company Technology Hobby :LIKES :WORKS_FOR :IS_FRIENDS_WITH
  6. Graph components • Node (vertex) • Objects • Relationship (edge)

    • Connections • Label • Node category (optional) • Properties • Enrich node/relationship • No need for nulls Person Person Company Technology :LIKES :WORKS_FOR :IS_FRIENDS_WITH name: Michael name: Neo4j name: Jennifer type: Graphs since: 2018
  7. Cypher: SQL for graphs • Functional and visual • Based

    on ASCII-art • Declarative query language • Focuses on what to retrieve • Not how A B LIKES MATCH ( A ) - [ : LIKES] - > ( B )
  8. Cypher Powerful and Expressive Jennifer Neo4j WORKS_FOR CREATE (:Person {

    name: ‘Jennifer’}) -[:WORKS_FOR]-> (:Company { name: ‘Neo4j’}) NODE LABEL NODE LABEL PROPERTY PROPERTY
  9. Cypher Powerful and Expressive Jennifer Neo4j WORKS_FOR MATCH (:Person {

    name: ‘Jennifer’}) -[:WORKS_FOR]-> (whom) 
 RETURN whom
  10. Language drivers • Java driver (o ffi cial) • Spring

    Data Neo4j • Uses Java driver at base • Other options: • O ffi cial drivers-> Python, JavaScript, Go, .NET • Java frameworks-> Quarkus, Helidon, Micronaut, etc
  11. Spring Data What does it give developers? • Can connect

    to variety of databases out of the box • Consistency across data sources • Out-of-the-box repository and custom object-mapping • Dynamic query derivation (plus DSL for custom queries)
  12. Spring Data Neo4j What does it give developers? • Connects

    to Neo4j - a graph database • Actively developed and supported by Spring and Neo4j teams • Contains both imperative and reactive capabilities
  13. Why Spring? • Simple and familiar for others to copy

    • Spring Initializr • Spring Boot’s reduction of boilerplate • Annotation-based OGM for POJOs • Spring Data’s easy connection to Neo4j • BOLT, HTTP, or embedded
  14. Cloud options • Google Cloud Platform, AWS, Microsoft Azure •

    Neo4j Aura • Database-as-a-service (DBaaS) • Neo4j-managed • Cost: capacity-based (storage, i/o, backup, data transfer)
  15. Other ways to run Neo4j • Docker • Neo4j Desktop

    • Neo4j Sandbox • Community/enterprise server
  16. Resources • Source code: github.com/JMHReif/sdn-venmo-social • Spring Data Neo4j documentation:

    dev.neo4j.com/sdn-docs • Neo4j Aura info: neo4j.com/cloud/aura/ • Neo4j Aura Feedback: dev.neo4j.com/aura-feedback • Neo4j - Discord, Discourse, Twitch, YouTube, Twitter, LinkedIn, etc! Jennifer Reif Email: [email protected] Twitter: @JMHReif LinkedIn: linkedin.com/in/jmhreif Github: GitHub.com/JMHReif