NoSQL advantages and challenges in 2019

By: Segiy Sergienko, 19 Jun 2019
6   min read
Reading Time: 6 minutes

NoSQL databases (“Non SQL” or “Not Only SQL,” depending on the interpretation of each particular case), also referred to as post-relational databases, are repositories that do not obey the usual data storage rules (ACID). In such databases, there is no rigid binding to the structure, and the intersection of tables is not used. In contrast to the traditional relational database model, non-relational solutions have several advantages, including increased performance, extensive support for various types of data, and low maintenance costs. Below we will provide a brief insight into the concept of NoSQL, as well as a number of related concepts, and determine the reasons for its use in specific software solutions.

What is NoSQL

In order to understand what a non-relational database is, let’s start with defining the counter-concept: the relational database.

So, a relational (SQL) database is a collection of interrelated tables where each of the cells is intended to store information of a certain type. They are usually used to organize data on objects from the real world. The concept of relational databases originated in the distant 80s and is still relevant today. Indeed, relational databases have many advantages:

  • ease of use;
  • low dependence between data distributed in different categories (which means that changes are rarely inconsistent with the information that is already stored in the database);
  • data management at the level of the internal language of the database is performed using simple and logically comprehensible commands based on the SQL language, and there is no need to understand how the database is organized in external memory.

So why did the need arise to develop something alternative that, in the end, led to the emergence of the NoSQL database?

The truth is that relational databases have a number of drawbacks. Here are the most obvious ones:

  • the relational model has a low access speed and requires a lot of external memory;
  • as a result of the logical design, there are often a lot of tables, which makes it difficult to understand the data structure;
  • the subject area cannot always be represented as a set of tables, and sometimes it makes sense to form much more complex data structures.

The non-relational database model, a concept that only appeared in 1998 and started operating 11 years later, is a database that does not use the tabular row and column layout typical of traditional database systems. Instead, non-relational databases use a storage model that does not focus on types, but on their requirements for storage. These can be key-value pairs, mathematical graphs, columns, documents, and even their combination (such databases are called multi-model). Thanks to this approach, non-relational databases have become widespread (in particular, the NoSQL DB MongoDB is among the five most popular databases in the world).

NoSQL DBs rarely use the traditional DB language SQL, instead using other programming languages. The most popular examples of NoSQL DB are MongoDB, GemFire, Cassandra, Mnesia, CouchDB, HBase, and others. You can find a full list of NoSQL DB here.

Comparing SQL and NoSQL

In order to understand when it makes sense to turn to NoSQL and when to choose a traditional relational database, let’s compare them by several fundamental criteria:

  • data format: relational databases impose strict restrictions on the structure of data storage, which is not the case with NoSQL databases;
  • method of querying: NoSQL databases from various suppliers have their own query construction rules tied to a specific programming language; for SQL databases, the rules and query construction language are always the same (it’s SQL)
  • scalability: when it comes to horizontal scaling, NoSQL databases behave much better, and the scaling procedure itself is less resource intensive. (Alternatively, you can simply form clusters, and this will minimally complicate the structure of existing databases without burdening them with redundant links.)

NoSQL Pros and Cons

NoSQL databases are considered an ideal choice for building scalable applications or applications that operate with large amounts of data while requiring high performance and minimal increased complexity of the data access scheme when scaling. Below we have systematized the key advantages and disadvantages of NoSQL DBs.

Pros

  • Ease of implementing data access. NoSQL databases provide developers with extremely flexible data interaction schemes. This means that work on projects is accelerated, which is especially important for technically difficult solutions that involve partially structured data or data with an undefined structure.
  • NoSQL databases are quite easy to scale and do not require the formation of redundant links. This means that their structure does not become too complex with the growth of applications and for this reason does not require the installation of additional high-power equipment for vertical scaling. Thus, in most cases, scaling will be carried out in a horizontal plane (through clustering), which will have a very positive effect on the overall budget of the project.
  • High performance. NoSQL databases are optimized for working with big data. Thus, you do not have to sacrifice the speed of the application in order to scale it (as would be the case with relational databases).
  • Ability to integrate with numerous third-party solutions. Due to the lack of binding to specific data types, NoSQL database APIs can be used to connect to a wide variety of web services and applications.

Cons

Despite all their advantages, NoSQL DBs can impose certain inconveniences on developers due to the lack of standards in the formation of structures from data and their management (e.g., the lack of a single language for creating queries), as well as a number of difficulties with data sorting and other functions that require access to the elements by key (again, this is because the data itself is either completely unstructured or only has a partial structure).

NoSQL Use Cases

And now let’s look at the most popular cases for using NoSQL DBs.

Prototyping

Standard relational (SQL) databases need some maintenance both prior to starting the development process and during work on the project. This means that before proceeding with the development, you will need to carefully consider the structure of the future database, create it, and then adapt it as you work on the project and make changes to the business requirements. In the vast majority of cases, such a course of events halts the workflow of the entire team: some developers will be waiting until the database transformations are completed, and this means additional expenses and delays to release dates.

To avoid this forced downtime, you can immediately engage a NoSQL database where there are no requirements for the structure, and the data can be stored as documents. In this case, even when adding new fields, you will not affect the existing fields.

Development of scalable software

As you already appreciate, NoSQL databases ensure extremely simple horizontal scaling due to their reduced complexity. This means that instead of buying new expensive high-performance server hardware to support new application services or enhancements to existing ones, you just need to slightly reconfigure the current organization of network hardware to increase cluster resources. As a result, you will receive a proportional increase in cluster characteristics.

Creating binary file storage

If you have no possibility to store binary files, e.g. pictures, locally (it should be noted that local storage is extremely expensive), you can reserve a local cluster in a remote NoSQL database. The choice of specific product will depend on the maximum allowed size of each binary file.

Working on high availability services

If you need to ensure high availability of your services, it makes sense to distribute the database to several data centers that are physically remote from each other. With NoSQL databases, this is easy to do, since this is one of the fundamental concepts of such databases (that is, if the user turns to any node of such a database, they are guaranteed to receive a response).

Caching and buffering

NoSQL databases are especially convenient for the implementation of caching. In addition, they can be used together with relational databases. For example, you can store structured data in a relational database, and when a complex query with multiple joins occurs, the data will be placed in a NoSQL database as intermediate storage, and afterwards go to the relational database.

The same scheme works for organizing the buffering process: when you need to read a large data stream very quickly, it is better to redirect it to a NoSQL database and after that, at set times (for example, once per minute), transfer this data to the relational (main) storage.

NoSQL Challenges

If we summarize the above, we can single out a number of general characteristics of projects where it makes sense to use NoSQL as the solution:

  • the project does not have a single established structure for storing data, or this may change over time;
  • over time, the project will need to be scaled or have its functionality modified, and your task is to ensure the transformations in its structure have minimal impact;
  • the project needs increased data processing speed and scalability.

Conclusion

As you can see, NoSQL is a very useful and cost-effective solution for large-scale and scalable projects. Nevertheless, it is not a panacea: there are a number of situations in which it is much more sensible to use relational databases. Whatever decision may be appropriate for your particular business idea, we are always ready to help you. Our development team can implement a project of any complexity in the shortest possible time, no matter how strict your business requirements are. Contact us right now to discuss your future solution.

Background form

Latest articles

Smart Choices for Smart Devices: Evaluating Edge AI

Edge AI Potential: Why Security Must Come First

The Ukrainian IT: Forged in the Fire of Adversity