Neo4j: The Definitive Guide

Book description

Looking to improve the performance of Cypher queries or learn how to model graphs to support business use cases? A graph database like Neo4j can help. In fact, many enterprises are leveraging Neo4j to power their business-critical applications. This book offers practical and concise recipes on how and when to successfully leverage Neo4j into architectures.

Authors Christophe Willemsen and Luanne Misquitta walk you through typical Neo4j implementation strategies from proof of concept to iterative improvements and, finally, to production readiness and beyond. By the end of this book, you should understand how to:

  • Make practical decisions in the proof of concept stage to maximize value
  • Revisit and revise your decisions when transitioning to production
  • Configure and implement observability features for in-production data graphs
  • Integrate graph databases into existing enterprise architectures

Publisher resources

View/Submit Errata

Table of contents

  1. Brief Table of Contents (Not Yet Final)
  2. 1. How to Get Value from Graphs in Just Five Days
    1. Dissonance at ElectricHarmony
    2. Why Graph Databases?
    3. Graph Use Cases
    4. Neo4j
      1. Native graph databases
    5. Cypher
    6. The song recommendation system: A proof of concept
      1. Day 1
      2. Day 2
      3. Day 3
      4. Day 4
      5. Day 5
      6. Summary
  3. 2. Importing (Much) More Data
    1. Database transactions
    2. The beat heap box
    3. The CALL IN TRANSACTIONS operation
    4. Try it: Importing data from client applications
      1. Cypher query parameters
      2. Batch sizing
    5. Parallel writes
      1. Competing for memory
      2. Locking mechanisms
      3. Simultaneous updates to nodes and relationships
      4. Creating nodes and relationships concurrently
      5. Adding relationships concurrently
    6. Offline import
    7. Summary
  4. 3. Data Modeling
    1. It Depends
    2. Principles of Modelling
    3. Properties vs. Nodes
      1. Properties that decorate the result
      2. Traversing across commonalities
      3. Modelling concepts as labels
    4. Node Fanout
      1. Key takeaways
    5. Supernodes
      1. Key takeaways
    6. Relationship Granularity
      1. Quantified Relationships
      2. Bucketed Relationships
      3. Key takeaways
    7. Bidirectional Relationships
      1. Key takeaways
    8. Summary
  5. 4. Modelling and Refactoring Patterns
    1. Hyperedges– N-way Relationships
      1. Key takeaways
    2. Time-based Versioning
      1. Key takeaways
    3. Representing Sequences
      1. Finding the last track in a playlist
      2. Maintaining track order
      3. Key takeaways
    4. Refactoring Patterns
      1. Refactoring to change the type of a relationship
      2. Refactoring to create a node from a property
      3. Refactoring to create a node from a relationship
      4. Key takeaways
    5. Summary
  6. 5. Query Analysis and Tuning
    1. Query Execution
      1. Pattern Anchors
      2. Query Profiling
      3. Row Cardinality
    2. Matching Disconnected Patterns
    3. Increasing Anchor Selectivity
      1. Eliminating Redundant Filter Operations
      2. Improving anchor selectivity in queries with predicates
      3. Indexing Guidelines
    4. Node Degrees
    5. Don’t Be Eager!
      1. Sorting
    6. I Want to Break Free (of the Planner)
    7. Cypher Runtimes
    8. Parameterizing Queries
    9. Monitoring and Measuring Query Times
    10. Summary
  7. 6. Search
    1. What Is Search?
      1. Text
      2. Indexes
    2. Searching for Data
      1. Partial Searches
    3. Text Indexes
    4. Full-Text Indexes
      1. Multi-token searches
      2. Phrase Searches
      3. Wildcard searches
      4. Fuzzy search
    5. Additional Index and Query Considerations
      1. Tokenization
      2. Special Characters: Hashtags and Mentions
      3. Identifiers, IP addresses, and other nonword terms
      4. Stopwords: To be or not to be
      5. Performance with graph patterns
    6. Summary
  8. 7. Practical Graph Data Science
    1. Introduction to the Graph Data Science library
      1. Algorithms
      2. The Graph Catalog
    2. AI-driven playlist communities
      1. Building a co-occurrence graph
      2. Start small
      3. Create the co-occurrence relationships
      4. Using GDS
      5. Rinse and repeat
    3. Summary
  9. About the Authors

Product information

  • Title: Neo4j: The Definitive Guide
  • Author(s): Christophe Willemsen, Luanne Misquitta
  • Release date: May 2025
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098165659