What is the difference between SQL and NoSQL databases?

Karan Singh
3 min readJan 12, 2020

--

Source: GeeksforGeeks

Databases are something that have been in place since 1950s, and have played an integral role in the evolution of computer technology. Since the invention of computation, we have encountered one big problem, which is the storage of the data that has been produced after computation. Storage of this data should also be such that with the help of some algorithm, retrieval process is easy, and should not be time consuming if and when required. Hence, here the concept of SQL databases or relational databases was created. However, another concept of databases was also created in latter years. This was known as non-SQL database or non relational database. Both come with their own set of advantages and disadvantages. In this article, we would have a look at each of them and will also draw a comparison between them.

SQL Databases

Source: build5nines

In SQL Databases, a Structured Query Language (SQL) is used to store, retrieve and manipulate the data in a relational database. The relational database system is concept that establishes relationships among tables of the database. In this concept, one must follow a fixed set of schema for the table. Commands are written in Structured Query Language (SQL) to perform any kind of operation. These SQL syntax commands are known as queries. This system is designed in such a way that the database is vertically scalable. The development of SQL databases started in 1970s by IBM to deal with the issues encountered with flat style file storage.

Source: GeeksforGeeks

The concept of SQL database follows the ACID model where A stands for Atomicity (meaning whole transaction takes place or doesn’t happen at all) , C for Consistency (data must be same before and after transaction), I for Isolation (more than one transactions occur in isolation with each other) and D for Durability (data must be safe even if a system failure occurs). Here, transaction is a single unit of work which accesses and possibly even modifies the content of the database.

NoSQL Database

Source: educba

In NoSQL, there is a non-relational database which doesn’t has a fixed schema. It is used for distributed data stores with humongous data storage needs. These databases are designed to be scalable horizontally. Instead of using SQL commands, NoSQL uses a wide range of database technologies that can store structured, semi-structured, unstructured and polymorphic data. NoSQL stands for “Not only SQL”. It developed in late 1980s. This concept of database is used by modern web apps like Facebook, Twitter and Google to store their terabytes of user data.

NoSQL follows the BASE properties where B and A stands for Basic Availability (NoSQL focuses on availability of data even in case of multiple failures), S for Soft State (data consistency is the developer’s problem and should not be handled by the database) and E for Eventual Consistency (some point in the future, data will converge to a consistent state).

SQL databases vs NoSQL databases

Tabular comparison between SQL and NoSQL.

SQL has been the backbone of databases for many years. NoSQL has evolved due to modern requirements of handling terabytes of user data each day. Even though NoSQL is more prominent for modern requirements, SQL stills holds a vital place in databases as in some scenarios, SQL is still a better choice.

--

--

Karan Singh
Karan Singh

Written by Karan Singh

Microsoft Student Partner | Samsung Brand Ambassador | Bachelors in Computer Science Student | Aviation geek | Formula One Fan

No responses yet