Chapter 5. Setting Up Synchronous Replication
So far, we have dealt with file-based replication (or log shipping, as it is often called) and a simple streaming-based asynchronous setup. In both cases, data is submitted and received by the slave (or slaves) after the transaction has been committed on the master. During the time between the master's commit and the point when the slave actually has fully received the data, it can still be lost.
In this chapter, you will learn about the following topics:
- Making sure that no single transaction can be lost
- Configuring PostgreSQL for synchronous replication
- Understanding and using
application_name
- The performance impact of synchronous replication
- Optimizing replication for speed
Synchronous replication can be the cornerstone of your replication setup, providing a system that ensures zero data loss.