Building a replicated cluster
Replication on the administrator's side: a standby by streaming replication, synchronous or asynchronous mode, lag monitoring, failover, split brain, quorum, witness and replication slots.
- 25 cards
- 7 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- The numbers
- On the diagram
- Scenarios
- Understand
A few cards from the deck
Standby server: what is it?
Show the answer
A copy of a primary that continuously receives its WAL, replays it and can answer reads, ready to take the primary's place.
A
standby.signalfile in the data directory and aprimary_conninfopointing to the primary are enough to start it as a standby.Here is
pg_stat_replicationon the primary. Which server can be promoted without losing a committed write?
```text
application_name | state | sync_state | replay_lag
-----------------+-----------+------------+----------------
secours1 | streaming | sync | 00:00:00.000412
secours2 | streaming | async | 00:00:03.2
secours3 | catchup | async | 00:12:41`secours1secours2secours3- any of the three
Show the answer
secours1Only
secours1is synchronous: every COMMIT completed only after it received the log.secours2may miss a few seconds of writes,secours3is twelve minutes behind.Streaming replication sends the primary's … to the standby, which … it to stay up to date.
Show the answer
Streaming replication sends the primary's WAL to the standby, which replays it to stay up to date.
The standby does not rerun the SQL queries: it applies the physical changes described in the WAL, which makes it byte-for-byte identical.