Reference · Cheat sheet
Lesson 0010 distilled — streaming vs logical, async vs sync, and the MySQL binlog contrast. Built to print.
The WAL is an ordered stream of every change (0009). Ship it to another server → a replica. Two ways: copy the bytes or the meaning.
Standby continuously receives & replays the primary's WAL records → byte-for-byte whole-cluster clone, same version, read-only hot standby. The HA backbone.
Async (default): WAL shipped after commit → standby lags → a primary crash loses un-shipped commits on failover.
Sync (synchronous_standby_names): commit waits for the standby's WAL flush → no loss, but a standby outage can hang commits. = synchronous_commit over the network.
Ships row-level changes by replication identity (usually the PK), not bytes. Publisher exposes tables; subscribers subscribe.
Enables: subset of tables, cross major version, cross-platform, writable target. Higher-level → more rules/limits.
| Aspect | MySQL | Postgres |
|---|---|---|
| Default ships | binlog (logical) | WAL (physical) |
| binlog's cousin | — | logical repl |
| No-loss | semi-sync | sync repl |
| Async risk | lose binlog | lose WAL |
SELECT * FROM pg_stat_replication; — state, sync_state, replay_lag (the async loss window).
SHOW synchronous_standby_names; — empty = all async.