Last updated on May 4th, 2022 at 06:03 am

Over the last decade there has been an explosion of users we probably had 1000 users per day hitting high-traffic websites and today we have millions of users. Millions of users mean that applications need to handle the load of multiple users accessing the same data performing CRUD operations. This means modern web applications are collecting, processing, and accessing multiple times more data than before.

Also with apps going viral and sudden uptakes (black Friday) in users accessing your app, you have more reason that you need to be able to scale at a moment’s notice. You could have a couple of million users in less than a month! Thus apps need to be designed to scale. But that is probably a topic for a later post.

We have dealt with the scaling problem by scaling vertically. Scaling up or vertical scaling is when we increase the memory, disk space, or the I/o of our machines. The primary idea here is to give more capacity to the existing hardware and decrease the overall load on the existing cluster. This was primarily accomplished by using relational databases. RDBMS has a lot of advantages and has been widely used?

Horizontal Scaling on the other hand is about increasing the number of nodes you have on a cluster and reducing the responsibility of each server by adding additional endpoints for clients.

NoSql-Graph

NoSql-Graph

Why NoSQL & Who is using NoSQL

NoSql provides a linear approach to database scaling which comes very much in handy when you need your application to handy millions of users. Scaling here is about adding more servers to your cluster and this can be done fairly easily particularly if you’re hosting your services on the cloud. If you have your own servers adding a few VM to the farm is also relatively convenient. Adding and removing servers to a NoSQL DB can be done at a moment’s notice with little or no effect on the existing production applications.

Here we have all the nodes of the cluster replicating data almost in real-time this was when a query comes to a NoSQL DB it will send to the appropriate node having the data. This is done with a simple hash mapped table pointing to the node on where the data resides.

List of NoSql DBs

Key-value

Document Store

Column-Family

Graph Database

Redis

CouchDB

Amazon SimpleDB

NeoNJ

Riak

MongoDB

Cassandra

HyperGraphDB

Memcached

Terrastore

Hbase

Infinite Graph

LevelDB

RavenDB

Hypertable

OrientDB

BerkeleyDB

OrientDB

 

FlockDB

Definition of the various types of NoSQL database

Key-value Store – Is a simple hash table where you can access the database with a primary key.

Document Stores – Store and retrieve documents like XML, JSON etc

Column Family – Stores data with Keys mapped to values grouped into multiple column families and each column family being a map of data.?/  Column family databases store data in column families as rows that have many columns associated with a row key. A column family is defined as a group of related data which would be accessed together.

 Graph Databases – Store entities and their relationships with other entities. A good example would be storing your Facebook friends list and each friends friend’s.

How do you define NoSQL?

Obviously, a NoSQL DB does not use SQL but there are various other characteristics that you could attribute to a NoSQL DB like it more often than not is open-sourced and are strongly oriented towards running on clusters. They normally operate without schema and allow you to freely add fields to database records without having to change the structure first. It might help to define it as Not a SQL Database.

In the last three places I have worked we have used a variety of Database solutions to support different use cases. This is how most organizations evolve. The use of different data stores is referred to as polyglot Persistence. It is more common these days for organizations to evolve and use various technologies that meet their needs. NoSQL has been gaining a lot of momentum lately.

Does your organization use NoSQL? Which DB do you use and what do you use it for?