DatabaseIF
Core Guide

Graph Databases

Nodes, edges, and properties. Because `JOIN` tables break down when traversing more than three levels deep.

The Problem with JOINs

In a relational database, traversing relationships (e.g., "Find all friends of friends who bought product X") requires recursive CTEs or multiple expensive JOIN operations. Graph databases treat the *relationship* as a first-class citizen, making traversal operations constant time ($O(1)$) rather than expanding exponentially.

Neo4j

The pioneer of the modern graph database. Uses Cypher, a declarative query language optimized for pattern matching. Excellent for fraud detection, recommendation engines, and complex access control lists (ACLs).

When NOT to use a Graph DB:

  • Simple CRUD applications (overkill).
  • Time-series data (use InfluxDB or Timescale).
  • Large scale aggregations (use an OLAP column store).