Graph database

The relationships allow data in the store to be linked together directly and, in many cases, retrieved with one operation.

Relationships can be intuitively visualized using graph databases, making them useful for heavily inter-connected data.

Some depend on a relational engine and store the graph data in a table (although a table is a logical element, therefore this approach imposes a level of abstraction between the graph database management system and physical storage devices).

As of 2021[update], no graph query language has been universally adopted in the same way as SQL was for relational databases, and there are a wide variety of systems, many of which are tightly tied to one product.

Some early standardization efforts led to multi-vendor query languages like Gremlin, SPARQL, and Cypher.

On the other hand, graph compute engines are used in online analytical processing (OLAP) for bulk analysis.

Several improvements to graph databases appeared in the early 1990s, accelerating in the late 1990s with endeavors to index web pages.

Further, SAP HANA brought in-memory and columnar technologies to graph databases.

A labeled-property graph model is represented by a set of nodes, relationships, properties, and labels.

Both nodes of data and their relationships are named and can store properties represented by key–value pairs.

[15] In an RDF graph model, each addition of information is represented with a separate node.

For example, imagine a scenario where a user has to add a name property for a person represented as a distinct node in the graph.

In a labeled-property graph model, this would be done with an addition of a name property into the node of the person.

A native graph system with index-free adjacency does not have to move through any other type of data structures to find links between the nodes.

Native graph databases use index-free adjacency to process CRUD operations on the stored data.

Gartner suggests the five broad categories of graphs:[17] Since Edgar F. Codd's 1970 paper on the relational model,[18] relational databases have been the de facto industry standard for large-scale data storage systems.

[18] Problems arise when there is a need to form complex relationships between the stored data.

Although relationships can be analyzed with the relational model, complex queries performing many join operations on many different attributes over several tables are required.

In working with relational models, foreign key constraints should also be considered when retrieving relationships, causing additional overhead.

A graph database may become relevant if there is an evidence for performance improvement by orders of magnitude and lower latency.

This can be a time-consuming process in large tables, so relational databases offer indexes, which allow data to be stored in a smaller sub-table, containing only the selected data and a unique key (or primary key) of the record.

For example, if one searches for all of the email addresses for users in area code "311", the engine would first perform a conventional search to find the users in "311", but then retrieve the email addresses by following the links found in those records.

This avoids several searches, look-ups, and the memory usage involved in holding all of the temporary data from multiple records needed to construct the output.

[21] Properties add another layer of abstraction to this structure that also improves many common queries.

If labels on edges are allowed, one could also label the relationship between Gone With the Wind and Clark Gable as "lead", and by performing a search on people that are "lead" "actor" in the movie Gone With the Wind, the database would produce Vivien Leigh, Olivia de Havilland and Clark Gable.

These sorts of labels may improve search performance under certain circumstances, but are generally more useful in providing added semantic data for end users.

For example, an accounting database might need to look up all the line items for all the invoices for a given customer, a three-join query.

These properties make graph databases naturally suited to types of searches that are increasingly common in online systems, and in big data environments.

In this case, searching for all of Jack's friends would result in the following SQL query.

They condense the idea of relational models' query complexity that increases with the total amount of data.

An example of a Labeled-property graph
An example RDF graph