What is a NoSQL Database?

Relational Database Systems (RDBMS) are the traditional software platform for storing, indexing, querying and analyzing data.  Relational Databases expose data as tables, where data can be grouped into rows, with columns defining the datatype to be stored, such as numeric, text, or binary data.

RDBMS can use relationships between tables to define a data schema which models the real-world business case. These relationships can define reference data. For example, it is common to store a list of countries, cities, and states in separate tables, and use references, known as keys, to link these lists together to create a final definition for a location. These references can be enforced via a function called ‘referential integrity’, which ensures that a new record cannot be created unless the references to other tables are also created at the same time.

These features are designed to accommodate a set of standard properties known as ACID, or Atomicity, Consistency, Isolation, Durability.  These features allow the database to process transactions which can be rolled back in the case of a system failure, ensuring a transaction can never be in an incomplete state.  Financial transactions are typically ACID-compliant.

Querying an RDBMS is accomplished via Structured Query Language (SQL), a simplified English-like programming language that allows retrieval, update, delete and manipulation of data.  SQL queries can also be used to manage the database system itself, including backups, recovery, physical storage and performance tuning.

A NoSQL database is similar to an RDBMS because it allows for data storage and indexing, however it eliminates or reduces many of the features in an RDBMS.   NoSQL databases typically use a simplified table design, often simply key-value pairs, does not enforce referential integrity, does not offer ACID-compliance or often any transaction processing and rollback capability.   And NoSQL databases typically do away with SQL in favor of a simple API, often exposed as a REST service.  NoSQL databases use a Key / Value pair as their primary storage mechanism, eliminating the need for multiple tables, joins, and keys, and simplifying the underlying data storage.

Why use a NoSQL Database?

Many applications do not require the overhead of an RDBMS and don’t take advantage of the features they offer.  These applications often are non-transactional, read-intensive, widely distributed, and deal with unstructured data.     As an example, social media posting is a good candidate for a NoSQL database, and indeed many Social Media properties rely on NoSQL databases as their primary approach for data storage.

In the common use cases of text storage, image storage and retrieval, a NoSQL database will often outperform an RDBMS at scale, due to the simplified nature of storage underlying a NoSQL database.   In applications where fast retrieval is important, this can be a critical feature.    In a clustered environment, NoSQL databases can often get significant performance improvement over an RDBMS by relying on ‘eventual consistency’, where data may be updated to child nodes over time, rather than needing to be updated immediately during a transaction.

NoSQL databases also makes it simple for developers to add persistent storage to their application.  Since data management operations are exposed via APIs, there is no need for a developer to embed or expose SQL into their code.  NoSQL databases also map much more closely to the object-oriented programming paradigm, which relies on simple, self-contained key value data schemas comprised of fields as opposed to table structures.

Any developer looking for a highly scalable, fast and simple database should take a good look at a NoSQL database.   If the application does not require the transaction processing features of an RDBMS, a NoSQL database may be a more simpler, more scalable approach.