SQL vs NoSQL
Gabriel Garcia
SQL (Structured Query
Language) Databases
Characteristics
Structure
• SQL databases are relational,
meaning data is organized into
tables with rows and columns.
Each row represents a unique
record, and each column
represents an attribute of that
record
Query Language
• They use SQL as the standard
language for querying and
manipulating data. SQL is a
declarative language, meaning it
describes what data to retrieve,
not how to retrieve it.
Fixed Schema
• SQL databases have a rigid,
predefined schema. You need to
define the table structure
(schema) before inserting data,
specifying the data types for
each column.
Transactions
• They support ACID (Atomicity,
Consistency, Isolation,
Durability) transactions,
ensuring data integrity and
reliability.
Advantages
Consistency
• The rigid schema ensures data
consistency and maintains
referential integrity.
Support and
Maturity
• SQL databases have been
around for a long time, providing
broad support and extensive
documentation.
Disadvantages
Vertical
Scalability
• Typically, SQL databases scale
vertically (by improving
hardware), which can be costly.
Limited
Flexibility
• Changing the schema of an SQL
database can be challenging and
time-consuming.
Examples of SQL Databases
MySQL PostgreSQL Microsoft SQL Oracle
Server Database
NoSQL (Not Only SQL)
Databases
Characteristi
cs
Structure
• NoSQL databases are non-
relational and can store data in
various formats, such as
documents (JSON), graphs, key-
value pairs, and columns. They
do not require a fixed schema,
allowing for more flexible data
storage.
Flexibility
• They can handle unstructured or
semi-structured data, allowing
diverse information to be stored
without a predefined structure.
Horizontal
Scalability
• NoSQL databases typically scale
horizontally, meaning you can
add more servers to handle
more data and traffic, which is
ideal for large volumes of data
and cloud-based applications.
Advantages
Scalability
• They can handle large volumes
of data and are easily scalable
horizontally.
Flexibility
• They adapt better to changing
data requirements since they do
not require a fixed schema.
Disadvantag
es
Eventual
Consistency
• Instead of providing immediate
consistency, many NoSQL
databases offer "eventual
consistency," which might be
less suitable for applications
requiring real-time precision.
Lack of Standard
• There is no standard query
language like SQL for NoSQL
databases, which can make
transitioning between different
systems more complex.
Examples of NoSQL Databases
MongoDB Cassandra Redis (key- Neo4j (graph-
(document- (column-based) value) based)
based)