Swapna Kumar Panda ๎จ€ Profile picture
Feb 16 โ€ข 23 tweets โ€ข 4 min read
SQL and NoSQL : Details & Key Differences

BONUS ๐Ÿ’ก: Which one is for you?

โ‡ฉ
โžŠ What is a Database?
โž‹ What is a Relational Database?
โžŒ What is SQL?
โž What is NoSQL?
โžŽ Categories
โž SQL vs NoSQL
โž BONUS: Which one is for you?
โžŠ What is a Database?

โฌ˜ A database is an organised collection of data stored in a computer system (typically a server machine, but can be any machine) so that it can be accessed and managed easily.
โฌ— In early days, each database had a separate way of data management. The way one database was storing and managing data may vary from another.

โฌ™ But with time this practice got normalised. The "Relational Database" design came into picture.
โž‹ What is a Relational Database?

โฌ˜ A relational database is a "collection of data items" that have some "pre-defined relationships" between them.

โฌ— Typically these items are organised as a set of "Tables" with "Columns" and "Rows".
โฌ™ Relationship between 2 tables are established based on one or multiple similar columns.

โฌ– Relational databases grew in popularity. As so many of them exist, the need to develop one common language for managing both data and structures became stronger.
โžŒ What is SQL?

โฌ˜ SQL stands for Structured Query Language.

โฌ— SQL is a computer language for storing, manipulating and retrieving data stored in a relational database.
โฌ™ SQL has many parts

โฎ‘ DDL
Data Definition Language
โฎ‘ DML
Data Manipulation Language
โฎ‘ DQL
Data Query Language
โฎ‘ DCL
Data Control Language
โฎ‘ TCL
Transaction Control Language

Refer ๐Ÿ‘‡
โฌ– Remember, a database is "Relational" and the language used in it is called "SQL". But it is normal to use "Relational Database" and, "SQL Database" terms interchangeably.

โฌ˜ In a SQL Database, data are kept fully structured. Often data are very tightly coupled.
โž What is NoSQL?

โฌ˜ SQL Databases were good and served many purposes. But with time data volume increased like anything.

โฌ– For these large volume of data, SQL was getting inefficient on many occasions. To improve the efficiency, new database designs evolved.
โฌ™ All these databases didn't keep it mandatory for data to be structured. Hence SQL was not going to work. So, a new term was coined "NoSQL".

โœฉ NoSQL doesn't mean "Not SQL" rather "Not Only SQL".
โฌ— NoSQL databases are mostly of distributed architecture. Hence they follow CAP Theorem.

โœฉ CAP Theorem states that no distributed system can support more than any two of Consistency, Availability and Partition tolerance.
โžŽ Categories

Broadly databases can be categorised into

๐Ÿ›ข
โฎ‘ Relational
โฎ‘ NoSQL
โฎ‘ Document
โฎ‘ Wide-Column
โฎ‘ Key-Value
โฎ‘ Graph
โฎ‘ Time Series
โฎ‘ Search

And, few others.

Refer ๐Ÿ‘‡
โž SQL vs NoSQL

Now, as we have fundamentals cleared about both SQL and NoSQL databases, let's find out major differences.

Let's classify and then we will elaborate each one.

โ Architecture
โ Schema
โ Scalability
โ Data Structure
โ Properties
โž.โž€ Architecture

โ‘ SQL Databases are "Relational" while NoSQL databases are "Non-Relational".

โ’ SQL Databases are not mandatorily distributed while NoSQL databases are architected for distributed systems.
โž.โž Schema

โ‘ Schemas in SQL Database is mandatory and, predefined.

โ’ Schemas in NoSQL Database is dynamic. It is not mandatory to define a Schema before creation of data.
โž.โž‚ Scalability

โ‘ SQL Databases are mostly "vertically scalable" means you need to increase the machine's CPU, RAM, Storage for scaling.

โ’ NoSQL Databases are "horizontally scalable" means you just need to add new machines to scale up. NoSQL databases are distributed.
โž.โžƒ Data Structure

โ‘ SQL Databases are Table based.

โ’ NoSQL databases are variant. There exists Document based, Key-Value based, Wide-Column Store based, Graph based and so many other types.
โž.โž„ Properties

โ‘ SQL Databases are ACID compliant. It means consistency of data is of high priority.

โ’ Where as NoSQL Databases support any 2 of CAP (Consistency, Availability and Partition Tolerance).
โž BONUS: Which one is for you?

โฌ” SQL databases are better for multi-row transactions, while NoSQL is better for unstructured data like documents or JSON.

โฌ• If data can grow quickly and you want to scale up immediately on-demand, then NoSQL should be the preferred one.
โš ๏ธ Repost Notice โš ๏ธ

โฌ– Though this is my original work, part of it was previously posted in [CHIRPBIRDICON]

โฌ™ If you liked this content and do feel others might learn from it, please support.
๐Ÿ’ญ Feedbacks

I have honestly tried to cover the most. But there must be some scope of improvements. If you see any such, feel free to share.

Your feedbacks always help me in writing better.
End of ๐Ÿงต

Is it useful? Share your thoughts.

I am sharing regular tutorial threads on DSA, HTML, CSS, JavaScript and React. To never miss any, Follow me โœ…

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Swapna Kumar Panda ๎จ€

Swapna Kumar Panda ๎จ€ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

Feb 15
Memorise Data Structures in 6 simple steps

โ‡ฉ
โžŠ Linearity
โž‹ Memory Allocation
โžŒ Connectivity
โž Ordering
โžŽ Uniqueness
โž Operations
โžŠ Linearity

โฎ‘ Linear
โฎ‘ Non-linear

โœฉ It says about the traversal path.
Read 9 tweets
Feb 14
๐Ÿ’™ 15000 Friends in [CHIRPBIRDICON]

Do you love what I am sharing daily?

My posts are mostly on,

๐ŸŒ HTML
๐ŸŽจ CSS
๐Ÿ‘ฉโ€๐Ÿ’ป JavaScript
โš›๏ธ React
๐Ÿ›  DSA
๐Ÿ›ข SQL/NoSQL

If you don't want to miss, Follow me โœ…

๐Ÿ“ฃ My first article is published today in Hashnode.
Link ๐Ÿ‘‡
โœ๏ธ 25 Utility Code for your next JavaScript project

โฌ” On this Valentine's day, I am happy to announce that my first article is now published in @hashnode

โฌ• Give it a read and share your feedbacks. I need love and, support of all yours.

swapnakpanda.hashnode.dev/25-utility-codโ€ฆ
๐Ÿš Recent Tweets

I am sharing

๐Ÿ“‹ Interview Questions
๐Ÿ™ Cheat Sheets
๐Ÿงต Tutorial Threads

If you have missed any of my recent posts, here are those.

twitter.com/i/events/14888โ€ฆ
Read 4 tweets
Feb 13
๐ŸŽจ 140 Color Names in HTML - Cheat Sheet

To direct access it in HQ, find the link in next tweet.
.
๐Ÿ™ High Quality Infographics

โฌ˜ I have created a repository in GitHub. This will contain most of the infographics I create in HD Quality.

โฌ– To never miss any, add this repo to your "Watch" list.

โฌ™ To encourage me, give a โญ๏ธ to this repo.

Direct Link:
github.com/swapnakpanda/Iโ€ฆ
โš ๏ธ Repost Notice โš ๏ธ

โฌ˜ I shared this cheat sheet 5 days back where I promised to share the HQ link in DMs.

โฌ– I couldn't keep my promise because Twitter barred me from making too many DMs.

โฌ™ So, here I am sharing the link directly. Hope it will benefit all.
Read 5 tweets
Feb 12
JavaScript Interview Questions

โ‡ฉ
Series: 2๏ธโƒฃ
Level: Beginner
Topics:

โžŠ Basics about Arrays
โž‹ Array Properties
โžŒ Array Methods
โž Looping through Arrays
โžŽ Array related Operators
โž Common Array Operations
โž Comparison of Terms
๐Ÿšฅ Disclaimer

โฌ– The questions covered here are mostly conceptual
โฌ˜ I never claim only these type of questions are/should be asked during interviews
โฌ— For interviews, you should have fundamentals strong. And you should be able to provide solutions to practical problems.
Read 20 tweets
Feb 11
JavaScript essentials for your React journey

โ‡ฉ
โžŠ Basics

โ‡ฅ Variable Declaration
โ‡ฅ Variable Scope
โ‡ฅ Variable Hoisting
โ‡ฅ Functions
โ‡ฅ Arrow Functions
โ‡ฅ Callback Functions
โ‡ฅ Closure
โ‡ฅ Basic Operators
โ‡ฅ Array Literals
โ‡ฅ Object Literals
โ‡ฅ if, if...else
โ‡ฅ for, for...in, for...of, while, do...while
โž‹ Array.prototype Methods

โ‡ฅ forEach()
โ‡ฅ map()
โ‡ฅ reduce()
โ‡ฅ flat()
โ‡ฅ flatMap()
โ‡ฅ find()
โ‡ฅ filter()
โ‡ฅ slice()
โ‡ฅ splice()
โ‡ฅ push()
โ‡ฅ pop()
โ‡ฅ shift()
โ‡ฅ unshift()
โ‡ฅ some()
โ‡ฅ every()
Read 13 tweets
Feb 10
25 Utility Code for your next JavaScript Project

โ‡ฉ
โžŠ Check if input is of number type
โž‹ Check if input value contains a number
โžŒ Check if input value is null or, undefined
โž Check if input value is null or, empty string
โžŽ Check if input value is falsy
โž Check if input is an Array
โž Check if input is an Empty object
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

:(