PostgreSQL Is Not a NoSQL Database
Every database comes from a different class of database management systems. There are several types of database management systems, and these are the following:
This tutorial will focus on relational databases, hierarchical databases, and NoSQL databases. We will cover the databases used in each DBMS and how they differ.
Relational Database
A relational database uses tables to capture data in records, and these tables have relationships that are constrained using primary keys and foreign keys.
The image below shows a relational database table divided into rows and columns. The columns represent the fields, and the rows represent the records.
Relational databases include:
Hierarchical Database
A hierarchical database stores the data as records. These records are organized into a tree-like or parent-child structure, with the parent having many children nodes connected through links.
The image below shows how hierarchical data is organized.
The hierarchical databases include:
NoSQL Database
NoSQL databases are used in distributed systems to store huge amounts of data. These databases are used in real-time applications and Big data.
These databases are best suited to store hierarchical data, and they store data in formats such as JSON, XML, and YAML.
The NoSQL database data store types include key-value store, document store, column store, and graph-based.
The following image shows how the key-value store is used to store data in NoSQL databases.
The NoSQL databases include:
PostgreSQL Is Not a NoSQL Database
PostgreSQL is a relational database that can execute queries using JSON, a format used by the NoSQL database as mentioned above.
The JSON format is the most common method used to interact with semi-structured data, and a developer might infer that PostgreSQL is a NoSQL database due to this reason, but that is not the case.
Note that even if you use the JSON format while working with PostgreSQL, the data is recorded in tables that have relationships.
The following image shows JSON data structure, which can be used with databases that support JSON such as PostgreSQL and NoSQL databases such as MongoDB.
David is a back end developer with a major in computer science. He loves to solve problems using technology, learning new things, and making new friends. David is currently a technical writer who enjoys making hard concepts easier for other developers to understand and his work has been published on multiple sites.
LinkedIn GitHub