Learn Neo4j

Native graph database queried with Cypher, for highly connected data

16 lessons · 4 hours · 4 levels · covers Neo4j 2025.x (Cypher 5)

Neo4j is the most widely used graph database: it stores data as nodes and relationships and queries them with Cypher, a pattern-matching language. It shines where relationships are the point, such as recommendations, fraud detection, knowledge graphs, networks and access control. Learning it teaches you to model and query connected data far more naturally than with joins.

Before you start

Neo4j builds on these; the tree links to the exact lessons you need.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics5 lessons · 56 min in total
2. PracticalUse it productively at work, with the usual idioms9 lessons · 2 hours in total
3. AdvancedThe less common features, performance and trade-offs13 lessons · 3 hours in total
4. ExpertInternals and the edge cases experts know16 lessons · 4 hours in total

The Neo4j tree

Neo4jThe property graph modelThe property graphmodelCreating nodes and relationshipsCreating nodes andrelationshipsMATCH, WHERE and RETURNMATCH, WHERE andRETURNMERGE, SET and DELETEMERGE, SET andDELETEMulti-hop patterns and OPTIONAL MATCHMulti-hop patternsand OPTIONAL MA…Aggregation and WITHAggregation andWITHConstraints and indexesConstraints andindexesParameters and the Python driverParameters and thePython driverImporting data with LOAD CSVImporting data withLOAD CSVDefining functionsDefining functionsContext managers and withContext managersand with
Essentials and Practical shown (9 of 16 lessons); the full list is below. Click a lesson to read it.

All 16 lessons, in order

The graph model

  1. The property graph model · Essentials · 10 min

    Data as nodes with labels, relationships with types and direction, and properties on both; and how to start a Neo4j instance.

Cypher basics

  1. Creating nodes and relationships · Essentials · 10 min

    Write data with CREATE using ASCII-art patterns: (nodes) and -[relationships]->.

  2. MATCH, WHERE and RETURN · Essentials · 12 min

    Read data by describing a pattern with MATCH, filter it with WHERE, and shape output with RETURN, ORDER BY and LIMIT.

  3. MERGE, SET and DELETE · Essentials · 12 min

    Create data only if missing with MERGE, change properties and labels with SET and REMOVE, and delete with DETACH DELETE.

Querying patterns

  1. Multi-hop patterns and OPTIONAL MATCH · Essentials · 12 min

    Match longer paths, several patterns at once and optional parts, and understand how variables tie patterns together.

  2. Aggregation and WITH · Practical · 14 min

    Count, collect and sum with implicit grouping, and chain query parts with WITH to filter on aggregates.

  3. Variable-length and shortest paths · Advanced · 15 min

    Traverse an unknown number of hops with quantified path patterns, and find shortest paths with SHORTEST.

  4. Lists, UNWIND and subqueries · Advanced · 15 min

    Work with lists via UNWIND and comprehensions, and use EXISTS, COUNT, COLLECT and CALL subqueries.

Schema and data loading

  1. Constraints and indexes · Practical · 14 min

    Add uniqueness and key constraints to keep data clean, and range, text and full-text indexes to find starting nodes fast.

  2. Importing data with LOAD CSV · Practical · 14 min

    Load CSV files into the graph with LOAD CSV, MERGE on constrained keys, and batch large imports with CALL IN TRANSACTIONS.

  3. Graph data modelling · Advanced · 15 min

    Design labels, relationship types and properties around your questions: when to use nodes, relationships or properties.

Applications

  1. Parameters and the Python driver · Practical · 14 min

    Run Cypher from Python with the official driver: execute_query, parameters, routing and result handling.

  2. Transactions, locking and clusters · Expert · 15 min

    ACID transactions in Neo4j, read-committed isolation, write locks and deadlocks, and causal consistency in clusters.

Performance and internals

  1. EXPLAIN, PROFILE and query tuning · Advanced · 15 min

    Read execution plans, compare db hits with PROFILE, and fix label scans, cartesian products and eager operators.

  2. Native graph storage and memory · Expert · 15 min

    How Neo4j stores nodes and relationships for index-free adjacency, handles dense nodes, and uses the page cache and heap.

  3. Graph Data Science algorithms · Expert · 15 min

    Run graph algorithms such as PageRank, community detection, similarity and weighted shortest paths with the GDS library.