Write powerful and efficient queries for Neo4j with Cypher, its official query languageAbout This BookImprove performance and robustness when you create, query, and maintain your graph databaseSave time by writing powerful queries using pattern matchingStep-by-step instructions and practical examples to help you create a Neo4j graph database using CypherWho This Book Is ForIf you want to learn how to create, query, and maintain a graph database, or want to migrate to a graph database from SQL, this is the book for you.
What You Will LearnDesign and create flexible and fast graph databases using the Cypher declarative syntaxWrite powerful, readable, and reusable queries with pattern matching and parametersDevelop fast applications using best practices to improve the performance of your Cypher queriesTransition smoothly from SQL to Neo4jMigrate relational databases to the graph model, getting rid of O/R mismatchAvoid the common mistakes and pitfalls in programming with Neo4jIn DetailNeo4j is generating much interest among NoSQL database users for its features, performance and scalability, and robustness. The software also provides users with a very natural and expressive graph model and ACID transactions with rollbacks. However, utilizing Neo4j in a real-world project can be difficult compared to a traditional relational database. Cypher fills this gap with SQL, providing a declarative syntax and the expressiveness of pattern matching. This relatively simple but powerful language allows you to focus on your domain instead of getting lost in database access. As you will learn in this book, very complicated database queries can easily be expressed through Cypher.
This book is a practical, hands-on guide to designing, implementing, and querying a Neo4j database quickly and painlessly. Through a number of practical examples, this book uncovers all the behaviors that will help you to take advantage of Neo4j effectively, with tips and tricks to help you along the way. The book starts with the basic clauses and patterns to perform read-only queries with Cypher. You will then learn about clauses and tips that can be used with patterns to elaborate results coming from pattern matching. Next, you will master the clauses required to modify a graph. Once you have got these basics right with the help of practical examples, you will then learn about tools and practices to improve the performance of queries and how to migrate a database to Neo4j from the ground up. To finish off, the book covers Cypher operators and functions in detail.
Prior to reading this book I had been using Neo4j and Cypher for a year. While I by no means consider myself an expert in Cypher, I know how to get things done. When this book first appeared, I was quite excited as I saw it as a possible means to take my Cypher skills to the next level. On this count the book disappointed me.
First up the book has a fairly terse style. Reading it gives the impression that the author was in a hurry to finish the book, so don't expect any detailed explanations on the how/why or what in this book. The writing style also gives the impression that the author is assuming a certainly level of understanding or prior knowledge in places that would not necessarily by true for somebody completely new to the subject. This was generally not a big problem for me with my prior experience with Neo4j and Cypher, but could be a newbie reader.
An example of this is when the author explains optional matches in Cypher queries. The example uses a dataset of employees who report to managers and employees who manage a cost centre. The first example query used in the book returns an unexpected result, returning a dataset that includes an employee without a manager, where one should be present. As the author explains this is due to the fact that all of the match clause must match for it to be included in the result. He then produces a query that returns the expected result, but without an explicit explanation as to why it works and the first didn't. If the reader is sharp and has been paying attention, he'd know that reason one query worked and the other didn't was because the employee didn't manage a cost centre. I'm not such a reader! So I had to go back and look at the structure of the data nodes to work out what was happening.
This might be a minor gripe, but large sections of the book are written in the same style. The author assumes you know what he's talking about, where all it would take is an extra line of two of explanation to provide more enlightenment to the reader. And a much easier reading style.
If you're an experienced Cypher coder this book is probably not for you. The book just covers the basics and in some ways much of it is just a rehash of what is on the Neo4j website. But having said that, I picked up a few bits and pieces along the way that will help me with my Cypher coding in the future. And certainly if I was new to Cypher again I think I would have definitely found this book useful.
I have been using Neo4J and Cypher to some extent prior to reading the book. This book is good refresher for someone who wants to learn Cypher. If you do not want to go through the Cypher docs on the site, this book covers all the topics with some good examples. The author has done a good job of explaining on how to create and manage nodes, relationships, properties to nodes , labels etc. For a beginner this book is a very good start but for advanced level resources this is not the book that covers each topic to the detail, few topics like profiling and tuning neo4j will benefit to some extent.
I have mixed comments but I would definitely recommend this book as a quick refresher for all levels of people.