Streaming Replication and WAL
Configure streaming physical replication based on WAL, monitor lag, and set up synchronous replicas for zero-data-loss writes.
Why Replicate?
Replication serves several goals at once:
- HA — survive a primary failure
- Read scaling — offload SELECTs to replicas
- Backup / PITR — continuous archiving
- Geo-distribution — replicas near users
WAL: Write-Ahead Log
Every write goes to the WAL first. WAL guarantees durability and is the foundation of replication: stream WAL to a replica → replica replays WAL → replica is up-to-date.
All lessons in this course
- Streaming Replication and WAL
- Logical Replication for Sharding
- Failover and Leader Election (Patroni, Stolon)
- Read Replicas and Connection Routing