Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backups #2

Open
njsmith opened this issue Aug 17, 2019 · 1 comment
Open

Backups #2

njsmith opened this issue Aug 17, 2019 · 1 comment

Comments

@njsmith
Copy link
Member

njsmith commented Aug 17, 2019

The bot stores some data in postgres, so we need to think about backups.

Right now it's running on a free Heroku "hobby-dev" account, which means that Heroku keeps some kind of WAL logs but AFAICT doesn't offer any way to access them (??), and also Heroku will keep one week of daily backups for us if we enable it (which I have).

This isn't too bad. I'm a bit uncomfortable with the idea that heroku is a single-point-of-failure, but honestly they're probably more reliable than anything a shoestring volunteer project like ours could do. But it wouldn't hurt to stick a cron-job somewhere that fetches the backups offsite, just in case.

@wgwz
Copy link
Contributor

wgwz commented Oct 19, 2019

I'm guessing this is this is probably the approach you had in mind @njsmith: https://devcenter.heroku.com/articles/heroku-postgres-backups#downloading-your-backups

That looks like a pretty easy way to get the backup out of the Heroku system. Some open questions are what we will use as the scheduler and where the scheduler will be executing, as well as where will we be saving the backups.

The first architecture that I thought of is something like this:

  • Suppose we could schedule the backup via cron or something like it on Heroku.
  • Once per day this job sends a POST request, which includes the backup URL from Heroku, to a backup service that we maintain somewhere.
  • The backup service could be a quartz app expecting a request like so:
POST /api/backups?backup_url_from_heroku=<>

Headers:
Authorization: Bearer <a-secret-for-the-backup-service>
  • Then the backup service could do whatever it needs to do with the backup.

However this is a lot of extra stuff, and maybe too much for our case. Perhaps the simpler approach would be to use an AWS service like S3 to store the backups. In which case we can probably just schedule a daily job on the Heroku setup, that POSTs the backup to S3 using an API client.

Curious to hear your thoughts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants