PostgreSQL – System Architecture
Last Updated :
21 Aug, 2024
PostgreSQL, often simply called Postgres, is an advanced open-source Object-Relational Database Management System (ORDBMS). It stands out due to its robust feature set, extensibility, and compliance with SQL standards. Originating as the successor to the POSTGRES system, one of the earliest database systems, PostgreSQL has evolved to become a highly preferred choice for a wide range of applications and developers worldwide.
System Architecture of PostgreSQL
The architecture of PostgreSQL is built around a client-server model, which is pivotal for handling multiple database functions such as managing connections, operations, and both static and dynamic assets. In the simplest terms, a PostgreSQL service has 2 processes:
1. Server-side process
This is the “Postgres” application that manages connections, operations, and static & dynamic assets. It efficiently handles multiple tasks including session management, query processing, and transaction management. Additionally, it ensures data integrity and concurrency control by maintaining locks and writing transaction logs. This process is pivotal in managing database connections and executing the queries received from client applications, making it essential for the robust performance of the system.
2. Client-side Process(Front-end applications)
These are the applications that users use to interact with the database. It generally has a simple UI and is used to communicate between the user and the database generally through APIs.
When the user runs queries on PostgreSQL, the Client Application can connect to the PostgreSQL server (Postmaster Daemon Process) and submit queries through one of many Database Client Application program interface supported by PostgreSQL like JDBC, Perl DBD, ODBC, etc. that helps to provide client-side libraries. In the Client Process, the Communication between Client Application and Client Application library occurs with the help of Library API as shown in the figure below:

PostgreSQL System Architecture
Core Components of PostgreSQL
1. Postmaster Daemon Process
The system architecture of PostgreSQL is based on Process-Per-Transaction Model(Client/Server Model). A running PostgreSQL site is managed by Postmaster which is a central coordinating process. It is also known as Server Process.
The postmaster daemon process is responsible for :
- Initializing the server
- Shutting Down the server
- Handling Connection requests from new clients.
- Perform Recovery.
- Run Background Processes.
2. Shared Memory
Shared memory is the memory that is simultaneously accessed by multiple programs in order to provide fast and efficient results with less redundancy. This is the memory that is reserved for Database Caching and transactional log caching. In PostgreSQLÂ shared Disk Buffer and Shared Tables are Used whose working is explained below.
Shared Disk Buffer: The purpose of the shared disk buffer is to minimize the disk Input/Output.If it is not used then the Disk Input/Output takes more time which causes redundancy and an inefficient system. The advantages of using a shared buffer are:
- Reduce time.
- Can Access a very large amount of Data Easily.
- Minimize heating when multiple users is accessing at the same time.
Shared Tables: This approach involves using the same set of tables to host multiple client data. The main advantages of using this approach are:
- The Lowest Hardware Cost
- The Lowest Backup Cost
- It allows working with large data in a single database.
3. Back-end process
The Postmaster is responsible for handling initial client connections. For this, it constantly listens for new connections as a known port. After Performing an initialization process such as authentication of the user, the postmaster will give rise to a new backend server process to handle the new client. The client interacts only with the Backend server process like submitting queries and receiving queries result. This will show that PostgreSQL actually uses Process-per-transaction model.
The Backend Server is responsible for Executing queries submitted by the client by performing specific operations. Each backend server will handle only a single query at a time. At a time multiple clients are connected to the system hence multiple backend servers executing queries Concurrently. The back-end server access data from the main-memory buffer pool which is placed in shared memory.
After that, the result obtained is provided to the Client Process by Back-end Process.
  WAL(Write Ahead Log)Writer           |
This process Write and flushes WAL Data on WAL buffer                                                                         |
logging collector |
This process is also called logger. It will write an error message to the log file. |
Auto vacuum launcher |
When auto vacuum is enabled, this process has the responsibility of the auto vacuum daemon to carry vacuum operations on bloated tables. This process relies on the stats collector process for perfect table analysis. |
Archiver |
When  Achiever is enabled, the process has the responsibility to copy WAL log file to the specified directory. |
stats collector |
In this statistics information like pg_stat_activity  and pg_stat_all_tables is collected |
checkpointer |
When a checkpoint occurs, the dirty buffer written to the file. |
writer |
It will periodically write the dirty buffer to the file. |
4. Shared Pool
The Shared pool is a RAM area within the RAM Heap that is created during the starting time. A shared pool is a component of SGA (System Global Area). If Shared Pool is not available in RAM or it is not used then it results in high library cache reloads, high row cache reloads.
Why PostgreSQL didn’t use Shared Pool?
PostgreSQL doesn’t provide a shared pool although most of the Database Systems like Oracle, the Shared pool is an important component of its structure. It doesn’t have because PostgreSQL will provide a feature to share SQL information at the process level as compared to Shared Pool.
Simply, if the user will execute the same SQL query several times in one process, it will hard-parse only once which is advantageous over other Database systems because, in another database system that uses a shared pool, the hard-parse occurs for a single SQL statement that is loaded from Shared pool. If the user executes simultaneously a single SQL query several times then it will cause more load.
PostgreSQL in Unix Systems
In UNIX System Kernel Disk Buffer maintain a Memory buffer and provide physical Storage to Data in Disk Storage. Also, the commands of PostgreSQL is verified that the syntax is written is correct and provide an error message with the reason that what is missing in the command, etc.
Special PostgreSQL Features
1. OID in PostgreSQL
OID stands for Object Identifier types. OID is used by PostgreSQL as a Primary Key for various system tables. It is implemented as an unsigned four bytes integer. We can also have an option to use OID in the user-defined table as “WITH OIDS” but is discouraged to use because it is not large enough to provide uniqueness in a Large User-Defined Table. OID’s usually fits best for system tables. It basically gives a built id for every row, contained in the system column.
In PostgreSQL 12 version, the feature of OID for User tables has been removed indirectly i.e. we can use OID explicitly.
2. Vacuuming and Maintenance
The autovacuum process helps maintain database health by cleaning up outdated records and optimizing database performance.
Advantages of PostgreSQL
- It uses LAMP (Linux, Apache, MySQL, PHP) Stack to execute dynamic website and web-application.
- Highly fault-tolerant and requires minimal maintenance
- Supports a wide range of programming languages and frameworks.
- Provides extensive documentation and a supportive community.
Limitations of PostgreSQL
- Performance may lag behind some commercial databases in specific scenarios.
- Limited support for certain proprietary and less popular third-party tools.
Similar Reads
SQL Server Architecture
Microsoft SQL Server is a widely used relational database management system (RDBMS) that organizations around the world rely on for managing and processing their data. It provides a scalable and reliable platform for managing large volumes of data, supporting a wide range of applications from small-
5 min read
PL/SQL Architecture
Prerequisite : PL/SQL Introduction What do you mean by PL/SQL? In Oracle, PL/SQL (Procedural Language/SQL) is the procedural language extension to the non-procedural SQL. It combines the data manipulation power of SQL and the procedural power of standard programming languages. PL/SQL was developed b
3 min read
Oracle Architecture
Pre-requisites: Database Oracle Database is a relational database management system (RDBMS) that Oracle Corporation created and marketed. It is one of the most popular RDBMSs on the market and is used to store and retrieve data for a wide range of applications. Oracle Database is well-known for its
5 min read
PostgreSQL - CREATE TABLE
In PostgreSQL, the CREATE TABLE statement is used to define a new table within a database. It allows us to specify the table's structure, including column names, data types, and constraints, ensuring data integrity and consistency. Understanding the PostgreSQL table creation process is essential for
5 min read
PostgreSQL - CREATE TABLE AS
The CREATE TABLE AS statement in PostgreSQL is a powerful tool used to create a new table and populate it with data returned by a query. This functionality allows you to generate tables on the fly based on query results, which can be very useful for reporting, analysis, and other tasks. Let us bette
3 min read
Architecture of MySQL
MySQL is a Relational Database Management system which is free Open Source Software Under GNU License. It is also supported by Oracle Company . It is fast , scalable, easy to use database management System. MySQL support many operating system like Windows, Linux, MacOS etc. MySQL is a Structured Que
6 min read
Data Stream Management System Architecture
A Database Management System (DBMS) is a software system that is designed to manage and organize data in a structured manner. It allows users to create, modify, and query a database, as well as manage the security and access controls for that database. The Data Stream Management System manages conti
5 min read
NoSQL Data Architecture Patterns
Architecture Pattern is a logical way of categorizing data that will be stored on the Database. NoSQL is a type of database which helps to perform operations on big data and store it in a valid format. It is widely used because of its flexibility and a wide variety of services. Architecture Patterns
4 min read
PostgreSQL - Data Types
PostgreSQL is a robust open-source relational database management system that supports a wide variety of data types. These data types are essential for defining the nature of the data stored in a database column, affecting storage, access, and manipulation. In this article, We will learn about the P
5 min read
RDBMS Architecture
RDBMS stands for Relational Database Management System and it implements SQL. In the real-world scenario, people use the Relational Database Management System to collect information and process it, to provide service. E.g. In a ticket processing system, details about us (e.g. age, gender) and our jo
3 min read