Goals This guide quickly explains how graph databases are related to other NoSQL databases. Prerequisites You need no prior knowledge of other NoSQL stores, although it might be helpful to have read the guide on graph databases. Beginner Overview Neo4j… Learn More →

Goals
This guide quickly explains how graph databases are related to other NoSQL databases.
Prerequisites
You need no prior knowledge of other NoSQL stores, although it might be helpful to have read the guide on graph databases.
Beginner


Although unhelpfully named, the NoSQL (“Not only SQL”) space brings together many interesting solutions offering different data models and database systems, each suitable for different use cases and shapes of data.

With the advent of the NoSQL movement, the “one-size-fits-all” proposition of large relational systems was replaced by making conscious decisions about finding the right tool for the job.

Most NoSQL systems are aggregate oriented, providing only atomic operations within their natural aggregate, which forms only one dedicated view of your data. Other projections have to be computed crunching or duplicating your data. Focusing on one aggregate at a time allows for easy sharding of bucketed data across a network of machines along the aggregate dimension, for instance the Document in Document Databases.

Graph databases handle fine-grained networks of information providing any perspective on your data that fits your use-cases. Known and trusted from relational systems, transactional guarantees protect updates of that connected data conforming to ACID standards.



NoSQL databases lack relationships
Most NoSQL databases store sets of disconnected aggregates. This makes it difficult to use them for connected data and graphs.
One well-known strategy for adding relationships to such stores is to embed an aggregate’s identifier inside the field belonging to another aggregate — effectively introducing foreign keys.
But this requires joining aggregates at the application level, which quickly becomes prohibitively expensive.
Graph Databases, O’Reilly
— Jim Webber, Ian Robinson


Let’s compare graph databases to other NoSQL systems.

Neo4j in the NoSQL Ecosystem

With the advent of the NoSQL movement, businesses of all sizes have a variety of modern options from which to build solutions relevant to their use cases.

  • Calculating average income? Ask a relational database.
  • Building a shopping cart? Use a key-value Store.
  • Storing structured product information? Store as a document.
  • Describing how a user got from point A to point B? Follow a graph.

nosql space

Relate Key-Value Stores with Graph Databases

The Key-Value model is great and highly performant for lookups of huge amounts of simple or even complex values.

vs key value

When the values are themselves interconnected, you’ve got a graph. Neo4j lets you traverse quickly among all the connected values and find insights in the relationships.

as key value

Navigate Document Stores with Graph Databases

The structured hierarchy of a Document accommodates a lot of schema-free data that can easily be represented as a tree. Although trees are a type of graph, a tree represents only one projection of your data.

vs document

Refer to other documents (or contained elements) within that tree and you have a more expressive representation of the same data that you can easily navigate with Neo4j. A graph data model lets more than one natural representation emerge dynamically as needed.

as document