What is NoSQL?

The term ‘NoSQL’ refers to nonrelational types of databases, and these databases store data in a format that’s different from relational tables. However, NoSQL databases can be queried using idiomatic language APIs, declarative structured query languages, and query-by example languages, which is why they are also referred to as “not only SQL” databases.

What is a NoSQL database used for?

NoSQL databases are widely used in real-time web applications and big data, because their main advantages are high scalability and high availability.

NoSQL databases are also the preferred choice of developers, as they naturally lend themselves to an agile development paradigm by rapidly adapting to changing requirements. NoSQL databases allow the data to be stored in ways that are more intuitive and easier to understand, or closer to the way the data is used by applications—with fewer transformations required when storing or retrieving using NoSQL-style APIs. Moreover, NoSQL databases can take full advantage of the cloud to deliver zero downtime.

SQL versus NoSQL

SQL databases are relational, while NoSQL databases are non-relational. The relational database management system (RDBMS) is the basis for structured query language (SQL), which lets users access and manipulate data in highly structured tables. This is foundational model for database systems such as MS SQL Server, IBM DB2, Oracle, and MySQL. But with NoSQL databases, the data access syntax can be different from database to database.

Relational database versus NoSQL database

To understand NoSQL databases, it’s important to know what the difference is between RDBMS and nonrelational types of databases.

The data in an RDBMS is stored in database objects that are called tables. A table is a collection of related data entries, and it consists of columns and rows. These databases require defining the schema upfront, that is, all of the columns and their associated datatypes must be known beforehand so applications can write data to the database. They also store information linking multiple tables through the use of keys, thus creating a relationship across multiple tables. In the simplest case, a key is used to retrieve a specific row so that it can be examined or modified.

Conversely, in NoSQL databases, data can be stored without defining the schema upfront—which means you have the ability to get moving and iterate quickly, defining the data model as you go. This can be suitable for specific business requirements, whether it’s graph-based, column-oriented, document-oriented, or as a key-value store.

Until very recently, relational databases were the most widely used models. They are still extremely ubiquitous with many businesses; however, the variety, velocity, and volume of data that’s being accessed today sometimes requires a very different database to complement the relational database. This has sparked the adoption in some areas of NoSQL databases—which are also referred to as “nonrelational databases.” Because of their ability to scale out horizontally and quickly, nonrelational databases can handle high traffic, which also makes them highly adaptable.

When to choose a NoSQL database?

With businesses and organizations needing to innovate rapidly, being able to stay agile and continue operating at any scale is the name of the game. NoSQL databases offer flexible schemas and also support a variety of data models that are ideal for building applications that require large data volumes and low latency or response times—for example, online gaming and ecommerce web applications.

When not to choose a NoSQL database?

NoSQL databases typically rely on de-normalized data, supporting the types of applications that use fewer tables (or containers) and whose data relationships are not modeled using references, but rather as embedded records (or documents). Many classic back-office business applications in finance, accounting, and enterprise resource planning rely on highly normalized data to prevent data anomalies as well as data duplication. These are the typically the types of applications that are not a good fit for a NoSQL Database.

Another distinction of NoSQL databases is query complexity. NoSQL databases work phenomenally well with queries against a single table. However, as the complexity of the queries increase, relational databases are a better choice. NoSQL database typically do not offer complex joins, sub-queries, and nesting of queries in a WHERE clause.

Sometimes, though, there doesn’t need to be a choice between relational and nonrelational databases. On many occasions, companies have opted for databases that offer a converged model, in which they are able to employ a combination of a relational and nonrelational data models. This hybrid approach offers increased flexibility in handling different types of data, while also ensuring read and write consistency without degrading performance.

What does NoSQL offer that other databases don’t?

One of the main differentiators between NoSQL databases and other types of databases is that NoSQL databases typically use unstructured storage. Developed within the last two decades, NoSQL databases were designed for fast, simple queries, vast data, and frequent application changes. In addition, these databases also make programming much simpler for developers.

Another important differentiator is that NoSQL databases rely on a process called “sharding” to scale out horizontally, which means that more machines can be added to handle data across multiple servers. The vertical scaling that’s found in other SQL databases requires adding more power and memory to the existing machine, which can be unsustainable as more and more storage is needed.

The nature of horizontal scaling with NoSQL databases means that they can handle extremely large amounts of data—even as the data is growing—in a more efficient way. It can be helpful to think of vertical scaling like adding a new floor to your house, whereas horizontal scaling is like building another house right next door to the original one.

Benefits of a NoSQL database

The unprecedented speed and scale of digital interaction and data consumption seen in the last two decades has required businesses to adopt a more modern, fluid approach to how they store data and how they access it. With users worldwide demanding an uninterrupted stream of content and functions, it’s no wonder that databases have had to adapt quickly. With this in mind, here are some of the key reasons why developers are choosing NoSQL/nonrelational databases:

Flexibility

Scalability

High performance

The scale-out architecture of a NoSQL database can be particularly valuable when data volume or traffic increases. As shown in the graphic below, this architecture ensures fast and predictable single-digit millisecond response times. NoSQL databases can also ingest data and deliver it quickly and reliably, which is why NoSQL databases are used in applications that collect terabytes of data every day, while also requiring a highly interactive user experience. In the graphic below, we show an incoming rate of 300 reads per second (blue line) with a 95th latency in the 3-4ms range, and an incoming rate of 150 writes per second (green line) with a 95th latency in the 4-5ms range.

nosql database

Availability

Highly Functional

Types of NoSQL databases

There are four main types of NoSQL databases: