Wednesday, November 25, 2026

Oracle RAC vs RAC One Node

Oracle RAC One Node is best understood as Oracle RAC infrastructure with only one active database instance at a time, plus the ability to relocate that instance to another RAC node with minimal interruption.

1. RAC One Node architecture

A typical 2-node configuration looks like this:

                    Applications
                         |
                 SCAN / Connect String
                         |
              +----------+----------+
              |                             |
         Node 1                     Node 2
     +----------------+        +----------------+
     | Grid Infra     |        | Grid Infra     |
     | ASM            |          | ASM            |
     | DB Instance    |        |                |
     | DB1_1 ACTIVE   |        | Standby Node   |
     +-------+--------+        +-------+--------+
                 \                          /
                   \                      /
               +---------------------+
               |   Shared Storage      |
               | ASM Disk Groups      |
               | DATA / RECO / OCR   |
               +---------------------+

The critical point is:

Both servers are members of the RAC cluster, but normally only one RAC One Node database instance is running.

This is fundamentally different from traditional RAC, where multiple instances of the same database normally run simultaneously.


2. Main components

Oracle Grid Infrastructure

Both nodes run Oracle Grid Infrastructure, including:

  • Oracle Clusterware
  • ASM
  • CRS
  • SCAN
  • VIPs
  • Cluster resources

So the underlying infrastructure is still a proper RAC cluster.

Shared storage

Both nodes access the same database storage, normally through ASM:

             +-------------------+
             |   Shared Storage  |
             +-------------------+
                 /            \
                /               \
          +---------+       +---------+
          | Node 1  |       | Node 2  |
          | ASM     |       | ASM     |
          +---------+       +---------+

The database does not need to copy its datafiles from Node 1 to Node 2 when relocating.

Both nodes already have access to:

  • Datafiles
  • Control files
  • Online redo logs
  • SPFILE
  • FRA
  • ASM disk groups

3. Normal operation

Suppose you have:

Cluster: PROD-CLUSTER
Node 1: server01
Node 2: server02
Database: PROD

During normal operation:

Node 1                                 Node 2
------                                     ------
Clusterware                    Clusterware
ASM                                    ASM


PROD_1
  |
  +-- Active
  |
Application
connections

The database workload is handled by PROD_1 on Node 1.

Node 2 remains available as another possible location for the database.


4. What happens during relocation?

This is one of the biggest advantages of RAC One Node.

Suppose Node 1 needs:

  • OS patching
  • Hardware maintenance
  • Firmware upgrade
  • Grid Infrastructure maintenance
  • Planned server shutdown

Instead of stopping the application database for a long maintenance window, you can relocate the database.

Conceptually:

BEFORE
Node 1                                 Node 2
PROD_1 ACTIVE           No PROD instance

            Relocate
               --->

DURING RELOCATION

Node 1                 Node 2
PROD_1 ACTIVE           PROD_2 starts
   \                                 /
     \ _________________/
          temporary
          overlap


AFTER

            Node 1                     Node 2
No PROD instance        PROD_2 ACTIVE

Oracle calls this capability Online Database Relocation.

The temporary overlap is important. During a planned online relocation, another instance can temporarily start on the destination node to facilitate the transition.

That does not make it regular active-active RAC operation.


5. RAC vs RAC One Node

This distinction is extremely important.

FeatureRACRAC One Node
Cluster nodesMultipleMultiple
Active DB instancesMultipleNormally one
Shared storageYesYes
ASMCommonlyCommonly
ClusterwareYesYes
Active-active DBYesNo
Workload across nodesYesNormally one node
Instance relocationYesCore capability
Horizontal DB scalingYesLimited
Server maintenance flexibilityExcellentExcellent
Cache FusionNormal operationLimited significance with single active instance

Think of it like this:

RAC

Application
     |
 +---+---+
 |         |
DB1     DB2
 |            |
Node1   Node2
      /        /
 Shared DB

Both database instances actively service the same database.

RAC One Node

Application
     |
    DB1
     |
   Node1
     |
 Shared DB
     |
   Node2
 potential relocation target


6. What happens if the active node crashes?

Suppose the database is running on Node 1:

Node 1                      Node 2
PROD active                 Available
   X
Node failure

Clusterware detects the failure and can restart the database instance on the surviving node:

Node 1                      Node 2
FAILED                      PROD
                            Restarted
                              |
                            ACTIVE

There will still be an interruption because the instance has to be recovered/start on the surviving node.

Therefore:

RAC One Node provides high availability, but it isn't the same as active-active RAC where another database instance is already running and serving the database.


7. Planned vs unplanned event

There is an important architectural difference.

Planned relocation

For maintenance:

Node 1                     Node 2
Instance A                 Instance B
ACTIVE   ------->          STARTS
                           /
    +---- transition ------+

This is designed to reduce application disruption.

Unplanned Node 1 failure

Node 1                     Node 2
Instance A
   |
   X
FAILED
                             |
                             v
                       Instance restart
                             |
                       Instance recovery
                             |
                           OPEN

The application experiences an outage while failover/recovery occurs.

Actual recovery time depends heavily on workload, redo volume, storage latency, Fast Application Notification/client configuration, and instance recovery settings.


8. RAC One Node vs Data Guard

As a Database Architect, this distinction is particularly important when designing HA/DR.

RAC One Node

Protects mainly against:

  • Server failure
  • OS problems
  • Planned server maintenance
  • Some hardware failures

But the nodes normally share the same storage/database.

Data Guard

Provides another database:

Primary Site
     |
   PROD
     |
     | Redo
     v
Standby Site
     |
  PROD_DR

Data Guard protects against much broader failure scenarios, especially when the standby is in a separate fault domain/site.

Therefore a strong architecture can be:

             PRIMARY DC
        RAC One Node Cluster
       +---------------------+
       |                     |
    Node 1                Node 2
        \                      /
          \                  /
           PROD Database
                |
                |
            Data Guard
                |
                v
                DR DC
        RAC One Node Cluster
       +---------------------+
       |                     |
    Node 3                Node 4
       \                     /
         \                 /
      PROD Standby

This separates two requirements:

  • RAC One Node = local HA / mobility
  • Data Guard = database/site-level DR

9. Why would you choose RAC One Node instead of RAC?

This is where RAC One Node can be attractive for an enterprise database estate.

Imagine a cluster with powerful servers:

Node 1
  PROD1
  PROD2
  PROD3

Node 2
  PROD4
  PROD5
  PROD6

Each database runs as a single active instance, but Clusterware can relocate databases between the nodes.

This provides:

Consolidation

Multiple databases can share the RAC cluster infrastructure.

Maintenance flexibility

Before maintenance:

Node 1                Node 2
PROD1   ------------> PROD1
PROD2   ------------> PROD2

Then perform maintenance on Node 1.

Workload mobility

You can redistribute databases between servers.

Reduced complexity compared with active-active RAC

Applications don't necessarily need the same scale-out model that true RAC is designed to provide.


10. One important misconception

People sometimes interpret RAC One Node as:

"Oracle database running on one standalone server with another cold standby."

That's not quite correct.

The architecture still uses Oracle RAC/Clusterware infrastructure.

The better mental model is:

A RAC-enabled database constrained to run primarily as a single active instance, with the capability to move between cluster nodes.


Architecture decision

Choose RAC One Node when:

  • You need local HA.
  • One server can comfortably support the entire database workload.
  • You want planned online relocation.
  • You have several databases to consolidate.
  • You don't need multiple active instances for scale-out.

Choose full RAC when:

  • A single server isn't enough.
  • Multiple instances need to process workload concurrently.
  • You need scale-out across cluster nodes.
  • Application/database workload justifies RAC complexity.

Add Data Guard when:

  • You need DC/site protection.
  • You need a geographically separated DR database.
  • Storage/cluster failure must also be protected against.

Normally treat RAC One Node as an HA/consolidation decision and Data Guard as a DR decision, rather than viewing one as a replacement for the other.

About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Saturday, November 14, 2026

PostgreSQL Process Architecture Diagram and Details


PostgreSQL Process Architecture Diagram

                           +------------------+
                           |    POSTMASTER    |
                           |   (Parent PID)   |
                           +---------+--------+
                                     |
       ----------------------------------------------------------------
       |            |            |            |            |            |
       v            v            v            v            v            v
+-------------+ +-----------+ +-----------+ +-----------+ +---------+ +---------+
| Background  | | WAL       | |Checkpointer| | Autovac  | | Archiver| | Startup |
| Writer      | | Writer    | |           | | Launcher | |         | | Process |
+-------------+ +-----------+ +-----------+ +-----------+ +---------+ +---------+
                                                        |
                                            ----------------------
                                            |         |          |
                                            v         v          v
                                      +----------+ +----------+ +----------+
                                      |Vacuum W1 | |Vacuum W2 | |Vacuum W3 |
                                      +----------+ +----------+ +----------+
                                        Client Connections
                                                |
       ----------------------------------------------------------------
       |                 |                    |                  |
       v                 v                    v                  v
+--------------+ +--------------+ +--------------+ +--------------+
| Backend PID  | | Backend PID  | | Backend PID  | | Backend PID  |
| User Session | | User Session | | User Session | | User Session |
+--------------+ +--------------+ +--------------+ +--------------+
Shared Memory:
--------------------------------------------------------
| Shared Buffers | WAL Buffers | Locks | Proc Array |
--------------------------------------------------------


How to See PostgreSQL Processes at OS Level

Find Postmaster (Parent Process)

ps -ef | grep postgres

Example:

postgres  1000     1  0 10:00 ? 00:00:00 postgres
postgres  1001  1000  0 10:00 ? 00:00:00 postgres: checkpointer
postgres  1002  1000  0 10:00 ? 00:00:00 postgres: background writer
postgres  1003  1000  0 10:00 ? 00:00:00 postgres: walwriter
postgres  1004  1000  0 10:00 ? 00:00:00 postgres: autovacuum launcher

Notice:

PID 1000 = Parent Process
PPID 1   = Started by OS

This is the Postmaster.


Better Process Tree

Linux

pstree -p | grep postgres

Example:

postgres(1000)
 ├─postgres(1001)
 ├─postgres(1002)
 ├─postgres(1003)
 ├─postgres(1004)
 ├─postgres(1200)
 ├─postgres(1201)
 └─postgres(1202)

Much easier to visualize.


1. Postmaster

Responsibility

  • Starts all PostgreSQL processes
  • Accepts client connections
  • Handles crash recovery
  • Monitors child processes

Check:

ps -fp <postmaster_pid>

Example:

ps -fp 1000


If Backend Crashes

Backend dies
      ↓
Postmaster detects
      ↓
May restart required processes

Postmaster acts like a supervisor process.


2. Backend Process

Every client connection gets a backend process.

Connect:

psql postgres

Run:

SELECT pg_backend_pid();

Example:

  pg_backend_pid
-----------------
      14567

At OS level:

ps -fp 14567

Output:

postgres: appuser mydb 10.0.0.10 idle


Find Active Queries

SELECT pid,
       usename,
       state,
       query
FROM pg_stat_activity;

Map PID to Linux:

top -Hp <pid>

or

ps -fp <pid>


3. WAL Writer

Responsibility

Writes WAL buffers to:

$PGDATA/pg_wal

Process appears as:

postgres: walwriter

Check:

ps -ef | grep walwriter

Example:

postgres 1003 1000 0 ? postgres: walwriter


Observe WAL Activity

Inside PostgreSQL:

SELECT *
FROM pg_stat_wal;

Important metrics:

wal_records
wal_fpi
wal_bytes


4. Checkpointer

Responsibility

Writes dirty pages from memory to data files.

Process:

postgres: checkpointer

View:

ps -ef | grep checkpointer


Monitor

SELECT *
FROM pg_stat_bgwriter;

Interesting columns:

checkpoints_timed
checkpoints_req
checkpoint_write_time
checkpoint_sync_time


5. Background Writer

Responsibility

Gradually writes dirty buffers before checkpoint.

Goal:

Reduce checkpoint spikes

Process:

postgres: background writer

Check:

ps -ef | grep "background writer"


Why Important

Without BGWriter:

Checkpoint writes millions of dirty pages

causing:

High I/O
Slow performance


6. Autovacuum Launcher

Responsibility

Monitors all databases.

Starts worker processes when necessary.

OS command:

ps -ef | grep autovacuum

Example:

postgres: autovacuum launcher


7. Autovacuum Workers

Process:

postgres: autovacuum worker

Check:

ps -ef | grep "autovacuum worker"

Example:

postgres: autovacuum worker mydb


Monitor Current Vacuum

SELECT *
FROM pg_stat_progress_vacuum;

Output:

pid
phase
heap_blks_total
heap_blks_scanned


8. Archiver Process

Only if:

archive_mode = on

Process:

postgres: archiver

Check:

ps -ef | grep archiver


Monitoring

SELECT *
FROM pg_stat_archiver;

Example:

archived_count
failed_count


9. Startup Process

Visible during:

Database startup
Crash recovery
Standby recovery

OS:

ps -ef | grep startup

Example:

postgres: startup recovering


During Recovery

Logs:

tail -f $PGDATA/log/postgresql.log

Example:

redo starts at ...
redo done at ...


10. WAL Sender

Primary Server Replication.

Process:

postgres: walsender

Check:

ps -ef | grep walsender


Monitoring

SELECT *
FROM pg_stat_replication;

Example:

application_name
client_addr
state
sync_state


11. WAL Receiver

Standby Server.

Process:

postgres: walreceiver

OS:

ps -ef | grep walreceiver


Monitoring

SELECT *
FROM pg_stat_wal_receiver;


Real Production Troubleshooting

Check Entire Process Architecture

ps -ef | grep postgres


Check Process Tree

pstree -p | grep postgres


Check CPU Consumer

top -p $(pgrep postgres | tr '\n' ',')


Match PostgreSQL PID with Query

SELECT pid,
       usename,
       state,
       wait_event,
       query
FROM pg_stat_activity;

Then:

ps -fp <pid>


Check Shared Memory

ipcs -m

Or:

cat /proc/<postmaster_pid>/status


Oracle vs PostgreSQL Process Mapping

PostgreSQLOracle
PostmasterPMON (roughly supervisor role)
Backend ProcessDedicated Server Process
WAL WriterLGWR
CheckpointerCKPT
Background WriterDBWR
Startup RecoverySMON
WAL SenderData Guard Transport
WAL ReceiverManaged Recovery Process
ArchiverARCn
AutovacuumNo direct equivalent

Interview Answer (2-Minute Version)

PostgreSQL uses a process-based architecture. The Postmaster is the parent process that starts and monitors all child processes. For each client connection, a dedicated backend process is created. Key background processes include WAL Writer (writes WAL records for durability), Checkpointer (flushes dirty pages to disk), Background Writer (reduces checkpoint I/O spikes), Autovacuum Launcher and Workers (clean dead tuples and freeze old rows), Archiver (archives WAL files), and WAL Sender/Receiver (streaming replication). At the OS level these can be viewed using commands such as:

ps -ef | grep postgres
pstree -p | grep postgres
top -H -p <pid>

and correlated with database views like:

pg_stat_activity
pg_stat_progress_vacuum
pg_stat_replication
pg_stat_bgwriter






About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

PostgreSQL Postmaster and Background Processes

 

PostgreSQL Postmaster and Background Processes

PostgreSQL has a multi-process architecture. Unlike Oracle (which is largely multi-threaded), PostgreSQL creates multiple OS processes.

1. Postmaster (Main PostgreSQL Process)

The Postmaster is the parent process of all PostgreSQL processes.

When PostgreSQL starts:

pg_ctl start

or

systemctl start postgresql

the first process created is:

Postmaster

Its responsibilities:

  • Listen for client connections
  • Spawn backend processes
  • Start background processes
  • Monitor child processes
  • Perform crash recovery
  • Restart failed workers

Architecture:

                    Postmaster
                         |
    -------------------------------------------------
    |          |           |          |             |
 Background  WAL       Checkpoint   Autovacuum   Backend
 Writer      Writer     Process      Workers     Sessions


2. Backend Processes

Every client connection gets its own backend process.

Example:

Application User-1
        |
    Backend PID 1001
Application User-2
        |
    Backend PID 1002
Application User-3
        |
    Backend PID 1003

Query:

SELECT pid,
       usename,
       application_name
FROM pg_stat_activity;

Each row corresponds to a backend process.


Important Background Processes

3. Background Writer (BgWriter)

Purpose:

Reduce checkpoint spikes.

When users modify data:

Shared Buffers
      ↓
Dirty Pages

These pages stay in memory.

The Background Writer gradually writes dirty pages to disk.

Without it:

Checkpoint would write everything

causing sudden I/O spikes.

View:

SELECT *
FROM pg_stat_bgwriter;


4. WAL Writer

One of the most important processes.

Purpose:

Flush WAL buffers to WAL files.

Flow:

INSERT/UPDATE/DELETE
       ↓
WAL Buffer
       ↓
WAL Writer
       ↓
pg_wal/

Example:

Shared Memory
      |
 WAL Buffer
      |
 WAL Writer
      |
 pg_wal files

Without WAL Writer:

Crash recovery impossible


5. Checkpointer

Purpose:

Create checkpoints

Checkpoint means:

Write dirty pages
to disk permanently

Flow:

Shared Buffers
      ↓
Disk Files

Checkpoint record also goes into WAL.

Benefits:

Faster crash recovery

Check settings:

SHOW checkpoint_timeout;
SHOW max_wal_size;

Monitor:

SELECT *
FROM pg_stat_bgwriter;


6. Autovacuum Launcher

Purpose:

Find tables needing vacuum.

It doesn't vacuum itself.

Rather:

Launcher
     ↓
Creates Workers

Architecture:

Autovacuum Launcher
        |
        +---- Worker 1
        +---- Worker 2
        +---- Worker 3

Check:

SHOW autovacuum;


7. Autovacuum Workers

Responsibilities:

  • Remove dead tuples
  • Update statistics
  • Freeze old tuples
  • Prevent XID wraparound

Example:

SELECT *
FROM pg_stat_progress_vacuum;

Shows currently running workers.


8. Statistics Collector (Older Versions)

In PostgreSQL before v14:

Stats Collector Process

maintained statistics used by:

pg_stat_activity
pg_stat_database
pg_stat_user_tables

In modern PostgreSQL versions:

Shared Memory Statistics

replaces much of the old collector architecture.


9. Archiver Process

Used when:

archive_mode = on

Purpose:

Copy WAL files
to archive storage

Used for:

PITR
Disaster Recovery

Check:

SELECT *
FROM pg_stat_archiver;

Example:

pg_wal
   ↓
Archive Command
   ↓
Backup Location


10. Startup Process

Runs during startup and recovery.

Responsibilities:

Read WAL
Replay transactions
Recover database

Example:

Crash
   ↓
Startup Process
   ↓
Replay WAL
   ↓
Consistent State

Oracle equivalent:

Instance Recovery


11. WAL Sender Process

Used in Streaming Replication.

Primary server:

Primary DB
   |
 WAL Sender
   |
 Network
   |
 WAL Receiver
   |
 Standby

Check:

SELECT *
FROM pg_stat_replication;


12. WAL Receiver Process

Runs on standby.

Purpose:

Receive WAL
from primary

Apply changes continuously.

Check:

SELECT *
FROM pg_stat_wal_receiver;


13. Logical Replication Launcher

Used for:

Logical Replication
Debezium
CDC
Kafka

Launches logical replication workers.

Example:

SELECT *
FROM pg_stat_subscription;


Shared Memory Interaction

All background processes interact with shared memory.

               Shared Memory
      ----------------------------------
      | Shared Buffers                |
      | WAL Buffers                   |
      | Lock Manager                  |
      | Proc Array                    |
      ----------------------------------
                  ^
                  |
    ------------------------------------
    |      |      |       |           |
 Backend WAL    BGW   Checkpoint  Vacuum


Crash Scenario Example

Suppose:

UPDATE accounts
SET balance=4000
WHERE id=1;

Step 1

Backend updates shared buffer.

Backend
  ↓
Shared Buffer

Step 2

Backend creates WAL record.

Backend
  ↓
WAL Buffer

Step 3

WAL Writer flushes WAL.

WAL Writer
  ↓
Disk

Step 4

Checkpointer eventually writes data page.

Checkpointer
   ↓
Data File

Step 5

Server crashes.

Startup Process:

Reads WAL
Replays Missing Changes

Database becomes consistent again.


PostgreSQL vs Oracle Background Processes

PostgreSQLOracle Equivalent
PostmasterPMON + Listener coordination
Backend ProcessDedicated Server Process
WAL WriterLGWR
CheckpointerCKPT
Background WriterDBWR
Startup ProcessSMON Recovery
AutovacuumNo direct equivalent
WAL SenderData Guard Redo Transport
WAL ReceiverManaged Recovery Process
ArchiverARCn

Most Common Interview Question

Explain PostgreSQL Process Architecture

Answer:

PostgreSQL uses a process-based architecture where the Postmaster acts as the parent process. For every client connection, Postmaster creates a dedicated backend process. Several background processes support database operations, including the WAL Writer for durability, Checkpointer for writing dirty pages to disk, Background Writer for smoothing I/O, Autovacuum Workers for MVCC cleanup and freeze operations, Archiver for WAL archiving, and WAL Sender/Receiver processes for streaming replication. Together they ensure performance, crash recovery, and data consistency.

About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Oracle RAC vs RAC One Node

Oracle RAC One Node is best understood as Oracle RAC infrastructure with only one active database instance at a time , plus the ability to r...