Exploring basic replication concepts
In PostgreSQL, there are two kinds of physical replication techniques:
- Asynchronous replication: In asynchronous replication, the primary device (source) sends a continuous flow of data to the secondary one (target), without receiving any return code from the target. This type of copying has the advantage of speed, but it brings with it greater risks of data loss because the received data is not acknowledged.
- Synchronous replication: In synchronous replication, a source sends the data to a target, that is, the second server; at this point, the server acknowledges that the changes are correctly written. If the check is successful, the transfer is completed.
Both methods have advantages and disadvantages, and in the Managing streaming replication section of this chapter, we will analyze them.
Physical replication and WALs
Let’s briefly summarize what we have already covered about MVCC and WAL segments: we...