data-infra
Glossary ↗Graph Database
A graph database stores data as nodes (entities) and edges (the relationships between them), making connections first-class rather than something you reconstruct with JOINs. Where a relational query to find 'friends of friends who like X' means several expensive joins, a graph database walks the edges directly, and its performance barely degrades as the relationships deepen. Neo4j, and Postgres extensions, are common entry points. It shines whenever the relationships are the point: social graphs, recommendation engines, fraud rings, permission hierarchies, and knowledge graphs that ground LLM answers (GraphRAG). For SaaS builders, reach for a graph database when your queries are mostly about how entities connect, not about aggregating columns — an access-control system asking 'can this user reach this resource through any path' is a perfect fit. Practical note: it's a specialized tool, not a default. Most apps are served fine by a relational database until relationship-traversal queries become the bottleneck.
Related terms