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

Code Wars: How the database affects your application

10f2b035856eef2b59c02267e3ee9e63?s=47 Jennifer Reif
September 16, 2019

Code Wars: How the database affects your application

We know that different business needs and standards drive toward one technology or another, but how can we truly know which is the best technology for the job? In this session, learn how different datasources and a variety of query languages impact the amount of code required for storing and retrieving data. From relational to NoSQL to graph, the presentation explores various types of data—the way it is stored underneath and how best to go about retrieving it.

10f2b035856eef2b59c02267e3ee9e63?s=128

Jennifer Reif

September 16, 2019
Tweet

Transcript

  1. Code Wars How the database affects your application Jennifer Reif

    Neo4j jennifer.reif@neo4j.com @JMHReif
  2. Who Am I? • Developer relations engineer at Neo4j •

    Developer • Blogger • Conference speaker • Continuous learner + geek Email: jennifer.reif@neo4j.com Twitter: @JMHReif
  3. Why should the database matter to us? • Long-term: •

    Right tool for the right job • Future maintenance/improvement efforts • Short-term: • Forcing data into unnatural format • Data model confusion and iterations • Complex queries to handle business questions • Data storage can impact application development!
  4. None
  5. Using Spring • Quick-start (Spring Initializr) • Reduce boilerplate (Spring

    Boot) • Consistent integration (Spring Data): • Annotation-based mapping for POJOs • Repository support via interface • Domain-specific language queries for each https://spring.io/projects/spring-data
  6. Data Models Relational - MariaDB Graph - Neo4j Document -

    MongoDB
  7. Data Models

  8. Data Models Relational - MariaDB Graph - Neo4j Document -

    MongoDB
  9. Document - MongoDB

  10. Data Models Relational - MariaDB Graph - Neo4j Document -

    MongoDB
  11. Graph - Neo4j

  12. Demo Time!

  13. Key Differences • POJOs aligning with data models • Maria:

    Order -> OrderedProduct <- Product • Mongo: Order { Shipping: {}, OrderedProduct: [{}] } • Neo4j: Country <- Order -> Product • @Query annotation (DSL syntax) • Maria: JPQL / SQL • Mongo: JSON-parameter / SQL • Neo4j: Cypher • TL;DR - data model…data and use case
  14. • GitHub projects: • MariaDB • Docker: https://github.com/JMHReif/docker-maria • Application:

    https://github.com/JMHReif/maria-code-wars • MongoDB • Docker: https://github.com/JMHReif/docker-mongo • Application: https://github.com/JMHReif/mongo-code-wars • Neo4j • Docker: https://github.com/JMHReif/docker-neo4j • Application: https://github.com/JMHReif/neo4j-code-wars • Db import files/scripts: https://github.com/JMHReif/code-wars-import-data-scripts • Spring Docs: https://spring.io/projects/spring-data Resources jennifer.reif@neo4j.com @JMHReif