Developers
August 13, 2020

NoSQL Databases: What They Are and Why They Matter

An older technology, NoSQL databases have come into their own in recent years.

The world runs on databases. Regardless of the job or industry, the vast majority of businesses rely on some kind of database at some point during the workday.

For some companies it may be as simple as using an invoicing package that relies on a database to store estimates and invoices. Other companies rely on databases to keep track of orders, customers, shipments and more. The largest companies rely on massive databases to power some of the services used by millions and billions of people around the globe.

When many individuals think of databases, the first thing that comes to mind is an SQL-based, relational database.

Relational Databases

Relational databases quickly became the standard database format in use throughout the world. A relational database has tables of data that are similar to an Excel spreadsheets, with columns and rows of data. By using unique identifiers for specific columns, it’s possible to link, or relate, tables to each other.

For example, a developer creating an invoice program might have a table called “Invoices,” with the invoice number being the unique identifier. The Invoices table would have the invoice number, date and other basic information. A second table, perhaps called “InvoiceItems,” would contain the individual line items for an invoice. The InvoiceItems table would also have an invoice number field, which would link those records to the correct invoice in the Invoices table. Similarly, there might be a “Customers” table, linking customer information in much the same way.

This approach makes it possible to keep data clearly delineated in separate tables. This can make it easier to search, update and manage saved data, since it’s clearly defined rather than being dumped in one big monolithic table.

Thanks to Structured Query Language (SQL), it’s possible to perform searches across multiple tables. For example, an SQL query could pull all data from the Invoices, InvoiceItems and Customers tables simultaneously where the records all contain a single invoice number.

Despite their many advantages, relational databases do have some significant disadvantages. Many of these disadvantages became apparent as a result of cloud computing and related services.

Because of the structured nature of relational databases, they do not scale well horizontally, being notoriously difficult to use in computer clusters. Another disadvantage is the strict data typing that many relational databases rely on, which can be significantly different from how many object-oriented languages deal with data.

The Rise of NoSQL Databases

The above challenges helped drive the popularity of NoSQL databases, although they have existed since at the least the 1960s. Rather than traditional tables, NoSQL databases can be built around a number of different principles.

One popular type of NoSQL database is the document store, wherein the main element is a document. Documents can then be grouped together in collections. There are a number of ways searches can be performed, including using an API designed to make the contents of the documents searchable.

Key-value (KV) databases are another popular NoSQL option. This method stores data in a dictionary or hash table, where a key references a field containing records or objects. KV databases tend to use less memory than relational databases, since space is only taken up by what is stored. In contrast, a relational database record may contain 20 fields, only 10 of which contain data. The empty fields or columns, however, can still take up a small amount of space. Magnify that over millions of records and it can add up quickly.

There are many other kinds of NoSQL databases in use, in addition to these two.

Benefits of NoSQL

One of the biggest advantages to NoSQL databases, is the ability to horizontally scale across computing clusters. This makes NoSQL databases the ideal option for cloud computing and distributed computing.

Another significant advantage is speed. Because NoSQL databases don’t have as much overhead as a traditional relational database, they are often faster accessing data and performing operations.

Closely related to the two previous advantages is how NoSQL databases grow and scale, in terms of performance. Relational databases largely grow vertically. In other words, as the database becomes larger and more cumbersome, the only real solution is to continue to increase the power of the computer hosting it. In contrast, because NoSQL databases can be scaled horizontally, across multiple computers, it makes it much easier and cheaper to maintain the necessary performance.

NoSQL databases are often more developer friendly. They are generally easier to work with, from the perspective of object-oriented programming and data types.

Conclusion

Without a doubt, NoSQL databases are a completely different paradigm compared to traditional, relational databases. Nonetheless, these kind of databases have a number of advantages that make them the ideal counterpart to modern object-oriented programming and cloud computing.

TagsNoSQLDatabase
Matt Milano
Technical Writer
Matt is a tech journalist and writer with a background in web and software development.

Related Articles

Back
DevelopersAugust 13, 2020
NoSQL Databases: What They Are and Why They Matter
An older technology, NoSQL databases have come into their own in recent years.

The world runs on databases. Regardless of the job or industry, the vast majority of businesses rely on some kind of database at some point during the workday.

For some companies it may be as simple as using an invoicing package that relies on a database to store estimates and invoices. Other companies rely on databases to keep track of orders, customers, shipments and more. The largest companies rely on massive databases to power some of the services used by millions and billions of people around the globe.

When many individuals think of databases, the first thing that comes to mind is an SQL-based, relational database.

Relational Databases

Relational databases quickly became the standard database format in use throughout the world. A relational database has tables of data that are similar to an Excel spreadsheets, with columns and rows of data. By using unique identifiers for specific columns, it’s possible to link, or relate, tables to each other.

For example, a developer creating an invoice program might have a table called “Invoices,” with the invoice number being the unique identifier. The Invoices table would have the invoice number, date and other basic information. A second table, perhaps called “InvoiceItems,” would contain the individual line items for an invoice. The InvoiceItems table would also have an invoice number field, which would link those records to the correct invoice in the Invoices table. Similarly, there might be a “Customers” table, linking customer information in much the same way.

This approach makes it possible to keep data clearly delineated in separate tables. This can make it easier to search, update and manage saved data, since it’s clearly defined rather than being dumped in one big monolithic table.

Thanks to Structured Query Language (SQL), it’s possible to perform searches across multiple tables. For example, an SQL query could pull all data from the Invoices, InvoiceItems and Customers tables simultaneously where the records all contain a single invoice number.

Despite their many advantages, relational databases do have some significant disadvantages. Many of these disadvantages became apparent as a result of cloud computing and related services.

Because of the structured nature of relational databases, they do not scale well horizontally, being notoriously difficult to use in computer clusters. Another disadvantage is the strict data typing that many relational databases rely on, which can be significantly different from how many object-oriented languages deal with data.

The Rise of NoSQL Databases

The above challenges helped drive the popularity of NoSQL databases, although they have existed since at the least the 1960s. Rather than traditional tables, NoSQL databases can be built around a number of different principles.

One popular type of NoSQL database is the document store, wherein the main element is a document. Documents can then be grouped together in collections. There are a number of ways searches can be performed, including using an API designed to make the contents of the documents searchable.

Key-value (KV) databases are another popular NoSQL option. This method stores data in a dictionary or hash table, where a key references a field containing records or objects. KV databases tend to use less memory than relational databases, since space is only taken up by what is stored. In contrast, a relational database record may contain 20 fields, only 10 of which contain data. The empty fields or columns, however, can still take up a small amount of space. Magnify that over millions of records and it can add up quickly.

There are many other kinds of NoSQL databases in use, in addition to these two.

Benefits of NoSQL

One of the biggest advantages to NoSQL databases, is the ability to horizontally scale across computing clusters. This makes NoSQL databases the ideal option for cloud computing and distributed computing.

Another significant advantage is speed. Because NoSQL databases don’t have as much overhead as a traditional relational database, they are often faster accessing data and performing operations.

Closely related to the two previous advantages is how NoSQL databases grow and scale, in terms of performance. Relational databases largely grow vertically. In other words, as the database becomes larger and more cumbersome, the only real solution is to continue to increase the power of the computer hosting it. In contrast, because NoSQL databases can be scaled horizontally, across multiple computers, it makes it much easier and cheaper to maintain the necessary performance.

NoSQL databases are often more developer friendly. They are generally easier to work with, from the perspective of object-oriented programming and data types.

Conclusion

Without a doubt, NoSQL databases are a completely different paradigm compared to traditional, relational databases. Nonetheless, these kind of databases have a number of advantages that make them the ideal counterpart to modern object-oriented programming and cloud computing.

NoSQL
Database
About the author
Matt Milano -Technical Writer
Matt is a tech journalist and writer with a background in web and software development.

Related Articles