Book Image

PostgreSQL Administration Essentials

Book Image

PostgreSQL Administration Essentials

Overview of this book

Table of Contents (14 chapters)

Upgrading to synchronous replication


Many people are looking for synchronous replication. I have decided to include this section in this book to clear the fog and to remove some false beliefs about synchronous replication.

First of all, the goal of synchronous replication is to narrow the window of data loss in case a server crashes. Asynchronous replication means that data is replicated with a slight delay. Synchronous replication asks the slave if the data has ended up there safely. It does not exactly guarantee that no data can be lost under any circumstances. However, it makes data loss pretty unlikely.

The second thing you have to know about synchronous replication is that you should only use synchronous replication if you have at least three servers. Why that? Well! The idea behind synchronous replication is that your data is so valuable that you want to have it at least on two servers. But what will happen if one of those servers just dies? There is only one left and the core promise...