DEV Community

m-hashir
m-hashir

Posted on

Internals of PostgreSQL - Chapter 2

This chapter focuses on the process and memory architecture of PostgreSQL.
PostgreSQL is a client/server based RDBMS, with a multi-process architecture running on a single server. Some of these processes are as follows:
1. Postgres Server Process: The parent of all processes, this process allocates shared memory area, starts background processes, and waits for client request. Upon receiving one, it starts a backend process.
2. Backend Process: Handles all the queries by one connected client. It communicates via TCP and can have multiple connections at the same time.
3. Background Process: Carries out variety of tasks for specific features and internals.
Memory architecture of PostgreSQL can be classified into two types:
1. Local Memory Area: Each backend process allocates some memory for processing. Examples of these are work_mem, maintenance_work_mem and temp_buffers
2. Shared Memory Area: Allocated by a server when it starts up. Examples of these are shared buffer pool, WAL buffer and commit log.
In addition to these PostgreSQL allocates memory for tasks such as control mechanisms, various background processes and transaction processing.

Top comments (0)