Neo4j Graph Database Overview

November 17, 2026

·

6 min read

#databases
...
...

Most databases are good at storing things. A graph database is good at storing how things connect to each other. That sounds like a small difference, but it changes which questions are cheap to ask and which ones turn into a 40 line query nobody wants to maintain.

This is a walkthrough of what Neo4j is, how it differs from the relational databases most of us grew up on, and where it earns its keep.

What is a Graph Database?

Neo4j stores data as nodes, relationships and properties. No tables, no documents.

A node is a thing: a Person, a Movie, an Employee. It gets one or more labels that say what kind of thing it is, and any number of key value properties like name or born.

A relationship connects two nodes. It always has a start node, an end node and a direction, and it has exactly one type, like ACTED_IN or BELONGS_TO. Relationships can carry properties too, so you can store the role an actor played right on the ACTED_IN link.

Think of it as storing data the way you’d sketch it on a whiteboard. Honestly, that’s the best selling point. If you can draw your domain as circles and arrows, you’ve already designed most of your schema.

One more detail worth knowing: Neo4j calls itself a native graph database, meaning the graph model goes all the way down to storage. It isn’t a graph layer sitting on top of some other engine. It also has ACID transactions, clustering and failover, so it isn’t a toy. It’s been around since 2007 and is written in Java and Scala.

Graph vs Relational Database

In a relational database, a connection between two rows is a foreign key, and the database figures out the connection at query time by matching keys across tables. Many to many relationships need an extra join table on top. These operations are compute heavy and memory intensive.

Here’s a simple example. You want to know which departments Alice belongs to.

In a relational model you find Alice in the Employees table, then look up her ID in Dept_Members, then take the department IDs you found and look them up in Departments. Three tables to answer one question.

In a graph you find the Alice node and follow her BELONGS_TO relationships. That’s it. The relationships are stored right next to the data, so following them is a direct hop instead of a search and match.

Here’s my honest take. This pitch is true, but it’s the vendor’s pitch. A well indexed Postgres handles one or two joins without breaking a sweat. The pain shows up when a question needs many hops in a row, like friends of friends of friends, and each extra hop makes the SQL longer and the query slower. That’s the territory where a graph pulls ahead.

What is Cypher?

Neo4j’s query language is called Cypher. It looks a bit like SQL, but you describe a pattern instead of spelling out joins. Arrows in the query look like arrows in your head. Other databases use it too, through the openCypher project.

Finding every movie Keanu Reeves acted in:

MATCH (p:Person {name:"Keanu Reeves"})-[:ACTED_IN]->(m:Movie)

RETURN m

Read it out loud and it nearly explains itself: a person named Keanu, who acted in a movie, return the movie.

Now the fun one. Take a tiny recommendation engine on a movie dataset: who hasn’t Keanu worked with, but who has worked with people he has?

MATCH (keanu:Person {name:"Keanu Reeves"})-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(coActor:Person)

  -\[:ACTED_IN\]-&gt;(:Movie)&lt;-\[:ACTED_IN\]-(other:Person)

WHERE keanu <> other

AND NOT (keanu)-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(other)

RETURN other.name, count(other) AS frequency

ORDER BY frequency DESC

LIMIT 5

In the sample movie dataset, Tom Hanks comes out on top with four paths connecting him to Keanu. A variation of the same query shows that Hugo Weaving and Charlize Theron have worked with both of them, so they’re the ones who could make the introduction.

Swap actors for customers and movies for products and you have “people who bought what you bought also bought this.” Swap them for people and mutual contacts and you have “who can introduce me to this person.” The query shape stays the same. That’s what makes graphs feel reusable.

Neo4j Use cases

The core idea is that many projects are about the relationships between things rather than the things themselves, like how to get from A to B instead of what A and B are. Neo4j is used in financial services, government, energy, technology, retail and manufacturing.

The use cases that come up most:

Recommendations. The movie example above is the textbook case. Walk outward from something a user likes and see what’s nearby.

Fraud and anomaly detection. Finding fraudsters and anomalies is a typical graph data science job. Fraud rings often show up as accounts that share a phone number, an address or a device. That’s a hard thing to see in rows and an easy thing to see in a picture of connected nodes.

Hierarchies and hidden connections. Graphs are good at navigating deep hierarchies and finding hidden links between distant items. Think org charts, bills of materials, permission trees and supply chains.

Networks and routing. Social networks, road networks, anything where “shortest path” or “who is connected to whom” is the real question.

Analytics at scale. Neo4j ships a Graph Data Science library with algorithms for community detection, centrality, node similarity, pathfinding and link prediction. The workflow is to project the data into an in memory graph, run an algorithm on it, and write the results back. The managed AuraDS offering comes with more than 65 pretuned algorithms.

AI applications. Neo4j has a whole section on this: GraphRAG for Python, vector search indexes, an LLM knowledge graph builder, and agent memory. I won’t pretend to evaluate those here. I’ll just say that if you’re feeding an LLM connected facts, a graph is a natural place to keep them.

Conclusion

If your app mostly fetches a row by ID, filters a list and adds up totals, stay relational. It’s simpler, better known and easier to hire for. Graphs shine on connected questions, and I wouldn’t treat them as a better default for everything.

Also, a graph model needs thought. The model should be designed around your expected queries, performance needs and business logic. Draw your questions first, then your nodes.

If you want to try it, AuraDB has a free edition that runs in your browser, there’s an official Docker image, and Neo4j Desktop works for local, non production use. Type :guide in Neo4j Browser to load the movie dataset from the examples above, and the recommendation engine tutorial walks through it. Drivers exist for Java, JavaScript, .NET, Python and Go, and GraphAcademy has free courses.

Take one real question from your own project, something that needs three or more hops to answer. Write it in SQL. Then write it in Cypher against the movie dataset’s equivalent shape. If the Cypher version makes you say “oh, that’s just what I meant,” you’ve probably found a graph problem. If it feels like extra ceremony, stay where you are.

...
...

Discussion

0
Spam & link filter active
0 / 1200

Plain text · No login required · Filtered against spam

Loading notes...