
Note that compared to other methods, replication slots retain only the number of segments known to be needed. We will use “ replication slots” for the standby as a solution to avoid the master server from recycling old WAL segments before the standby has received them. This guide shows how to set up a Postgresql 12 master-standby streaming replication on CentOS 8. One downside of this approach is that in case the master server crashes, any uncommitted transactions may not be replicated and this can cause data loss.

This means that there is a small delay between committing a transaction in the master server and the changes becoming visible in the standby server. With streaming replication, a standby (replication slave) database server is configured to connect to the master/primary server, which streams WAL records to the standby as they are generated, without waiting for the WAL file to be filled.īy default, streaming replication is asynchronous where data is written to the standby server(s) after a transaction has been committed on the primary server. This solution allows for a standby server to be implemented using file-based log shipping or streaming replication, or where possible, a combination of both approaches.

PostgreSQL database supports several replication solutions to build high-availability, scalable, fault-tolerant applications, one of which is Write-Ahead Log ( WAL) Shipping.
