A beginner-friendly explanation of how computers process information — from binary and bytes to how text, images, videos, and audio are represented and stored.

All right, so let’s talk about SQL and NoSQL in general.
From the 90s — or even before the 90s — when databases came after file systems, we started working with data in a tabular format, like rows and columns.
To query this data, we used Structured Query Language (SQL). This model continued and evolved through the 2000s.
So basically, data was stored in tables, and we queried it using SQL.
After the 2000s, people started thinking differently.
Most applications just wanted to read and write data, and that data was usually in JSON format. The frontend sends JSON, the backend receives JSON, but then we had to map that JSON into rows and columns.
That mapping was honestly hard and sometimes unnecessary.
So people thought:
Why not store JSON directly in the database itself?
At a low level, databases already store data like this:
In SQL:
So the question was:
If rows can be stored as records, why can’t JSON be stored as records as well?
Why not just store JSON in byte format directly?
That’s where the idea of NoSQL came in.
So what generally happens is this:
Now what the database engine does is:
And that’s basically how NoSQL document databases work.
This is the core difference.
Now let’s talk clearly about SQL and NoSQL.
This is the second major difference.
SQL is generally used when consistency is needed.
By consistency, I mean:
I’m talking at a general SQL vs NoSQL concept level, not about specific databases.
Some people may argue that MongoDB supports constraints after version 4.0 — that’s true — but that’s a separate discussion.
At a general level:
That’s why SQL is used in:
SQL is also preferred when:
And obviously:
That’s the main use case of SQL.
NoSQL shines when:
In SQL:
In NoSQL:
NoSQL is also useful when schema needs to be flexible.
For example:
In SQL:
In NoSQL:
For small, frequent data access:
So NoSQL is also used for:
So overall:
SQL is best when:
NoSQL is best when:
That’s majorly how SQL and NoSQL work at a general level.
I’ve also given some examples here.
And if there is any doubt, please let me know.
Here's a quick overview of the topics we covered in this post:
SQL vs NoSQL — My General Understanding
• Early Databases and SQL
• Problem with Mapping JSON to Tables
• Why NoSQL Came Into the Picture
• How NoSQL Works (At a High Level)
• SQL vs NoSQL — Storage Model
• SQL
• NoSQL
• When to Use SQL
• SQL for Relational Data
• When to Use NoSQL
• Flexible Schema Use Case
• Caching and Fast Data Access
• Final Summary