Save yourself from a disaster #2: Secure the Storage

This is the second part of the series Save yourself from a disaster: Redundancy on a budget.

How can we make sure our second most important asset is safely secured in case of a disaster?

We could mainly 2 things:

Disclaimer
This guide won’t cover everything, it won’t be a comprehensive guide, and the steps that are shown need to be carefully reviewed and tested in your development/pre-production environment. I don’t take any responsibility for any damage, interruption of service nor leak/loss of data for the use of the instructions in the ebook (nor from any external website I’ve mentioned).

Backups

Let’s back up them on an external (cloud) storage disk.
Why not offline? Because the burden of re-uploading all file stored in a shared folder (which usually are not-so-few) will make the restore process very slow.

Option #1: Remote VM

Let’s use a simple cronjob every hour to sync the whole shared folder to a remote location:

rsync -auv --progress /path/to/shared/folder <IP>:/path/to/shared/folder

Some provider can offer pluggable storage and it would be perfect to detach it and reattach it to another node (only if using the same provider). Alternatively, the VM could be exported and mounted as NFS (with some performance degradation).

By using some cheap storages you could leverage the cost of a cloud-native one. Some providers can offer 2TB for ~$10/month, like TransIP or AlphaVPS. If you combine them together you’ll end up with a slightly higher cost (than using only one) but have definitively greater redundancy.

Option #2: Cloud-Native Storage

Still, with a simple cronjob we could sync the whole shared folder to an S3 bucket (using cold storage access):

aws s3 sync --storage-class GLACIER /path/to/shared/folder s3://<BUCKET>/

It is free to send data into AWS S3 but to take it out you need to pay roughly an extra $0.09 per GB, so in case you have lots of data, you might want to consider this very carefully: to restore 1TB of data it could costs you ~$23/month + ~$90 to restore it.
A cheaper provider for Cloud-Native Storage is Scaleway with ~0.002โ‚ฌ/GB/month (1TB = ~โ‚ฌ2.5).

You need to consider the loss of permissions when saving to AWS S3, so when restoring you need to double-check it to verify they are correct.

Restore

Once everything is backed up, you need to think about how to restore the data properly, or at least switch the access on-the-fly. I’ll cover this in the Disaster Recovery Plan post.


The next post will be about Redundancy of Database, Stay Tuned.

Check out the whole version of this post in the ebook.