Which type of Database is for you?
❍ SQL
❍ NoSQL
Learn details & key differences inside.
⇩
❍ SQL
❍ NoSQL
Learn details & key differences inside.
⇩
➊ What is a Database?
➋ What is a Relational Database?
➌ What is SQL?
➍ What is NoSQL?
➎ Categories
➏ SQL vs NoSQL
➐ Which one should we use?
➋ What is a Relational Database?
➌ What is SQL?
➍ What is NoSQL?
➎ Categories
➏ SQL vs NoSQL
➐ Which one should we use?
➊ What is a Database?
A database is
❝an organised collection of data❞
➟ stored in a computer system so that
➟ it can be easily accessed and managed
A database is
❝an organised collection of data❞
➟ stored in a computer system so that
➟ it can be easily accessed and managed
⬘ 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.
⬙ With time the "Relational Database Management" got more popularity.
⬗ The way one database was storing and managing data may vary from another.
⬙ With time the "Relational Database Management" got more popularity.
➋ What is a Relational Database?
A relational database is a
❝collection of data items❞
that have some
❝pre-defined relationships❞
between them
A relational database is a
❝collection of data items❞
that have some
❝pre-defined relationships❞
between them
⬘ 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.
⬙ Relationship between 2 tables are established based on one or multiple similar columns.
➌ What is SQL?
⬘ SQL stands for Structured Query Language.
⬗ SQL is a computer language for storing, manipulating and retrieving data in a relational database.
⬙ SQL provides useful commands for performing these operations.
⬘ SQL stands for Structured Query Language.
⬗ SQL is a computer language for storing, manipulating and retrieving data in a relational database.
⬙ SQL provides useful commands for performing these operations.
➌.➀ Why is SQL required?
⬘ Because of popularity, so many vendors came up with their own implementation of a relational database.
⬙ The need to develop one common language for managing both data and structures became stronger.
⬘ Because of popularity, so many vendors came up with their own implementation of a relational database.
⬙ The need to develop one common language for managing both data and structures became stronger.
➌.➁ Parts of SQL
SQL commands can be categorised into
⮑ DDL
Data Definition Language
⮑ DML
Data Manipulation Language
⮑ DQL
Data Query Language
⮑ DCL
Data Control Language
⮑ TCL
Transaction Control Language
SQL commands can be categorised into
⮑ DDL
Data Definition Language
⮑ DML
Data Manipulation Language
⮑ DQL
Data Query Language
⮑ DCL
Data Control Language
⮑ TCL
Transaction Control Language
➌.➂ Are "SQL" & "Relational" synonyms?
⬘ A database is "Relational" and the language used in it is called "SQL".
⬘ But it is becoming normal to use "Relational Database" and, "SQL Database" terms interchangeably.
⬘ A database is "Relational" and the language used in it is called "SQL".
⬘ But it is becoming normal to use "Relational Database" and, "SQL Database" terms interchangeably.
➍ What is NoSQL?
⬘ NoSQL stands for "Not Only SQL"
⬗ NoSQL databases are non-tabular (non-relational) based and, store data differently comparing to Relational databases.
⬙ Unlike SQL (which is always for relational database), NoSQL databases come in variety of types.
⬘ NoSQL stands for "Not Only SQL"
⬗ NoSQL databases are non-tabular (non-relational) based and, store data differently comparing to Relational databases.
⬙ Unlike SQL (which is always for relational database), NoSQL databases come in variety of types.
➍.➀ Why NoSQL?
⬘ With increase in volume of data, relational databases were proved inefficient on many occasions.
⬖ To improve the efficiency, new database designs evolved and, termed as "NoSQL".
⬙ Also for few cases, Relational Design was found out over complicated.
⬘ With increase in volume of data, relational databases were proved inefficient on many occasions.
⬖ To improve the efficiency, new database designs evolved and, termed as "NoSQL".
⬙ Also for few cases, Relational Design was found out over complicated.
➎ Categories
Broadly databases can be categorised into
🛢
⮑ Relational
⮑ NoSQL
⮑ Document
⮑ Wide-Column
⮑ Key-Value
⮑ Graph
⮑ Time Series
⮑ Search
And, few others.
Broadly databases can be categorised into
🛢
⮑ Relational
⮑ NoSQL
⮑ Document
⮑ Wide-Column
⮑ Key-Value
⮑ Graph
⮑ Time Series
⮑ Search
And, few others.
➏ 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 elaborate each one.
❍ Architecture
❍ Schema
❍ Scalability
❍ Data Structure
❍ Properties
Now, as we have fundamentals cleared about both SQL and NoSQL databases, let's find out major differences.
Let's classify and then 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.
⬘ 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.
⬘ 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.
⬘ 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 have many variants. There exists Document based, Key-Value based, Wide-Column Store based, Graph based and many other types.
⬘ SQL Databases are Table based.
⬙ NoSQL databases have many variants. There exists Document based, Key-Value based, Wide-Column Store based, Graph based and 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).
⬘ 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).
➐ Which one should we use?
⬘ It's not too simple to decide which type of database you should use.
⬙ Mostly we may try to finalise based on
❍ Structured Data
❍ Scalability
❍ Consistency
⬘ It's not too simple to decide which type of database you should use.
⬙ Mostly we may try to finalise based on
❍ Structured Data
❍ Scalability
❍ Consistency
➐.➀ Structured Data
⬘ Is your data mostly structured? Is it important for you to handle "multi-row transactions"? SQL Databases would be the preferred one.
⬙ Most of the NoSQL databases are better for unstructured and, semi-structured data.
⬘ Is your data mostly structured? Is it important for you to handle "multi-row transactions"? SQL Databases would be the preferred one.
⬙ Most of the NoSQL databases are better for unstructured and, semi-structured data.
➐.➁ Scalability
If data can grow quickly and you want to scale up immediately on-demand, then NoSQL should be the preferred one.
If data can grow quickly and you want to scale up immediately on-demand, then NoSQL should be the preferred one.
➐.➂ Consistency
⬘ How important is it for you that your data should always remain consistent?
⬙ Either go for a SQL database or, a NoSQL database which obeys consistency from CAP.
⬘ How important is it for you that your data should always remain consistent?
⬙ Either go for a SQL database or, a NoSQL database which obeys consistency from CAP.
⚠️ Repost Notice ⚠️
⬘ This is my original work and, part of it was previously posted in Twitter.
⬙ If you liked this content and do feel others might learn from it, please support.
⬘ This is my original work and, part of it was previously posted in Twitter.
⬙ If you liked this content and do feel others might learn from it, please support.
Hey 👋
I am a Tech Educator from India 🇮🇳
I am sharing Tutorials, Tips, Infographics, Cheat Sheets, Practice Questions and Roadmaps on Web Development, DSA and, Database.
To never miss anything, Follow Me ✅
I am a Tech Educator from India 🇮🇳
I am sharing Tutorials, Tips, Infographics, Cheat Sheets, Practice Questions and Roadmaps on Web Development, DSA and, Database.
To never miss anything, Follow Me ✅
Loading suggestions...