Types of Databases
Learn about the different types of databases and their properties.
We'll cover the following
Now that we know the most important terms regarding databases, let’s take a look at the different types of databases.
Relational databases
Relational databases organize data in tables. A table consists of related columns (attributes) and rows (data entries). The layout of these tables is called the database schema. To relate data from different tables with each other, keys are used to uniquely identify rows. Foreign keys in other tables can then be used to refer to the row of the source table.
Relational databases are still the most common type of database and are widely used across industries. Most relational databases are ACID compliant. Relational databases are usually queried with the Structured Query Language (SQL).
Examples of relational databases:
- MySQL/MariaDB
- PostgreSQL
- Oracle
- Microsoft SQL Server
OLTP vs OLAP
Online transactional processing (OLTP) and online analytical processing (OLAP) are two flavors of relational databases. They are both based on the same relational database architecture but are optimized for different purposes.
An online transactional processing (OLTP) database is used to process a large number of transactions in real time with a latency of only a few milliseconds. Following are a few examples of OLTP:
- Financial transactions
- Hotel booking systems
- Inventory of online shops
Online analytical processing (OLAP) databases are more focused on complex analytical capabilities (data mining) and do not require real-time processing of transactions. Analytical queries to the database can take a long time to process and analyze big amounts of data. Following are a few examples of OLAP:
- Business intelligence
- Report generation
- Billing systems
Often, OLAP systems are used on top of OLTP systems. The data from the OLTP system (e.g., the latest financial transactions) are copied into the OLAP database for more complex analysis. This approach has the benefit of separating transactional and analytical processes and not overloading the OLTP database with analytical queries.
NoSQL databases
NoSQL databases are databases that are not modeled with tables like relational databases. The term NoSQL became popular in the last 10 years to distinguish these databases from relational databases.
Because NoSQL is an umbrella term describing different database architectures, there is no single data format. Most commonly, data is stored in key-value pairs, graphs, or documents.
A very popular example of a NoSQL database is MongoDB.
Get hands-on with 1400+ tech skills courses.