A Guide to NoSQL Databases
In this guide, we’re going to look at NoSQL databases. This guide will hopefully break this complex topic down so that anyone can understand what it is and how it works, even if you know absolutely nothing about NoSQL.
First off, what is NoSQL?
NoSQL stands for “NOT ONLY SQL” and it is a non-relational database (no tables). One misconception is that people think it means no SQL, but in fact, it stands for no only SQL because it is quite possible to use SQL on some of these databases. NoSQL does not use tables or columns or the traditional aspects of a relational database.
Something to note about NoSQL is that they are known for working well with big data, as well as real-time web apps.
It’s also important to understand that there are multiple types of NoSQL databases like document databases and column databases. We will talk about this in more detail later.
Now, let’s talk about big data. What is big data? This is a term that’s thrown around pretty often, but it describes data sets that are so large that traditional methods of storage and processing are inadequate. There has been a massive increase in data volume within the last decade or so, and this is mostly due to huge social networks such as Facebook, Twitter, Google, etc. Thus, challenges in storage, capture, analysis, and transfer have arisen.
So this is where NoSQL comes in.
To move on, we have to understand the differences between NoSQL and relational databases. The advantages and disadvantages of each.
Let’s start with the advantages of NoSQL over RDBMS:
- We just discussed this, but a huge benefit of NoSQL is that it handles alot of data and it does it very quickly
- Another huge advantage is that is has no predefined schema. Its data model is extremely flexible. For example, if we look at relational databases like MySQL or Postgres we have to go in and structure the data
- Data structure — NoSQL handles unstructured data
- NoSQL databases are cheaper to manage compared to relational databases
- Scaling — Scale out/horizontal scaling
So let’s understanding scaling. Scaling is extremely important in this industry because it’s always growing. Scaling is key when you’re working with lots of data. Here is a helpful image:
Most NoSQL systems scale out. This means that it uses much cheaper commodity hardware. For NoSQL, you can simply add additional nodes, expanding disk size/memory, and so on. A group of nodes is called a cluster. Once you reach the limitations of the cluster of your nodes, you can simply add another one and for a fraction of the cost of scaling up. So scaling is definitely an advantage of NoSQL.
Now, let’s talk about relational databases and what they have over NoSQL:
- Better for relational data
- Relational databases uses something called normalization which organizes data in a way that eliminates redundancy so all the data is stored in one place
- Relational databases also use SQL or structures query language which is an old technology but very solid
- Enforces data integrity
- ACID compliance
Now that we’ve looked at the advantages and disadvantages of both relational and NoSQL, let’s take a look at different types of NoSQL databases:
- Document Databases [MongoDB, CouchDB]
- Column Databases [Apache Cassandra]
- Key-Valye Stores [Redis, Couchbase Server]
- Cache Systems [Redis, Memcache]
- Graph Databases [Neo4J]
So that’s going to be it. Hopefully you were able to soak up some of this information on NoSQL.