Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways

NoSQL vs Relational Database

NoSQL vs Relational Database
If you are already working in the analytics domain then you might have heard words like PostgreSQL, MongoDB, MySQL, Oracle, etc. We also do have a fair bit of idea about the fact that we store our tables and databases in these places. But why can’t we have everything under one hood?
We should have heard people saying that ABC is a NoSQL database and we should store these data in it rather than a traditional Relational database, what does that mean?

Does NoSQL mean that you don’t have to write SQL on top of it? If yes, then what is the use?
Let’s try to understand NoSQL vs Relational Database

NoSQL stands for Not Only SQL
Not Only SQL – Every item in the database stands on its own

NoSQL vs Relational Database
NoSQL vs Relational Database

Relational databases are like predefined table structures where you can surely add as many rows as possible but adding a new column is a pain as you have to change the schema of the table, thus it is a vertically scaling database. Whereas NoSQL is built in such a way that you can add any number of rows but at the same time you can add any additional information pertaining to a row.

Example – Suppose you have an employee table and you have a NoSQL database, in this table, there will be only 2 columns i.e. a primary key and a values column where you can add as many details as possible, for one employee you can add only name and phone number whereas for another employee you can add the complete profile ranging from name to spouse’s work status, how?

In general, the value thing is stored in a JSON format which again is a key-value pair and you can add any number of attributes corresponding to an employe



Relational Database – Vertical scaling Ex. PostgreSQL, SQLite, MySql
NoSQL – Vertical and Horizontal scaling – Each item in the database only has two things – unique key and values

Different formates in which you can store data in your NoSQL database

1. Document Database – JSON
2. Key-Value store
3. Graphical database


How does this scaling makes database life easier?
As discussed, Scaling in NoSQL can work in a horizontal way

Let’s take an example – A company XYZ runs a NoSQL database which has 10000 servers, All these servers work as a partition i.e. your data which you want to fetch is not present in only one server, it can be present in any partition.

Won’t it be too cumbersome for the database to check all the partition to find a detail ?How do find where is the data stored?

NoSQL databases are key-value stores

It’s not just a key-value pair – It is a key-hash-value where each key is associated with a hash value and this hash value works as a partition identifier πŸ˜›

Suppose the hash value is in the range of 0 to 1000 and all your data is stored in one DB. Now, if you want to double your DB performance, you can add another server, and now
Server 1 – Hash value 0 to 500
Server 2 – Hash value 501 to 1000

This range of 0 to 1000 is called a keyspace. Keyspace tells you where to store new items and where to find the existing ones. 

NoSQL is schemaless – anyways you are storing everything in a JSON format and you can increase or decrease the amount of information in each field. In a relational database, you have to define the schema of the table and have to adhere to it

Example of NoSQL –
AWS – DynamoDB
Google Cloud – Big Table
Azure – CosmoDB

You can also run NoSQL DB yourself by using software like Cassandra, CouchDB, MongoDB.

We will try to create a video on the same to give a glimpse of what is JSON and NoSQL

The Data Monk Interview Books β€“ Don’t Miss

Now we are also available on our website where you can directly download the PDF of the topic you are interested in. At Amazon, each book costs ~299, on our website we have put it at a 60-80% discount. There are ~4000 solved interview questions prepared for you.

10 e-book bundle with 1400 interview questions spread across SQL, Python, Statistics, Case Studies, and Machine Learning Algorithms β€“ Ideal for 0-3 years experienced candidates

23 E-book with ~2000 interview questions spread across AWS, SQL, Python, 10+ ML algorithms, MS Excel, and Case Studies β€“ Complete Package for someone between 0 to 8 years of experience (The above 10 e-book bundle has a completely different set of e-books)

12 E-books for 12 Machine Learning algorithms with 1000+ interview questions β€“ For those candidates who want to include any Machine Learning Algorithm in their resume and to learn/revise the important concepts. These 12 e-books are a part of the 23 e-book package

Individual 50+ e-books on separate topics

Important Resources to crack interviews (Mostly Free)

There are a few things which might be very useful for your preparation

The Data Monk Youtube channel – Here you will get only those videos that are asked in interviews for Data Analysts, Data Scientists, Machine Learning Engineers, Business Intelligence Engineers, Analytics Manager, etc.
Go through the watchlist which makes you uncomfortable:-

All the list of 200 videos
Complete Python Playlist for Data Science
Company-wise Data Science Interview Questions β€“ Must Watch
All important Machine Learning Algorithm with code in Python
Complete Python Numpy Playlist
Complete Python Pandas Playlist
SQL Complete Playlist
Case Study and Guesstimates Complete Playlist
Complete Playlist of Statistics

About TheDataMonkGrand Master

I am the Co-Founder of The Data Monk. I have a total of 6+ years of analytics experience 3+ years at Mu Sigma 2 years at OYO 1 year and counting at The Data Monk I am an active trader and a logically sarcastic idiot :)

Follow Me

Leave a reply