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

Pouring Coffee into the Matrix – Building Java ...

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? Do developers need to retool and relearn? In this session, we will cover a brief intro to graphs, walk through writing a typical Java application with Spring, and then connect it to a graph database. From interacting with the graph data from the application to deploying to the cloud, we will see the process from start to finish. We will learn how to tackle pitfalls and pick up tips along the way, as well as explore the ways we can build, deploy, and connect applications to the database. This will come alive through a live demo, as we see the results of our efforts. Come to this session to build your business applications for graph data!

Code: https://github.com/JMHReif/pouring-coffee-into-matrix

Jennifer Reif

November 05, 2024
Tweet

More Decks by Jennifer Reif

Other Decks in Technology

Transcript

  1. Pouring Coffee into the Matrix Building Java applications on Neo4j

    Jennifer Reif [email protected] @JMHReif github.com/JMHReif jmhreif.com linkedin.com/in/jmhreif
  2. Who is Jennifer Reif? Developer Advocate, Neo4j • Continuous learner

    • Conference speaker • Tech blogger • Other: geek Jennifer Reif [email protected] @JMHReif github.com/JMHReif jmhreif.com linkedin.com/in/jmhreif
  3. What is graph? • Database - data storage • Way

    to store relationships with entities • Powerful when… • Queried - results based on the network structure • Visualized - depth comprehension of network • Utilized in algorithms/pipelines - factoring network into calculations
  4. Graph history • Much older than technology… • Arose from

    solution need (then and now) Seven Bridges of Konigsberg problem. Leonhard Euler, 1735
  5. Nodes • Represent objects or entities • Can be labeled

    • May have properties Category Feature JavaVersion version: “17” gaDate: 2021-09-14 name: “lang” title: “Pattern Matching for switch”
  6. Relationships • Must have a type • Must have a

    direction (stored) • Can be read in either direction Category Feature JavaVersion version: “17” gaDate: 2021-09-14 INCLUDES BELONGS_TO name: “lang” title: “Pattern Matching for switch”
  7. Relationships • Must have a type • Must have a

    direction (stored) • Can be read in either direction • May have properties Category Feature JavaVersion version: “17” gaDate: 2021-09-14 INCLUDES BELONGS_TO featureCount: 3 CHANGES name: “lang” title: “Pattern Matching for switch”
  8. Relationships • Must have a type • Must have a

    direction (stored) • Can be read in either direction • May have properties • Nodes can have multiple relationships Category Feature JavaVersion version: “17” gaDate: 2021-09-14 INCLUDES BELONGS_TO featureCount: 3 CHANGES STARTED_IN name: “lang” title: “Pattern Matching for switch” IM PACTED_BY
  9. Label • Group of nodes • Like a category •

    Domain class :) • Inheritance :) Person Employee Customer
  10. Properties • Key-value pair • Associated with node or relationship

    • Like a variable name and value Category JavaVersion version: “17” CHANGES gaDate: 2021-09-14 featureCount: 3 version: “6” codeName: “Mustang”
  11. Answering data questions • Java versions (i.e. 8, 11, 17)

    • Changes between versions over time • Di ff s • History for one speci fi c feature
  12. Domain/Application alignment • Class • Entity/Object • Represents domain type

    • Variables/Properties • Details for that entity • Constructor - instance of object • Each instance is unique object with varying info @Node public class JavaVersion { @Id @Property("version") private fi nal String javaVersion; private String name, codeName, status, apiSpec; private LocalDate gaDate, eolDate; }
  13. Retaining relationships • Adding relationships • Add variable as pointer

    to another object • Links entities together • Might have some annotations for mapping @Node public class JavaVersion { @Relationship(“FROM_NEWER”) private List<VersionDiff> olderVersionDiffs; }
  14. Language drivers • Neo4j Java driver (o ffi cial) •

    Spring Data Neo4j (SDN) • Includes Java driver dependency • Other options: • O ffi cial drivers -> Python, JavaScript, Go, .NET • Java frameworks -> Quarkus, Helidon, Micronaut, etc
  15. Spring provisions • Spring Initializr • SB reduce boilerplate •

    Annotation-based OGM for POJOs • Query derivation + DSL for custom (Cypher) • Spring Data easy-connect to Neo4j
  16. Resources • Code: github.com/JMHReif/pouring-co ff ee-into-matrix • Spring Data Neo4j

    docs: dev.neo4j.com/sdn-docs • Neo4j AuraDB: dev.neo4j.com/aura-java • NODES: dev.neo4j.com/nodes24 Jennifer Reif [email protected] @JMHReif github.com/JMHReif jmhreif.com linkedin.com/in/jmhreif