Say Hello to NoSQL Databases

Rahul Bhatia
4 min readDec 25, 2017

Hey there folks! I hope you are doing just fine and first of all Merry Christmas to all of you out there. In this blog post, we will be looking at a very brief introduction to NoSQL Databases. Many of you might have been using SQL Databases before(MySQL being one popular choice in the community) and might have heard of NoSQL Databases(MongoDB being another popular choice amongst most users). So without further due, let’s get started.

What is NoSQL?

  • A non-relational database, i.e., one which does not use tables for storing data.
  • NoSQL databases are used mainly to work with Big Data and real-time web apps.
  • There are multiple types of NoSQL databases(Document-based such as MongoDB, Key-Value Stores, Column based store etc.)

What is Big Data?

  • Data sets that are so large that traditional methods of storage and data processing are just not as useful.
  • There has been a tremendous increase in the data volumes in the last decade or so.
  • Most common examples are Social Networks(such as Facebook, Twitter etc.) and Search Engines such as Google.
  • Some of the challenges with this data are capturing it, analyzing it, transferring it and a lot more to do with it!

Advantages of NoSQL over RDBMS

  • Handles Big Data
  • It has no predefined Schema: If you have ever used a Relational Database before, we need to define the Schema of a Relation(table in simple language) ahead of time but with NoSQL, you can have any number of attribute(s) on any particular data item.
  • Data Structure: NoSQL handles unstructured data.
  • Cheaper to manage in most cases: There’s not much to manage, so you need less number of System admins.
  • The most important Point : Scaling — NoSQL databases use Scale Out/Horizontal scaling.

Relational databases use Scale In/Vertical Scaling.

This might have confused most of you and trust me this is the crux of this thing. Now let me explain what are these two things anyways.

  • As your data grows you need more hardware, more storage, more number of CPUs etc. Now all of this is of course, going to be expensive. Now obviously, you can put a limited number of these resources on top of each other to stack them. Therefore, it is expensive.
  • Now, when you use Scale out/ horizontal scaling, you can simply add additional nodes to expand your disk size, memory, and other hardware. Group of such nodes are called Clusters. Once you reach your cluster size, you can simply add more nodes to increase and meet your hardware requirements at a relatively cheaper cost.

Advantages of SQL over NoSQL

  • It is better for relational data. It is as simple as that. Going schemaless is useful in many cases but not always. Having a predefined schema helps in many cases.
  • We can use Normalization here, which is used to eliminate redundancy and is very necessary to properly organize data.
  • ACID Compliance : for those of you who are aware of transactions in RDBMS, you need to ensure that your operations are Atomic, Consistant, Isolated and Durable)

Types of NoSQL Databases :

  • Document Databases : Store data similar to Javascript objects or similar to JSON. They are completely Schemaless as discussed above. Example being MongoDB and CouchDB.
  • Column Databases : Useful for analytics. Data is written in the form of Columns instead of rows. It reduces overall Disk I/O requirements. Example being Apache Cassandra.
  • Key-Value Stores : Simplest type of NoSQL Database. Optimal for huge datasets with simple data. Its quite fast and can be considered similar to associative array. Example being Redis.
  • Graph Database : Everything is considered as a Node and nodes are connected through Edges. Example being Neo4j. Used for huge datasets such as a Social Network where everythingis related.

Before summing up, here is a picture to differentiate very briefly between Relational and Non-Relational databases :

Thanks for reading. I hope the above post was useful and added a bit more to your existing knowledge. Stay connected for more content. Onec again, merry Christmas and have a great year ahead. Keep Coding, keep developing! Cheers!

--

--