92 points · by craigkerstiens · 8y ago · 16 comments
EDIT: I should clarify that, like the other HA solutions in the article, of course you need to couple this with a backup solution, like periodic dumps to S3, such as the article suggests.
If you mis-manage failover, you will destroy your data. This makes proper backup even more important.
But thanks for the reply, I've edited to clarify that disk sharing is an alternative to the three HA solutions in the article, not the one backup solution (which in all examples is the mundane "copy to S3").
My understanding was/is that with pg_basebackup the new replica would only need to replay state changes since the last checkpoint, not "the entire state from the primary node—from the beginning of time". What am I missing?
The second option is at the physical block layer. It’s not specific to any one DB but is a bit of a blunt instrument (works everywhere but lacks finesse).
The third option would involve base backups being pushed off site as well as archived WAL logs. The replicas would restore the base backups, then catch up via WAL logs. Finally you can directly link up to the master to have a live standby for read only queries. This is the approach used by the WAL-E and WAL-G backup/restore tools and is the one I generally recommend as it has the most flexibility and resilience.