datamade / how-to

📚 Doing all sorts of things, the DataMade way
MIT License
81 stars 12 forks source link

Determine database backup strategy for Heroku #208

Closed hancush closed 2 years ago

hancush commented 3 years ago

Background

Once we set a policy for database backups, we'll need a method to implement it for our qualifying apps on Heroku.

Proposal

Investigate whether additional configuration is needed to back up Heroku Postgres databases. If backups come out of the box, learn how they work and add pointers to relevant documentation for restoring from a backup.

Deliverables

This R&D should result in documentation on how to set up and work with database backups for our apps deployed on Heroku.

Timeline

1-2 days

hancush commented 3 years ago

Related to #206

hancush commented 3 years ago

HCG to research whether default Heroku Postgres add-on offers backups by default this cycle.

hancush commented 3 years ago

All Heroku Postgres databases are protected through continuous physical backups. These backups are stored in the same region as the database and retrieved through Heroku Postgres Rollbacks on Standard and Premium tier databases. However, Hobby tier databases do not offer rollbacks, forks or followers.

https://devcenter.heroku.com/articles/heroku-postgres-data-safety-and-continuous-protection

We don't generally use Standard plans for staging sites, but recommend at least the lowest tier Standard plan for production, which means our apps should be covered (although we should check).

Verified this on the MN Election Archive production app, which uses a Standard-0 database:

For Standard-0 Postgres databases, your data — and any changes made to the database — are continuously and automatically backed up over the last 4 days. This allows you to create a clone of your database and roll back to a specific point in time.

Screen Shot 2021-06-17 at 2 55 29 PM

Info on recovering from data loss here: https://devcenter.heroku.com/articles/heroku-postgres-rollback

hancush commented 2 years ago

Create or migrate existing doc on database backups, then add info on Heroku and a placeholder for RDS.

hancush commented 2 years ago

Related to #217.