mikaelsvensson / achievements

2 stars 2 forks source link

Store database backups in cloud #78

Open mikaelsvensson opened 4 years ago

mikaelsvensson commented 4 years ago

Data is currently not properly backed up.

Problem 1 During a redeploy of the service, it might be more suitable to store a database backup temporarily in the cloud rather than on whatever host is running the Ansible playbook.

Problem 2 During a redeploy of the service, old database backups are not transferred to the new host (meaning that a redeploy removes the possibility to revert corrupt data from an older backup). There seems to be an rsync job to address this already.

Problem 3 During normal operations, backups are only stored on the host itself (meaning that data is lost forever if the host is destroyed).

Ways forward

Use Google Cloud Storage. Their free tier looks really promising and might offer free-forever storage of 5 GB data, well enough for all database backups.

Notes:

https://cloud.google.com/storage/docs/locations

https://cloud.google.com/storage/docs/quickstart-gsutil

https://cloud.google.com/storage/docs/authentication https://serverfault.com/questions/767728/using-json-keys-with-google-cloud-gsutil https://cloud.google.com/storage/docs/gsutil/addlhelp/CredentialTypesSupportingVariousUseCases

https://cloud.google.com/free/docs/gcp-free-tier

mikaelsvensson commented 4 years ago

Side note: Google Cloud Storage might also be useful for storing images (badge icons and such). Read more on https://cloud.google.com/storage/docs/access-public-data and https://cloud.google.com/storage/docs/access-control/making-data-public.

Bonus: This might also mean that all images can be served over https, meaning that the site will be more reputable according to modern browsers (by not mixing http and https assets).