How to do it…

On the standby node, changes from the master are read from the transaction log and applied to the standby database. Hot Standby works by emulating running transactions from the master so that queries on the standby have the visibility information they need to fully respect MVCC. This makes the Hot Standby mode particularly suitable for serving a large workload of short or fast SELECT queries. If the workload is consistently short, then few conflicts will delay the standby, and the server will run smoothly.

Queries that run on the standby node see a version of the database that is slightly behind the primary node. We describe this as eventually consistent. How long is eventually? That time is exactly the replication delay plus ...

Get PostgreSQL 10 Administration Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.