DEV Community

Pawan Kukreja
Pawan Kukreja

Posted on

[Summary] Chapter#02 'The Internals of PostgreSQL' Process and Memory Architecture.

Process Architecture

PostgreSQL is a client/server type relational database management system with the multi-process architecture and runs on a single host.

Multiple processes cooperatively managing one database cluster is referred to as a PostgreSQL.

  • Postgres server process is parent of all processes related to a database cluster management
  • Backend processes handles all queries and statements issued by a connected client
  • Background processes perform processes of each feature for database management
  • They perform streaming replication in replication associated processes
  • In the background worker process supported from version 9.3, it can perform any processing implemented by users.

Postgres Server Process

A postgres server is the parent of all in a postgreSQL server, in an earlier version it is called Postman.
‘pg_ctl’ starts all the necessary processes like options. It starts the postgres server process, it allocates a shared memory area in memory, start background processes, start replication associated with processes and more.
5432 is the default network port which the postgres server process listens to, and more than one PostgreSQL server can run on the single host.

Backend Processes

Postgres is called a backend process, one connected client issues all the queries and starts the postgres server, TCP connection is used for communication. Max_connection parameter used to configure parameters and control the max number of clients default 100.

Memory Architecture

Local Memory area: Allocated by each backend process for its own use, Each backend process allocates a local memory area for query processing areas divided into subareas and its size is either fixed or variable.

Shared memory area: Used by all processes of a postgreSQL server, shared memory area is allocated by a PostgreSQL server when it starts and it divided into several fixed subareas

Reference

Top comments (0)