As we saw in the introduction to this chapter, streaming replication is commonly used as the basis for a high availability architecture because we have our instance that is replicated in one or more servers.
PostgreSQL has two types of replication: synchronous and asynchronous. In synchronous replication, a COMMIT is only valid if it was confirmed by all the PostgreSQL servers used, which guarantees that the data will never be lost.
In asynchronous replication, data can arrive at the standby server AFTER the transaction has been committed on the master server. In many cases, this is fully accepted because asynchronous replication promises little overhead and does not impact the performance of the primary server, which is why asynchronous replication is the standard method of replication and will be developed further throughout this topic.
In the previous chapter, we created our first Ubuntu server with PostgreSQL and this will function as...