Skip to content

What are NoSQL Databases?

  • Data

NoSQL (“Not Only SQL”) describes databases that, unlike SQL, are non-relational, i.e. cannot be organized in tables, among other things. These approaches can also be distributed across different computer systems and are highly scalable. NoSQL solutions are therefore very interesting for many Big Data applications.

The databases are characterized by two criteria in particular, which are very broad. Firstly, data is not stored in tables and secondly, the query language is not SQL, which is also made clear by the name Not Only SQL.

What are the Advantages of NoSQL solutions?

These database systems offer several advantages over traditional SQL solutions that are crucial in the Big Data environment. The following factors are implemented in almost all NoSQL databases:

  • We can scale NoSQL databases higher than comparable relational data stores because these systems are characterized by very fast data processing, and also because they do not have such high demands on data schemas and can therefore store data faster.
  • Most NoSQL databases are open source and can therefore be used completely free of charge (except for storage capacity, of course), including database management.
  • In practice, there are various data queries that conventional relational databases do not support or support only with a lot of effort.
  • Due to the low demands of NoSQL solutions on the data schema, they are not so restrictive towards the data model. A relational data structure, on the other hand, can be very restrictive on the data model.

ACID Properties of SQL Databases

Classic relational databases fulfill the four so-called ACID properties. These state that the most important requirement for a database is to maintain the truthfulness and meaningfulness of the data. In many cases, data stores are seen as a “single point of truth”, so it would be fatal if erroneous information were stored and passed on. The four properties include the following points:

  • Atomicity (A): Data transactions, e.g. the entry of a new data record or the deletion of an old one, should either be executed completely or not at all. For other users, the transaction is only visible when it is completely executed. In the database of a financial institution, for example, the transfer from one bank account to another is only visible when the transaction is completely executed in both tables.
  • Consistency (C): This property is satisfied when each data transaction moves the database from a consistent state to a consistent state.
  • Isolation (I): When multiple transactions occur simultaneously, the final state must be the same as if the transactions occurred separately. That is, the database should pass the stress test. In other words, incorrect database transactions should not occur due to overload.
  • Durability (D): The data within the database must only change as a result of a transaction and must not be changeable by external influences. For example, a software update must not inadvertently cause data to change or possibly be deleted.

Does NoSQL meet the ACID properties?

NoSQL solutions generally cannot comply with the ACID properties, although there are exceptions, such as graph databases, which comply with all concepts. NoSQL databases are in many cases distributed across multiple devices and servers. This allows much larger amounts of data to be processed and stored simultaneously, which is the main requirement for these systems. However, this means that they do not fulfill the property of consistency.

Suppose we have implemented a NoSQL database on two physical servers, one located in Germany and the other in the USA. The databases contain the account balances and transactions of German and American customers. The German accounts are stored in Germany and the American accounts are stored on the American server.

It may now happen that a German customer makes a transfer to an American account. Then both data stores are changed and are inconsistent during this processing period. For example, it may happen that we start a database query while the processing in Germany has already been completed, but the processing in the USA has not yet been completed. In this time window, the “Inconsistency Window”, the data in the database is not correct and is inconsistent. This would not happen in a relational database.

What are the different NoSQL Categories?

NoSQL solutions fall into one of four categories:

Das Bild zeigt die vier Kategorien von NoSQL Datenbanken, also Document Stores, Key-Value Stores, Wide Column Stores und Graphdatenbanken.
NoSQL Database Categories
  • Document stores store a variety of information within a document. For example, a document could contain all the data for one day.
  • Key-value stores are a very simple data structure in which each record is stored as a value with a unique key. This key can be used to retrieve specific information.
  • Wide-Column Store store a data record in a column and not as usual in a row. They have been optimized to quickly find information in large data sets.
  • Graph databases store information in so-called nodes and edges. This makes it very easy to represent social networks, for example, in which people are individual nodes and the relationship between them is represented as an edge.

What are Examples of Not Only SQL Databases?

The best-known examples of NoSQL databases are Apache Cassandra, MongoDB, Redis or Neo4j. These also belong to the different NoSQL database categories:

  • MongoDB belongs to the Document Stores. The individual data records are stored in so-called documents, whereby one can imagine a data record as a row in a relational database. All documents with a comparable structure are summarized in the so-called collections, which are again comparable with a database in the relational environment.
  • Redis is a key-value store that is primarily used with streaming solutions such as Apache Kafka. Real-time data is cached in it and made available for analyses or calculations. Due to the very short latency times, it offers the optimal solution for chats, games, or caching applications.
  • Apache Cassandra is an open-source wide-column store. This solution is made to store large amounts of data on distributed systems, ensuring high accessibility.
  • Neo4j is a graph database that can be used for free to a certain extent. With the help of nodes and edges, knowledge graphs can be organized or social networks can be mapped, for example.

Why do we need NoSQL Databases?

NoSQL solutions are especially suitable when the advantages of these databases are a main component of the application. The most important factors in such projects are usually that one does not have a uniform data schema, a very large amount of data is expected that one wants to distribute across different systems and data must be processed very quickly. In such cases, one also accepts a short-term inconsistency of the information.

A classic example of this is web movement data, which is all the information we collect about a user who is on our website. On an established site, a lot of data can accumulate very quickly in a short period of time, especially if we want to track the user’s actions in a very granular way. At the same time, we have a large and flexible data structure with logins, visits to different pages, and many buttons that can potentially be clicked. In this case, it makes sense to use a graph database, where we can track this movement pattern very well across the edges.

This is what you should take with you

  • NoSQL solutions are a comparatively new type of database that break with traditional concepts of relational databases.
  • They are mainly used when you need to process a lot of data quickly and also accept minor inconsistencies for this.
  • These databases can be divided into four categories: Document Stores, Key-Value Stores, Wide-Column Stores, and Graph Databases.

Other Articles on the Topic of NoSQL

close
Das Logo zeigt einen weißen Hintergrund den Namen "Data Basecamp" mit blauer Schrift. Im rechten unteren Eck wird eine Bergsilhouette in Blau gezeigt.

Don't miss new articles!

We do not send spam! Read everything in our Privacy Policy.

Cookie Consent with Real Cookie Banner