What the heck is NoSQL and why should we care?

NoSQL

Let’s start with what NoSQL stands for. When I first came across NoSQL, I thought it meant it did not use SQL, but that is not the case. It stands for “Not Only SQL.” Pretty confusing, but let’s not get bogged down!

NoSQL represents a category of database management systems that have been designed to handle a wider variety of data models. Traditional relational databases are highly structured but struggle outside of those confines. NoSQL, on the other hand, excels in the world of large-scale, semi-structured, and unstructured data.

Key Characteristics

Here are some of the key characteristics we often see in NoSQL databases:

  1. Non-relational:NoSQL databases do not rely on the table-based structures that relational databases need, which allows them to handle far more flexible data models.
  2. Schema-less:Often, NoSQL databases do not require a fixed schema, which provides the flexibility to store different types of data without predefined structures.
  3. Scalability:Designed to scale out horizontally, NoSQL databases can distribute their data across multiple servers, which means they can manage very large volumes of data.
  4. Performance: Related to that, they are capable of handling large volumes of data and high-velocity data operations efficiently, at least in some use cases.
Some Examples

Here are some different types of NoSQL databases:

  • Document Databases: (e.g., MongoDB, CouchDB) These store data in JSON-like documents, offering great flexibility as well as being consumable by database developers.
  • Key-Value Stores: (e.g., Redis, DynamoDB) They store data as key-value pairs, providing fast read and write operations.
  • Column-family Stores:(e.g., Cassandra, HBase) More like traditional data stores, these NoSQL databases organize their data into columns and rows, which are optimized for read and write performance on large datasets.
  • Graph Databases:(e.g., Neo4j, OrientDB) These can store data in graph structures, ideal for applications with interconnected data and complex relationships.

When to Use NoSQL Databases

Choosing a NoSQL database over a traditional relational database can be advantageous in the following scenarios:

  • Handling large volumes of data
  • Flexible schema
  • High scalability
  • Distributed data store that can span multiple servers
  • Real-time analytics
  • High throughput and low latency
  • Graph or hierarchical data
  • Microservices architecture

They are ideal for microservices architectures where each service may have different data storage requirements, allowing the use of the best data model for each service.

Our Experience

We are fairly new to NoSQL, but many of the concepts are still the same. We are currently transferring one of our clients from a traditional Microsoft SQL Server database over to NoSQL to reduce the costs involved. The data requirements for this client are very large—over 10TB of data currently being stored and growing at almost 1TB per month!

NoSQL allows us to store the primary keys to the data, which can be indexed to allow fast access to the data. We are then storing the raw data in JSON format, which is highly flexible and almost infinitely expandable. So far, all apart from one of the tables has been migrated to DynamoDB, which has led to a 60% reduction in their storage costs.

For this client, the performance has also been improved over the past few years using AWS microservices. It is a separate but related project, but as more units are added, more microservices are spawned, so performance remains strong. This has been essential for this client, who is expanding their operations both within Australia and overseas.