Preface

Among the NoSQL databases, Neo4j is generating a lot of interest due to the following set of features: performance and scalability, robustness, its very natural and expressive graph model, and ACID transactions with rollbacks.

Neo4j is a graph database. Its model is simple and based on nodes and relationships. The model is described as follows:

  • Each node can have a number of relationships with other nodes
  • Each relationship goes from one node either to another node or the same node; therefore, it has a direction and involves either only two nodes or only one
  • Both nodes and relationships can have properties, and each property has a name and a value

Before Neo4j introduced Cypher as a preferred query, utilizing Neo4j in a real-world project was difficult compared to a traditional relational database. In particular, querying the database was a nightmare, and executing a complex query required the user to write an object, thereby performing a graph traversal. Roughly speaking, a traversal is an operation that specifies how to traverse a graph and what to do with the nodes and relationships found during the visit. Though it is very powerful, it works in a very procedural way (through callbacks), so its readability is poor and any change to the query means modifying the code and building it.

Cypher, instead, provides a declarative syntax, which is readable and powerful, and a rich set of graph patterns that can be recognized in the graph. Thus, with Cypher, you can write (and read) queries much more easily and be productive from the beginning. This book will guide you through learning this language from the ground up, and each topic will be explained with a real-world example.

What this book covers

Chapter 1, Querying Neo4j Effectively with Pattern Matching, describes the basic clauses and patterns to perform read-only queries with Cypher.

Chapter 2, Filter, Aggregate, and Combine Results, describes clauses and tips that can be used with patterns to elaborate results that come from pattern matching.

Chapter 3, Manipulating the Database, covers the write clauses, which are needed to modify a graph.

Chapter 4, Improving Performance, talks about tools and practices to improve performances of queries.

Chapter 5, Migrating from SQL, explains how to migrate a database to Neo4j from the ground up through an example.

Appendix, Operators and Functions, describes Cypher operators and functions in detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.35.122