Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Graph Database

nounRetrieval and Knowledge Systemsalso graph DBMS, property graph database, triple store

In one line

A graph database is a database that stores data as nodes, edges and properties, treating the relationships between items as first-class data so that connected information can be traversed and queried efficiently.

A graph database is a database that stores data as nodes, edges and properties, treating the relationships between items as first-class data so that connected information can be traversed and queried efficiently. Nodes represent entities such as people, accounts or products, edges represent relationships such as follows, owns or purchased, and properties hold details such as names and dates. Graph databases are the usual storage layer for a knowledge graph and are valued wherever the connections in the data matter as much as the items themselves.

How it differs from relational databases

A relational database stores records in tables and represents relationships through shared keys that must be joined at query time. Joining many tables, as in a question about friends of friends of friends, becomes slow and complex as the number of joins grows. A graph database stores relationships directly and follows them from node to node, a design often called index-free adjacency in native systems, so the cost of a traversal depends on the part of the graph visited rather than on the size of the whole data set. Relational systems remain better for uniform records, heavy aggregation and well-understood transactions.

Data models

  1. Property graph: nodes and edges each have a label or type and a set of key-value properties. It is flexible and popular for application development.
  2. RDF triple store: every fact is a subject, predicate and object triple with web identifiers, supporting standards for linked data and reasoning. It is common in publishing, life sciences and government.
  3. Hypergraph and other models: allow edges to connect more than two nodes, used in specialized systems.

Query languages

  • Cypher: a pattern-matching language that draws nodes and relationships with arrows, adopted by several products and the basis of the GQL standard.
  • GQL: the Graph Query Language, standardized by ISO in 2024 as a common language for property graphs.
  • Gremlin: a step-by-step traversal language from Apache TinkerPop.
  • SPARQL: the standard language for RDF triples.
  • SQL extensions: the SQL standard added property graph queries in 2023, and some relational systems support them.

Examples of systems

Well-known products include Neo4j, Amazon Neptune, TigerGraph, ArangoDB, JanusGraph, Memgraph and Azure Cosmos DB with its Gremlin interface. Triple stores include Apache Jena, GraphDB and Virtuoso. Some general databases, such as PostgreSQL, offer graph add-ons. The right choice depends on data size, query patterns, consistency needs and cost.

Typical uses

  • Social networks: friend suggestions and influence analysis.
  • Recommendations: items bought by people with similar histories.
  • Fraud detection: rings of linked accounts, devices and addresses.
  • Knowledge graphs: storing entities and facts for search and assistants.
  • Network and IT operations: mapping dependencies among services and hardware.
  • Supply chains: tracking parts, suppliers and shipments.
  • Identity and access management: relationships among users, groups and permissions.
  • Life sciences: linking genes, proteins, diseases and drugs.
  • Route planning and logistics: finding paths through networks.

Graph databases and AI

AI systems use graph databases to hold structured knowledge that can be queried exactly. In retrieval for large language models, a graph can store entities and relationships extracted from documents, so a system can answer multi-step questions by following links. Graph algorithms, such as community detection and centrality, create features for machine learning, and graph embeddings turn nodes into vectors that can be searched with vector search. Many databases now combine graphs, vectors and text indexes in one product, supporting approaches that blend semantic search and relationship queries.

Performance and design

Good graph design starts with the questions to be answered. Modelers choose which things become nodes and which become relationships, add indexes on properties used to find starting points, and avoid supernodes, which are nodes with millions of connections that slow traversals. See also database indexing. Large graphs can be spread across machines, although partitioning a highly connected graph is difficult because edges cross partitions.

Limitations

  • Aggregations and bulk analytics: summing or counting across huge tables is often better on relational or columnar systems.
  • Scaling: distributing a graph is harder than distributing independent records.
  • Skills and tooling: fewer engineers know graph modeling and query languages.
  • Schema discipline: flexible schemas can become messy without governance.
  • Standards: several models and languages exist, though GQL aims to unify them.

A worked example

A bank wants to find accounts that may belong to the same fraud ring. It loads customers, accounts, phone numbers, devices and addresses as nodes, with edges showing which customers use which items. A query finds groups of accounts that share a device or phone number with a flagged account within three hops. In a relational database, this required several large joins that took minutes. In the graph database, the traversal returns a connected cluster in under a second, and investigators review the whole network at once.

Algorithms on graphs

Graph databases and graph analytics engines support algorithms that reveal structure. Shortest path finds the cheapest route between two nodes, such as the fewest transfers on a rail network. Centrality measures, such as PageRank and betweenness, rank nodes by importance in the network. Community detection groups nodes that are densely connected, which can expose customer segments or fraud rings. Similarity and link prediction algorithms suggest missing relationships, for example likely collaborators or products often bought together. These outputs can be stored back in the graph as properties and used by applications.

Consistency and transactions

Many graph databases support ACID transactions, which means that a group of changes either completes fully or not at all, protecting data integrity in applications such as finance and identity. Distributed systems may relax some guarantees to scale, trading strict consistency for speed. Teams choose according to their needs, and they test backup, recovery and performance under realistic loads before relying on a system in production.

Getting started

Newcomers usually begin by sketching the data on a whiteboard as circles and arrows, which is already the graph model. They load a sample of real data, write queries for three or four important questions and compare the effort with the current approach. A small pilot on one use case shows whether the connected view delivers value before an organization commits to wider adoption.

FAQs

Is a graph database the same as a knowledge graph? No. The database is the storage technology, and the knowledge graph is the connected knowledge stored in it.

When should I choose a graph database? When relationships are central and queries follow many links, such as in fraud, recommendations and networks.

Can graph databases replace relational ones? Rarely. They are usually used alongside relational systems for the tasks they do best.

Key facts

  • The property graph model and the Cypher query language were popularized by Neo4j, whose first public release came in 2010.1
  • Apache TinkerPop, with its Gremlin traversal language, provides a common framework for many property graph databases.2
  • SPARQL, standardized by the W3C, is the query language for RDF data stored as triples.3

Related concepts

Quick checkWhat is a graph database?Show answer

It is a database that stores data as nodes, relationships and properties, so that queries that follow connections between items are fast and natural to express.

Sources

  1. Neo4j, What is a graph database?, https://neo4j.com/docs/getting-started/get-started-with-neo4j/graph-database/
  2. Apache TinkerPop, Documentation, https://tinkerpop.apache.org/docs/current/reference/
  3. W3C, SPARQL 1.1 Query Language, https://www.w3.org/TR/sparql11-query/

Editorially reviewed by Specialty Digest Editorial TeamLast reviewed November 17, 2026Researched and drafted with AI assistanceReport an issue