DEV Community

Muhammad Adil Shahid
Muhammad Adil Shahid

Posted on

Exploring the Structure and Layout of a Database Cluster

Before diving into the structure of database cluster, we first need to understand what database cluster is.

Database cluster is the collection of databases. This collection is managed by a server named PostgreSQL server. This server runs on a single host. Now let's discuss the its structure.

Logical Structure of Database Clusters

  • Just like database cluster is the collection of databases, database is the collection of database objects. These objects are used to store and reference the data. Some examples of database objects are tables, index, views, sequence and function.
  • These database objects are managed in PostgreSQL by Object identifiers OIDs.

  • In PostgreSQL, databases are also database objects, logically separated from eachother.

Physical Structure of Database Cluster

Database cluster is the base directory while database is its subdirectory.

  • The subdirectory of the database contains at least one file of tables and indexes and particular data or configuration files.

Layout of database cluster, databases and tables

  • The base directories (database cluster) contains some files and subdirectories.

  • The databases are under the base directory and their names are same as that of Object identifiers.

  • Tables and indexes are managed by individual OIDs.

  • Data files are managed by relfilenode variable.

Tablespaces

The additional data area outside the base directory is known as tablespaces.
When you issue a command CREATE TABLESPACE, a tablespace is created under the provided directory.

Top comments (0)