Comparison of the Two
Now that we know the fundamentals of both SQL
and NoSQL
, we can dive into the technical details and compare them across certain factors. Analyzing across these parameters will help us understand their differences.
Theoretical difference
In short, SQL
databases are primarily Relational Database Management System
s, while NoSQL
databases are non-relational distributed databases and datastores.
Schema:
A schema
refers to the organization and shape of records within a database. Both of these database types have a very contrasting data storage models.
SQL databases usually deal with structured data that is organized in the form of tables. On the other hand, NoSQL databases, along with support for structured data, offer the convenience of storing unstructured, semi-structured, and polymorphic data as well.

NoSQL databases can store information in the form of document stores, key-value pairs, graphs databases, and column stores. These DBs do not have predefined schemas that they need to adhere to.
This distinction makes them useful for specific scenarios. For example, RDB
s are intuitively useful for accounting systems because they model the accounting ledger well. NoSQL is preferred in "Big Data" scenarios where the flexibility of data types are essential.

Scalability
Scalability refers to how a database technology adapts to an ever-increasing amount of data without sacrificing performance.
In this regard, singular SQL databases tend to be vertically scalable, in the sense that additional load can be handled by using more efficient and newer hardware (CPUs, RAM and SSD). On the flip side, NoSQL databases tend to be more horizontally scalable (they can automatically handle more traffic by distributing it among more servers in the database cluster).
Note that relational databases can also be scaled via more hardware-- however, there is some additional work to be done to unify the various database instances. This is why NoSQL databases are preferred in the case when our data is increasing at a very high rate.
Support
Historically, SQL database were in the market long before the NoSQL
ones arrived. Therefore, it shouldn’t come as a surprise that almost all the SQL database vendors provide substantial support to their users. Moreover, a huge community of independent consultants is there to help with the large deployment of SQL databases.
Of course, the same is starting to also be true for NoSQL databases. However, many are still in their embryonic stage, and thus depend more (or often solely) on the open source community for support. Furthermore, independent consultants are also more scarce when it comes to the setup and deployment of large-scale NoSQL databases.
Languages Used
SQL databases support Structured Query Language (SQL)
which allows us to perform various operations on the database. It accomplishes this by providing different types of commands. These commands can be categorized based on their functionality:
- Data Definition Language (DDL)
- Data Manipulation Language (DML)
- Data Control Language (DCL)
- Transaction Control Language (TCL)
- Data Query Language (DQL)
Though SQL
is the most stable and widely used option for performing database operations, it may be restricting in the sense that it requires users to predefine the structure of tables and records. There's also the constraint that all data it stores must be consistent in observing that structure.
On the other hand, NoSQL databases are dynamic and flexible. They allow storing unstructured data in multiple ways. Depending on the nature of data, NoSQL options include document stores, key-value pairs, graph databases, and column-oriented stores. As mentioned, you are not required to come up with the structure of data before-hand. Each document may have its own unique structure. This is referred to as Unstructured Query Language (UnQL)
and syntax will vary between products.
ACID vs BASE Model:
SQL
databases never compromise on ACID
(Atomicity, Consistency, Isolation, Durability) properties. On the flip side, most of the NoSQL DB
s observe the Brewers CAP theorem (Consistency, Availability and Partition tolerance) and the BASE
Model (Basic Availability, Soft-state, Eventual Consistency).

Examples
Finally, let's provide some examples. Although there are many RDBs and NoSQL, we will restrict this list to the most popular ones:
SQL DBs include MS-SQL, Oracle, SQLite, MySQL, and Postgres.
NoSQL DBs include CouchDB, MongoDB, BigTable, Cassandra, Redis, RavenDB, HBase, and Neo4j.