SQL VS No SQL

Today’s discussion is all about SQL vs No SQL .In industry which type of database will be used by the company that is most important. To figure out We need to understand what type of data we have, specifically if we want to store some data which can be stored in Tabluar format for that case we can use SQL database.SQL databases are also called Relational Database. Relation means Table.In other hand No SQL databases are stored in different format like key-value pair.

SQL Database stores structured data and No SQL database stored unstructerd data .But what does it mean by structured and unstructured ? structered means fixed schema , If we have fixed amount of attributes for that case we use SQL database. unstructred means flexible schema , that means we can dynamically change our model attributes as per our requirement.For example If you have an E-commerce website and you want to store the clothes information like product_id,rating,price,description,product_name etc. this attributes will remain same for all kind of clothes, so we can store this data in tabluar format because we have fixed attributes .But If you want to store different kind of data like electronics material and clothes then we can’t store both the products in same table because of different attributes.In case of electronics material the attributes will be product_id,ram,rom,description,price ,rating etc. some attributes are extra here.so how will you store clothes and electronics data in a same database.The answer is No SQL Database.Now question is HOW ? let me explain. No SQL Database has different kind of stucture to store the data.One of them is key-value pair like JSON format.

{ "product_id":2, "product_name":"men tshirt", "price":300, "rating":5.6},

{ "product_id"=3, "product_name":"ASUS Laptop", "Ram":"8 gb", "Rom": "1 Tb", "price":40000}

In this way we can store different items with different attributes is stored in same database.

use cases:

Big companies like Meta,Netflix,Uber uses both SQL and NoSQL databases.let me explain how netflix uses both databases.

If you as a netflix user often visits netflix then how the data regarding you will be sotred and in which format ? just like user_id,user_name,email,subscription_start_date etc. this attributes will be stored in SQL database as a user information. In other hand Movie details are stored in NoSQL database. because of the flexible schema we can use NoSQL database in different area in our application.As per the requirement we use both SQL and NoSQL database in a specific application.

uber also uses both SQL and NoSQL database to store the data in same way.