DEV Community

Arunesh Choudhary
Arunesh Choudhary

Posted on

01 - Understanding the Database Structure

Relational database management system PostgreSQL, sometimes referred to as Postgres, is free and open-source and places a strong emphasis on extensibility and SQL compliance. The Apache AGE team uses openCypher's flexibility to construct a graph database.

This blog post contains excerpts from Hironobu SUZUKI's book "Internals of Postgres," which he wrote.

The distinct database structure of PostgreSQL will be outlined in the sections that follow.

Logical structure

A group of databases run by a PostgreSQL server constitute a database cluster in this database management system. In a previous article, I used the commands bin/pg_ctl -D test -l logfile start and bin/createdb testdb to launch a database cluster called test and create a database within the same post. Different databases may be included in a database cluster. The illustration that follows, taken from "Internals of Postgres," explains things better.

image

Physical Structure

A database cluster is represented physically by a base directory that includes subdirectories that stand in for the different databases. A variety of database items linked to each of these databases can be found in each of these subdirectories. Individual Object Identifiers (OIDs) are used to manage smaller tables and indexes, whereas the variable "relfilenode" is used to manage data files. However, a new relfilenode is made to manage it when the size surpasses 1GB.

Closing remarks

It is essential to appreciate the logical structure of a database cluster in order to understand the links between the databases and database objects that make up the cluster.

People can learn more about the precise locations of files thanks to the physical organization of the database, which makes database manipulation and management simpler.

References

https://www.interdb.jp/pg/pgsql01.html

Top comments (0)