I am reading backup section of postgresql docs before heading over to create backup strategy on my EC2 instance.
So there are 2 ways to do it.
- Create a dump using
pg_dump
. - File level backup with
WAL
archiving on. I will be using Snapshots so my use case falls in this category.
Now the question is do I need to freeze my filesystem before taking the backup? Postgresql docs suggest that WAL recovery does not get affected by an inconsistent snapshot. Does it make sense to do freeze just to be safe?
Should I take backup via both of above ways?
What sort of time period after which I should remove old WAL logs?
Docs also mention that WAL logs and data should be on the same filesystem to make backup consistent. In that case I am thinking to take backup of WAL logs separately from EBS snapshot and save it in S3 and some external place out of Amazon. Thoughts on this strategy?
Kindly mention if I am missing something.