This chapter covers:
- An introduction to graph databases, with a focus on Neo4j
- The property graph data model
- Using the Cypher query language to create and query data in Neo4j
- Using client drivers for Neo4j, specifically the JavaScript Node.js driver
Fundamentally, a graph database is a software tool that allows the user to model, store, and query data as a graph. Working with a graph at the database level is often more intuitive for modeling complex connected data and can be more performant when working with complex queries that require traversing many connected entities.
In this chapter we begin the process of creating a property graph data model using the business requirements from the previous chapter and show how to model that in Neo4j and then comparing to the GraphQL model created in the previous chapter. We then explore the Cypher query language, focusing on how to write Cypher queries to address the requirements of our application. Along the way we show how to install Neo4j, use Neo4j Desktop to create new Neo4j projects locally, and use Neo4j Browser to query Neo4j, and visualize the results. Finally we show how to use the Neo4j JavaScript client driver to create a simple Node.js application that queries Neo4j.