Why a Graph Database

Connected data is cheap to traverse — and expensive to join.

0/1 done

The shape of the problem

The relational tax on connected questions

How many people, at most 3 friendship-hops away, work at companies founded after 2015? — in SQL this is three or four JOINs plus a recursive CTE. In a property graph it is four lines of Cypher and the engine walks pointers instead of computing Cartesian products.

A property graph has three primitives:

  • Nodes — entities (Person, Company, City).
  • Relationships — typed, directed edges ((:Person)-[:WORKS_AT]->(:Company)).
  • Properties — key/value data on both nodes and relationships.

Neo4j stores relationships as first-class records with direct pointers, so a traversal is O(degree) — not O(table-scan + hash-join).

Filing cabinet vs whiteboard

Think of a relational DB as a filing cabinet: every drawer is a table, every connection requires you to walk to another drawer, read the index, and pull a file. A graph DB is a whiteboard with sticky notes and arrows: each note already points at the notes it relates to. To answer 'who knows whom?' you follow arrows, you don't search other drawers.

The Neo4j landscape map

Click a node to focus its neighbourhood · drag to pan · scroll to zoom
  • primitive
  • language
  • tuning
  • advanced
  • production

A tiny property graph: two Person nodes, one Company, one City — and the relationships that tie them together.

Make it concrete

Pick a feature in your current app that involves connected data — recommendations, access control, social, fraud rings, supply chain.

  • How many SQL joins does today's implementation need?
  • Could you state the same question in plain English in one sentence?
  • If 'yes' to the second — Cypher will probably write itself.

Reading in progress · 0 of 1 activity done