IT lexicon Database Streaming replication

Streaming replication

Database På svenska → Updated: 2026-07-28

PostgreSQL's built-in physical replication: a primary server streams its WAL to one or more replicas that apply it continuously. The replicas can take read queries (hot standby) and serve as failover targets.

Physical = a byte-for-byte copy of the WAL → the replica is an exact clone (same version, the whole cluster). Asynchronous (default, fast but a risk of data loss on failover) or synchronous (the primary waits for the replica's ack → zero data loss, higher latency). Distinct from logical replication (which replicates logical row changes, can be selective and cross versions). Use case: high availability + read scaling. Tools: Patroni for automatic failover, repmgr. Replication lag is monitored closely — a lagging synchronous replica can block the primary's commits.

← Back to the lexicon