11. Streaming Replication

Synchronous streaming replication was implemented in version 9.1. It is a single-master-multi-slaves type of replication, where the terms “master” and “slaves” are usually referred to as primary and standbys respectively.

This native replication feature is based on log shipping, a general replication technique in which the primary server continuously sends WAL (Write-Ahead Log) data to the standby servers, which then replay the received data immediately.

This chapter focuses on how streaming replication works and covers the following topics:

  • How streaming replication starts up.
  • How data is transferred between the primary and standby servers.
  • How the primary server manages multiple standby servers.
  • How the primary server detects failures of standby servers.

Although the first replication feature, which was only for asynchronous replication, was implemented in version 9.0, it was replaced with a new implementation (currently in use) for synchronous replication in version 9.1.