Graph Database

Graph Database is a database that uses graph structures. Ok, let me explain it more. A graph is made up of nodes, edges, and properties, which represent data. Nodes represent entities such as persons or businesses or any other object to be tracked. An edge is a relation between two nodes. Each node can have more than one relations. Property is a relevant information about the node. A database that makes use of such structures, is referred to as Graph Database.

So, what are the advantages of Graph Database?

It stores the data about nodes using edges and properties along with the record itself. This allows applications to retrieve the data much faster as compared to the relational database. It reduces the complexity of traditional “join” statements required in the relational database as data is already linked using edges and properties. Thus, it also improves the performance of the overall database and application as well.

 

Graph Database PropertyGraph
Pictorial representation of Graph Database – Property Graph (Source: Wikipedia)
You can find a good comparison of Graph Database and Relational Database here.

The underlying implementation of Graph Databases may vary. Some may use the relational engine and store the “graph” data in a separate table. Others may use Key-value store (like NoSQL) or document database for storage. As a result, to reap the benefits of the new structure a separate query language is required and one can’t use standard SQL for that. Some of the available query languages are Gremlin, SPARQL, and Cypher. Note that GraphQL is not the query language that is used for Graph Databases.

Graph Database is good for highly connected data such as social networks, or recommendations in e-commerce. E.g. A user of social networking site – represented by Node –  can have a membership with various groups and can have several friends. Each one of those friends, in turn, would have similar connections – relationships – represented by Edges. There would be attributes like birthdates, college etc – represented by Properties.

Related Links

Related Keywords

GraphQL, Relational Databases, Neo4j, MySQL, OLTP, NoSQL

 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.