Show HN: Low-cost backup to S3 Glacier Deep Archive (github.com)
Hi,
most people (hopefully) have local backups. However, when that backup fails, it is good to have a backup stored somewhere off-site. In the old days you would ship physical drives/tapes, which is cumbersome, costly, and slow. With fast upload speeds, it is now possible to upload your data to the cloud. I have found S3 Glacier Deep Archive to be a great solution for this:
- It is very cheap ($1/TB/month for US region) - Very reliable (99.999999999% data durability, data spread over 3 Availability Zones)
However, usability out of the box is not that great, I'm not aware of any automated backup solution for Deep Archive. This free project provides that.
Currently, ZFS is required, but that might change. Please try it out and provide feedback!
143 comments
[ 86.8 ms ] story [ 4769 ms ] threadStill good idea to check the extra charges when reading.
[1] https://medium.com/@karppinen/how-i-ended-up-paying-150-for-...
I can see home backup use cases where you might be happy to get it out at 100Gb/month over time. For example, a home photo/video library where you can view arbitrary photos, and slowly pull out all of them.
At which point 100$ per TB isn't that bad.
One interpretation is that about 1 bit per 100 GB will randomly flip each year. That or S3 Glacier is expecting to hit a catastrophic event every 100 billion years (which doesn't seem nearly frequent enough).
https://blog.synology.com/data-durability
> Data durability: the ability to keep the stored data consistent, intact without the influence of bit rot, drive failures, or any form of corruption. 99.999999999% (11 nines) durability means that if you store 10 million objects, then you expect to lose an object of your data every 10,000 years.
Edit: and it'll still break when us-east-1 is destroyed by the sun exploding.
Shouldn't that be multiplied by the number of bytes of this object? I still don't quite understand the math apparently because then we'd all be losing 10KB+ files yearly.
For the purposes of this calculation, you would probably use the average size of a stored file, determine the number of chunks that was split into, and then the likelihood of losing/corrupting a chunk.
By looking at the durability of objects, you (a) reinforce the object-store nature of S3, and (b) avoid reporting “durability per kb”, which isn’t linear, and more difficult to interpret.
Honestly, the durability number is so high, that adding the bytes as a unit would just make it difficult to reason about. And S3 doesn’t store “bytes” — it stores objects (made of bytes). So, that’s the metric they chose to focus on.
* have a bad block on one drive * have a bad block in *EXACTLY SAME LOCATION* on the second drive * have a bad block in *EXACTLY SAME LOCATION* on the third drive * all of that happening within one scrub period (which is usually once a month).
And that's just simple RAID6 setup without external redundancy.
As you can see it would be far easier to lose data due to just correlated drive failures, than from random block corruption.
Backblaze apparently gets the same number by looking at the failure rate of their drives, and how long it takes to recover from a drive failure (reaching the same redundancy as before the failure). By being able to recover from three drive failures before the first drive is rebuilt, they get 11 nines of durability [1]. Or in other words: 0.000000001% of drive failures are non-recoverable and lose data. I assume AWS does basically the same calculation, adjusted for whatever technology they use.
1: https://www.theregister.com/2018/07/19/data_durability_state...
Backblaze takes user data, splits it into 17 pieces, add 3 pieces of redundancy, and split it across 20 racks. Backblaze has a tiered response system, my memory is something along the lines of 1 of 20 disks dying = schedule for replacement the next business day. The 2nd disk triggers a quicker/higher priority response. 3rd disk triggers pages and all hands on deck.
Given that disks have a annual failure rate on the order of 1%, and losing the first disk has a chance of 1% * 1/365, if a second disk is 4 hours that 1% * 1/(3656), and a 3rd disk is 1%/(36524) you end up with lots of zeros:
0.01(1/365) 0.01 * 1/(3656) 0.01 * 1/(365*24) .00000000000000014281
That's just to remove the redundancy, you still need to lose another disk before data is lost.
Sure there's other failure methods, including those that could take out an entire data center. I did find a statement saying that data stored in the US-West region would be stored in both Sacramento and Phoenix, but not sure if that means each B2 object uploaded would be in both.
I.e. you have to maintain your own index of files, where they could have just done this for you.
The pricing model for downloads is too easy to shoot yourself in the foot. I'd rather pay a tiny bit more to not have bankruptsy traps built into the product. So that's what I do now.
I heard from a friend who chose AWS to handle backups specifically because he prepaid for them, that presumably is already possible.
I'd love to see what source(s) this claim has in practice. How did you arrive at 9-9s? Shouldn't it be spread over 3 Regions rather than Availability Zones, as otherwise it could just end up in the same geographical region while giving the impression it's spread across many.
https://aws.amazon.com/s3/storage-classes/#____
You could upload to multiple regions just to be sure.
https://www.tarsnap.com/
It’s probably not as cheap as glacier but it’s cheap enough for my needs, secure and encrypted and was very easy to set up.
https://www.rsync.net/products/borg.html
To be completely fair: since Tarsnap doesn't have a minimum order size, it's still a better value in the 0-6 GiB range.
Original:
0-40 GiB, due to the minimum and assuming value means "$ to store all my X GiB" as opposed to "$/GiB"
The breakeven point is lower, at 6 GiB.
You looked at https://www.rsync.net/products/borg.html
I looked at https://www.rsync.net/pricing.html, because I clicked pricing and didn't scroll down.
You are correct.
I also pay $120/year for Google drive which is my "online" backup, then store the files locally of course.
Seems to work OK for me, and I'm insulated against the problem of: "google's algorithm decided I was a Bad Person and terminated my accounts".
I think you need to multiply that by the durability of amazon as a company...
I suspect that in any given year there is perhaps a 1% chance that they shut down AWS with no chance to retrieve data. (either due to world war, civil war in the usa, change in laws, banning you as a customer, change in company policy, bankrupcy, etc.)
That would translate to 64% chance in 100 years. Seems plausible :)
And, most likely you still have your original data. P(Data loss) = P(Bankruptcy happens dec 2022) x P(drive failure happens dec 2022).
The likelihood of the company going down one day, without notice, and, coincidentally, your regular data store getting trashed the next day is extraordinarily low. Absent some kind of end of the world scenario the two events are, for all intents and purposes, independent and low probability.
If you're planning for that scenario you've probably slipped over the line from sensible backupper to prepper.
Arq manages the restore process, telling AWS to make Glacier/Deep Archive objects "downloadable", waiting for them to become downloadable, and then downloading the data.
Specifically I have an S3 remote configured to use the Deep Archive tier. On top of that I have an encryption remote (pointing to the S3 remote). Then I just rclone my pool to this remote, and all my crap is shipped off to Ireland.
Like in the link, I expect never to need it; restore is so expensive that it's a "house burns down" insurance only.
- It will not create archives by default, so potentially upload a lot of files (just like rsync). There are a few workarounds in the documentation to mitigate the cost.
- It cannot do restore of Deep Archive data
The corruption was uncovered when we started migrating to another cloud platform, we had to restore from local copies.
I’m very happy to pay USD 200 if I ever need to retrieve a last chance backup. If I just want the data in no rush I can trickle it back over 20 months for free.
But, yeah, making use of a free service loophole, it taking ten months for a terabyte, and presuming you're using zero other Amazon services that count towards your free trial amount, I agree with you it's a stretch. But if you're really cheap or hate Amazon with a passion (but not enough not to host with them) it's not that far fetched.
There's also code smell.
I had a quick glance through and couldn't help noticing the stench of assumptions and poor (or non-existent) exception handling.
"Restore and download is quite costly:
Restore from S3 tape to S3 blob: $0.0025/GiB ($2.56/TiB) for Bulk within 48 hours $0.02/GiB ($20.48/TiB) for Standard within 12 hours Download: The first 100 GiB/month are free, then 10 TiB/Month for $0.09 per GiB ($92.16/TiB) and discounts for more."
TLDR if I read it correctly 2.56+92.16 USD to get your 1TB back home
Not that bad, but I feel like buying every half year 1TB drive for ~50USD and just storing it wherever outside your home would be cheaper option. But it depends how often you need to perform backup.
If you need the last resort backup, then you would probably want to revert to normal operations ASAP where you have the original and the first resort backup back in place!
Rclone is also multi threaded so goes much faster compared to rsync
- It will not create archives by default, so potentially upload a lot of files (just like rsync). There are a few workarounds in the documentation to mitigate the cost.
- It cannot do restore of Deep Archive data
Edit: Can do restore, but it's a manual step.
The upload fee (PUT request fee) is $0.065/1000files so it will charge you a lot when you have millions of files.
So if hot access isn't a concern then S3 can be 1/5th of the cost.
They prices might be higher next year.
I have some open tickets asking about (script based) restoring. I haven't tried this yet as this has been a backup of last resort for me, but hopefully posting this again will nudge me into looking at that.
https://github.com/agurk/zfs-to-aws/
What about the well-known rclone? https://rclone.org/s3/
Synology has offered Amazon Glacier and S3 as a destination option with Hyper Backup for years as part of their NAS offerings. Given the available automatic archive feature to move an existing store to Glacier Deep Archive, budget permitting I'd recommend a NAS over this for three reasons:
- Initial setup costs aside, the power draw of a two bay unit like the DS218 (15W at load) would be ~$16/year at peak usage assuming a cost of $0.12/W
- Uploading/syncing your local files to your NAS should be considerably faster, technically 'free', and can be done more frequently as you desire; should you need them, it would also be 'free' to retrieve them locally barring a catastrophic event
- The remote push of the NAS contents to S3/Glacier storage can be done asynchronously of your PC's state (and, to save money, less frequent if you wish), which as you point out could take days; additionally, you can save money given you can reduce the number of requests via automatic archiving/compression
Given how unlikely it is for you to retrieve data from Glacier Deep Archive with such a setup, I highly recommend it. You can still rest knowing your data is offsite.
Or you could just blindly trust that it'll work. Kind of like schrödingers backup
There are a myriad of easy-to-miss failure scenarios that don't appear in small-scale tests. Only way to ensure you can restore your backups, is to restore your backups
This should fall in the free tier in most cases, since the script creates archives of the specified size. The free tier has a few thousand requests for free.
For the record, QNAP does too, I've got an automated job that backs up any new files it sees every Sunday morning.
I built something similar a while back that I've been using for years now.
Something worth noting. There is a minimum cost to files. If you have tons of tiny kb sized files (incremental snapshots..) it's drastically cheaper to fallback to s3 for them.
Note that there is also a minimum filesize of 128KB per object in Glacier as well as 32KB extra metadata, and everything smaller will also be counted as the minimum size. Some mitigate this by bundling files in larger chunks, at the cost of retrievability and now having to keep an map of file-bundle associations.