Back to roadmap
Module 7 · NoSQL, Search, Graph, ObjectDay 06525 min

Graph Databases

When relationships are the thing you query.

Day 065

Graph Databases

User
datastore
User
datastore
Device
datastore
Signal path
Nodes and edges
User
datastore
uses
Device
datastore
User
datastore
uses
Device
datastore
User
datastore
transfer
User
datastore
Memory hook

Graph Databases: when relationships are the thing you query

Mental model

match the datastore to the access pattern

Design lens

Graph DBs scale less easily than KV.

Recall anchors
ModelsUse cases

Why it matters

Graph databases (Neo4j, Neptune, JanusGraph) store nodes and edges as first-class entities with O(1) hop traversal. They shine for queries like 'friends of friends' or 'shortest path'.

Deep dive

Property graph: nodes and edges have labels and properties.

Triple store: subject-predicate-object; basis of RDF / SPARQL.

Don't reach for graph DBs for tabular data; relational + recursive CTE often suffices.

Demo / scenario

Detect fraud rings via N-hop relations.

  1. Nodes: users, devices, accounts.
  2. Edges: shares_device, transferred_to.
  3. Cypher: MATCH (u)-[*1..3]-(v) WHERE u.flag=true.
  4. Identify clusters within latency budget.

Tradeoffs

  • Graph DBs scale less easily than KV.
  • Multi-hop queries are cheap; simple lookups are not always.
  • Schema is loose but consistency rules matter.

Diagram

usesusestransfer
User
User
Device
Nodes and edges.

Mind map

Check yourself

Loading quiz…

Sources & further reading