by scardine · 9y ago · 0 comments
Postgres has it, but it is kind of a pain to setup correctly and I love RDS because I don't have to deal with the setup anymore.
Check out barman from 2ndquadrant, we've been running it in production for 2 years now - setup was crazy easy and the one time I had to do a restore (for the same reason, UPDATE without a WHERE) it was no-fuss to get it done.
Of course, don't let me stop you from using RDS - but there's certainly user friendly backup solutions for Postgres when you're not :)
When I'm doing surgical work on a DB, I always, always want to do something like :
- SELECT statement showing me the relevant rows (and rowcount=N)
- UPDATE/DELETE statement with a corresponding limit equal to N+1
It gives nice, easy peace of mind that you aren't accidentally wiping out your whole table because you messed up the logic on your WHERE clause. Of course if you made a mistake, you probably still killed N records, but often that is much much better than killing the whole table (and maybe also downstream tables that are linked with FKEY cascade delete!)
1) Replication
2) High-availability configuration
3) Point-in-time recovery (PITR)
4) Import/export in CSV format
Volume snapshot restoration is atomic and probably faster, but it gets you only the specific point in time where the snapshot was taken.
I guess the worst case in terms of storage usage in both mechanisms are not that different, but PITR should be fully transparent performance-wise.