SQL vs NoSQL Database

SQL vs. NoSQL Database - An Overview

Prasanna Lakshmi

Prasanna Lakshmi

Software Engineer

Published Apr 22 2019

Is the SQL DB outdated? RDBMS is no longer useful for Business? NoSQL DB replaced SQL DB? These are some of the frequently asked questions.. Let us understand clear difference between both databases and why we choose one over the other for our project.

Here is the outline of the differences between SQL DB and NoSQL DB:

SQL DB NoSQL DB
Data Storage
  1. SQL DB is usually interpreted as a relationship database.

  2. Data is stored in Rows-and-Columns format in relational model. Rows contain information about one specific entry/entity whereas columns contain separate data points.
    Example: If we have a row about an employee, its columns will include EmpNo, EmpName, Salary, Dept, etc.

  3. Relationship databases usually have tables to maintain the entities and the relationships between them. It functions within strict time constraints and allows multiple data manipulations.
  1. NoSQL is usually interpreted as Not Only SQL, it is recognized as a non-relationship database.

  2. NoSQL has a different data storage model. The main data is stored as a document, graph, key-value and columnar. The most popular record type of NoSQL is key-value stores.

  3. Being less constraint and having flexible storage capacity, NoSQL offers more storage operational performance. NoSQL system is optimized to retrieve and append operations in its record storage architecture.
Schema and Flexibility Schemas or record length is fixed, This means the columns must be decided and locked before data entry and each row must contain data for each column. In order to amend the length, it is required to go offline and can also result in alteration of the whole database. Schemas are dynamic.

The Information can be added/modified on the fly, and each ‘row’ (or equivalent) doesn’t require data for each ‘column’.
Scalability Scaling is vertical; hence, more data storage may require bigger server, which can be very expensive. If you wish to scale a Rational Database Management System (RDBMS) across multiple servers, it will be a difficult and time-consuming process. Scaling is horizontal, I.e., across servers. These multiple servers can be cheap commodity hardware or cloud instances, making it a lot more cost-effective than the vertical scaling.
ACID Compliance (Atomicity, Consistency, Isolation, Durability) The vast majority of relational databases are (Atomicity, Consistency, Isolation, and Durability) ACID compliant. This Varies with technology, but many NoSQL solutions do not comply by ACID for better performance and scalability.

Sample NO SQL DB’s

NoSQL DB Samples

Different storage formats in NoSQL DB

NoSQL DB stores and process data in different way.


1. Document Databases

  • As we store data in rows and columns in SQL DB, but in NoSQL DB we store data in the form of ‘Documents’. These documents are grouped together as ‘Collections’. Each document may have a different structure, unlike in SQL where all records need to have a similar structure.
  • Example: CouchDB and MongoDB are NoSQL DBs, which uses Documents.

Storage Format in NoSQL DB

2. Key-Value Stores

  • Data is stored in an associative array of key-value pairs. The key is an attribute name, which is linked to a value.
  • Example: NoSQL DBs, which uses Key-Value storage type are Redis, Voldemort (developed by LinkedIn) and DynamoDB(developed by Amazon).

3. Graph Databases

  • Data is stored in graph structures with nodes (entities), properties (information about the entities), and lines (connections between the entities).
  • Example: Neo4J and Infinite Graph are NoSQL DBs, which uses Graph database.

4. Columnar (or Wide-Column) Databases

  • Columnar databases have column families instead of ‘tables’, which contain rows. Unlike RDBMS, you don’t need to know all the columns up front; each row doesn’t necessarily have the same number of columns. Columnar databases are best suited for analyzing huge datasets.
  • Example: Cassandra, HBase, and Hive are NoSQL DBs, which stores data in Columnar format.

NoSQL Advantages & Disadvantages

Advantages Disadvantages
Easy scalability. NoSQL database tends to be an open-source with less support on a global scale.
Can handle large volume of data easily. Simple queries require some programming knowledge.
Supports unstructured data. NoSQL databases still demand a lot of technical skills with both installation and maintenance.
Simplified data model. As NoSQL DB is new, very less expertise is available.
SQL databases can be easily installed in low-cost commodity hardware.

SQL vs. NoSQL- Which one to Use?

We have been using relational databases since decades, but NoSQL DBs are radically different and less mature. Relational databases can scale and handle Big Data. The difference lies in the fact that RDBMS require more effort to scale.

The question arises, why do we need one of these new NoSQL databases? Is it for scaling? Clearly not. RDBMS have been a part of a large-scale system for many years. The issue is the amount of work to make them scale. While these giants have been successful at scaling, their success did not come easy, they had to make many tweaks and changes and even implement a few software and hardware tricks to achieve their goals.

  • It’s best to choose SQL DB when you have a consistent and structured data with moderate or manageable growth.
  • You can choose NoSQL DB when your unstructured data is growing rapidly than the structured data and needs to be scaled-out quickly and efficiently.
  • Use NoSQL DB to analyze large volumes of datasets. Similarly, you can use SQL DB for a smaller volume of data.
  • If you have budget contraints, you can use NoSQL DB for low commodity hardware and lower performance devices.