A guide to Neo4j: Property Graph Modeling and Bounded Traversals

How to work through this course

Seven modules, about eighty-five hours. Neo4j is the most enjoyable database in this programme to write queries for and the easiest to take down with one of them, so most of the advice here is about that asymmetry.

Bound every traversal, from the first query you write. Upper hop limit, relationship type, direction, anchored start. Do it even on a toy dataset where it does not matter, because the habit is what protects you later - and MATCH (a)-[*]-(b) is four characters shorter than the safe version, which is exactly why people write it. Then set the four query limits from Module 6 on every instance you run, including development, so that when you do write a bad query you get an error instead of a dead server.

PROFILE is the habit that separates competence from guessing. Not EXPLAIN - PROFILE, which actually runs the query and reports database hits. Read it bottom up, watch where the row count grows, and look for the four bad operators: AllNodesScan, CartesianProduct, a Filter discarding most of its input, and Eager in a write query. Four shapes, and they account for most Neo4j performance problems.

Keep Neo4j Browser open and look at the pictures. It draws query results as a graph, and a wrong model is visible there in a way it is not in a table of rows. A :Person node with a thousand :HAS_NAME relationships looks absurd on screen and perfectly reasonable in a schema document. Use the visualisation as a design review tool, not just an output format.

The model test is one question: does a traversal through this node answer a question you actually ask? If yes, it is a node. If no, it is a property. That single question resolves both failure modes - the under-modelled graph where everything is an attribute and nothing can be traversed, and the over-modelled graph with ten times the nodes and traversals through meaningless hops. Module 2's two-model comparison is the exercise that makes it concrete, and the useful finding is not that the graph model is faster but that it can express a question the property model cannot ask at all.

Learn MERGE properly, early, because its traps produce silent duplicates. Merge on identifying properties only. Merge nodes separately from relationships. Create the constraint before the bulk load. Those three rules prevent the great majority of "why does my graph have two of everything" incidents, and the duplicates are invisible until a query returns twice what it should.

Find your supernodes before they find you. One query, run on any graph you inherit, ordering nodes by degree. A node with half a million relationships turns the cheap hop that justifies the whole architecture into a very expensive one, and the queries that pass through it need different bounds - or a model that routes around it. Do it in Module 1 and again whenever the data grows.

Be clear-eyed about the edition boundary. Community is genuinely free and genuinely limited: no role-based access control, no clustering, no online backup. For learning it is fine. For a production system, the honest question is not whether Enterprise or Aura is expensive but what the Community constraints cost you - backups that need downtime, authorisation you implement yourself, and no failover. Put both numbers in the comparison and let them speak.

What to skip on a first pass. The Graph Data Science library beyond projecting a graph and running WCC, PageRank and Louvain - it is a large and genuinely valuable subject of its own. APOC beyond apoc.load.json and the periodic iterate procedures, which CALL { } IN TRANSACTIONS has largely replaced. Vector indexes and the retrieval-augmented-generation patterns, which are recent and move quickly. Fabric and composite databases. The Bolt protocol internals. And the older shortestPath alternatives from before GDS existed, which you will still find in old answers online.

Where to look things up. The official documentation is good and the Cypher manual is the page you will keep open. The GraphAcademy courses are free, well made and hands-on. Graph Databases (the O'Reilly book) is dated on the API and still the clearest explanation of why index-free adjacency matters. And the Cypher refcard is worth printing, because nobody remembers the exact syntax of reduce.

One closing thought. Graph databases attract a particular kind of over-enthusiasm - the belief that because all data has relationships, all data belongs in a graph. It does not: Neo4j will not beat PostgreSQL at aggregating a column and is not where your orders table goes. What it does, that nothing else in this programme does well, is let you ask questions about paths - who is connected to whom, through what, within how many steps - and get an answer in milliseconds on a graph of any size. When that is your question, it is close to unanswerable elsewhere. The most valuable thing this course can give you is the judgement to tell when it is your question, and the discipline to bound the query when it is.

neo4j database