9bNine Bits

What Is a Graph Database?

A graph database stores data as nodes (entities) and relationships (edges) rather than as rows in tables, and treats relationships as first-class data instead of something computed at query time through joins. In many graph databases, traversing connected nodes is close to a direct operation, so performance depends more on the size of the local neighborhood than on the size of the whole dataset. This makes graph databases well suited to data that is naturally about connections, such as social networks, fraud rings, recommendation paths, and dependency graphs.
What Is a Graph Database?

 

The graph database refers to the database systems using the graph data model. The term “data model” is about the way how a database system views and processes its data. For example, the relational data model views the data in terms of tables, that is the relation. The relation is a mathematical expression for the tables. In the relational model, the data is organized as rows with predefined columns.

When we model a real-world phenomena, we first determine entities and their relationships, and the result is the ER diagram. But this is not the end. We have to design table schemas for the entities and relationships. The ER diagram should be mapped to tables, but sometimes it is not intuitive to map the real-world data into tables because tables have very strict and rigid form. There exists some kinds of impedence mismatches between the real-world phenomena and the relational model.

But the graph data model views the data in terms of graphs. The graph data model consists of entities and their relationships, by themselves. That is, they are not mapped to tables. When using the graph data model, users can deal with the data by entities and relationships directly. So data modeling using the graph model is much easier and more intuitive than the relational data model.

 

Relational Model vs. Graph Model

Let’s view an example. This is a case for product sellers and their customers; a seller has inventories for their products, and a customer orders products and rates them. So we can make conceptual model for this situation like this. If we are using the relational model, we should make tables for the seller, product and customer, these are the tables for entities. And we also make tables for the relationships; inventory, product_rates and order. And there are several referential constraints between entity tables and relationship tables. We must care about the join key between tables in order to query these tables. This is a simple example so the schema is not very complex. But in many real cases, the schema can be huge and it is not easy to understand the complex table schemas.

However, in graph model, there is no need to design tables. Just make nodes for entities and relationships between them. Roughly we can use the ER diagram directly in the graph database. We don’t need to declare referential constraints, consider normalization/denormalization and no need to remember the join keys between tables. So it is much simpler to model complex real world situations as the graph model.

Simplicity of Graph Queries

The simple data model make the query also simple.

This is an example from an academic paper(Zhu, Y., Yan, E., & Song, I.-Y., The use of a graph-based system to improve bibliographic information retrieval: System design, implementation, and evaluation. Journal of the Association for Information Science & Technology 2016). This paper introduces a bibliographic search system which uses a graph database. And it compares the implementation to using mysql. This is comparison of queries for search an author’s information cited by database papers. Cyper query is more concise because we do not need to specify join predicates at all. It concludes that when using graph database, the query can be much simpler than relational databases.

 

Conclusions

The motivation of graph database is for simple and intuitive datamodel. Graph data model is very promising because of their simplicity and intuitiveness. And graph query language, like Cypher, can dramatically reduce developer’s efforts to make and debug complex SQL queries. This is the most important motivation of the graph database. And graph database is optimized to process complex connections because they are specialized to handle the complex connected data. And the graph analytics are also important. Graph data model can provide different visualization from other databases using graph traversals. So, data scientists can explore and traverse the graph data to discover valuable insights, and graph analysis algorithms can also help to discover hidden values from their connected data.

 

Common questions

Is a graph database just a relational database visualized differently?

No. A relational database can represent connections through foreign keys, but it computes them at query time with joins. A graph database stores relationships as first-class data, so traversing a connection does not require recalculating it through a join.

Can I use graph queries inside PostgreSQL?

Yes, through extensions such as Apache AGE, which adds a graph data type and an openCypher-style query language on top of regular PostgreSQL tables. For workloads dominated by deep or wide traversals, a database built natively around a graph storage engine is often still faster.

What is the difference between a property graph and an RDF graph?

A property graph stores arbitrary key-value properties directly on nodes and relationships and is queried with languages like Cypher or Gremlin. An RDF graph stores data as subject-predicate-object triples identified by URIs and is queried with SPARQL, a model built for linking data across systems and organizations.

Do graph databases replace SQL databases?

Usually not. Most applications keep transactional or reporting data in a relational database and add a graph database, or a graph extension, specifically for the parts of the workload that involve deep relationship traversal.

Sources

  1. Apache AGE
  2. Apache TinkerPop (Gremlin)
  3. W3C RDF

About this page

Last reviewed October 30, 2026 by the Nine Bits editors. Read our editorial policy or report an error.