SQL vs No-SQL Database

Kapil Vij
3 min readFeb 23, 2024

--

One size doesn’t fit all :)

SQL (Structured Query Language), is a programming language with a traditional approach that allows relational databases that model predefined schemas to manage structured data like rows and tables. On the other hand, NoSQL (Not Only SQL), offers a more flexible, non-relational approach, ideal for handling unstructured or dynamic data. As businesses grow and data becomes increasingly diverse, understanding the primary differences between SQL and NoSQL is important.

The table below summarizes the main differences between SQL and NoSQL databases.

What is ACID in terms of SQL Database ?

A stands for Atomicity — All or nothing transactions.

C stands for Consistency — Data is valid before and after.

I stands for Isolation — Multiple transactions at the same time.

D stands for Durability — Committed data is never lost.

Which is better SQL or NoSQL?

The decision of whether to use SQL or NoSQL database— will depend on the particular needs and requirements of the project. For example, if you need a fast, scalable, and reliable database for applications then a NoSQL system may be preferable.

On the other hand, if your application requires complex data queries and transactional support then an SQL system may be the better choice.

There is nothing hard bound that one or the other is better. It all comes down to what you need from DB storage and which type of system can provide that in the most efficient manner. It’s always advised to analyse both options thoroughly before making a decision for your project.

What are SQL database Weaknessess ?

  1. Columns and tables are required to be created ahead of time. Ss it takes more time to setup as compared to NoSQL
  2. Not effective in storing and querying data where data is unstructured, where format is unknown.
  3. They are difficult to scale horizontally bcoz of relational nature. In case of read heavy systems you can still use, But in case of write heavy systems youneed vertical scaling.

What is Database sharding?

Sharding is a method for distributing a single dataset across multiple databases, which can then be stored on multiple machines. This allows for larger datasets to be split into smaller chunks and stored in multiple data nodes, increasing the total storage capacity of the system.

What is Eventual Consistency ? (Weakness of Distributed database)

Eventual Consistency is a guarantee that when an update is made in a distributed database, that update will eventually be reflected in all nodes that store the data, resulting in the same response every time the data is queried.

--

--

No responses yet