News for hackers. Stuff that matters.
Re:"Hetzner has decided to cancel our account and terminate ... by diggan on Monday December 09, 2024 @07:08AM (#42365438)
Another great question is "When did you last try to restore from a backup?" which usually is answered with "It's the built-in tooling, why would we assume it's broken?" or similar. Then fast-forward some months/years, and they try to restore from backups only to realize the backups never actually backed up what they cared about.
Re:"Hetzner has decided to cancel our account and terminate ... by KingOfCoders on Monday December 09, 2024 @08:47AM (#42366243)
Agreed, if you haven't tested your backups recently (daily, automatic best), you don't have backups. Several of my clients (CTO Coaching) had problems in the past because they restored backups and where finding they were not complete (for various reasons).
Re:"Hetzner has decided to cancel our account and terminate ... by w8whut on Monday December 09, 2024 @10:35AM (#42367152)
daily test restore is infeasible for anything but toy projects. You should periodically test your restore procedures, but its incredibly costly and time consuming for sizeable platforms. Its just not that easy to restore a 10+TB backup for example, and thats a _tiny_ backup size for a b2c product.

they can easily go into the hundreds of TB, depending on your platform.

and i might add: i vividly remember gitlabs article how they have had automated backups and test restores for years, but when they actually needed them... it turned out some data wasn't part of it after all. just because youre testing your restore procedure doesnt mean you've actually accomplished anything.

Re:"Hetzner has decided to cancel our account and terminate ... by rodgerd on Monday December 09, 2024 @03:37PM (#42370316)
> but its incredibly costly and time consuming for sizeable platforms.

If your restores are too time consuming to test regularly, they sure as shit aren't going to be useful in a disaster.

Re:"Hetzner has decided to cancel our account and terminate ... by usrnm on Monday December 09, 2024 @04:37PM (#42370785)
Why is that? Hours or even days of downtime are still better than just losing all data. It's a simple cost-benefit analysis, and it's ok to pick different trade-offs depending on your use case
Re:"Hetzner has decided to cancel our account and terminate ... by rodgerd on Monday December 09, 2024 @05:19PM (#42371184)
I have spent most of my career in newspaper publishing and banking.

A newspaper that doesn't publish for a few days might recover. A bank that drops off the Swift network for days isn't a bank any more.

Re:"Hetzner has decided to cancel our account and terminate ... by cyberax on Monday December 09, 2024 @06:19PM (#42371686)
Russia and Iran would like to have a few words with you.

Banks regularly close for multiple days for bank holidays. Unscheduled downtime is a somewhat different story, though.

Luckily, the traditional SWIFT/banking infrastructure is so negligible these days, my phone can host a classic banking infrastructure for an entire small country.

Re:"Hetzner has decided to cancel our account and terminate ... by com on Tuesday December 10, 2024 @04:30AM (#42375236)
This is a nonsense response.

A bank exists not as an isolated entitity, but as a node in a local, regional and global network of transactions.

Your phone as a “classic banking infrastructure” (nonsense phrase) can’t do credit card acquiring or realtime transactions because it’s not connected to the payment rails, transaction switches and so on (like SWIFT but all of the other less global ones run by central banks and private entities).

In developed societies, instant settlement for bank-bank transfers is the norm, and cash flow is dependent on that.

Russia and Iran pay about 2-5% for above-board (non-sanctioned) cross border transactions due to their extra costs of not being in SWIFT and USD sanctions, and between 20-50% where physical middle-people are needed to move pallets of USD.

Re:"Hetzner has decided to cancel our account and terminate ... by rodgerd on Tuesday December 10, 2024 @03:01PM (#42380819)
This is absolutely peak "confidently incorrect"; it's hilarious, but completely expected on this site.
Re:"Hetzner has decided to cancel our account and terminate ... by prmoustache on Tuesday December 10, 2024 @02:33AM (#42374671)
It depends on the accepted downtime.
Re:"Hetzner has decided to cancel our account and terminate ... by KingOfCoders on Tuesday December 10, 2024 @07:35AM (#42376263)
Have two backups, the most recent data and everything else. Archive data to different databases, e.g. only have the most recent 6 months in a production OLTP database.

"daily test restore is infeasible for anything but toy projects. "

It probably depends on what you call "toy" project. If you work for Google, yes I think everything is a toy project, and you're right. I only worked for ~$200M ARR/1M DAU businesses and restoring was no problem. From your point working for a FAANG business it's a toy project I can see that. But there are many more "toy projects" of this kind than FAANG companies.

"10+TB backup for example, and thats a _tiny_ backup size for a b2c product."

Sure.

Re:"Hetzner has decided to cancel our account and terminate ... by amyames on Monday December 09, 2024 @09:15AM (#42366426)
aws-cli will sync your s3 buckets to a local system.

I’m doing that to linux, and then the Linux box is furthermore backed up with nakivo.

Not my favorite but the price was okay and I can run the whole director on Linux, unlike all their other competitors. [veeam’s next major release 13 or 14 should do this in the next year or so too.]

While nakivo backs up s3 buckets, NFS shares, and local file servers… to your point, I don’t trust it (or any other backup software I can’t extract and unpack the resulting backup by hand) as far as I can throw it. So I rsync or mirror it to a local Linux box with aws-cli and then back THAT up.

I think you can do all this with windows stuff too but I don’t know it that well

Additionally you can take servers that are linux vps’es and do the reverse: mirror THEIR content to an s3 bucket.

You can also run minio open source/free on your fileserver and set up s3 to s3 sync. Cloudflare for example will ingest and replicate your minio server automatically and you can firewall it all off to their address ranges. It’s not free but it actually prices out favorably compared to veeam and nakivo if that’s all you need backed up.

Re:"Hetzner has decided to cancel our account and terminate ... by ambicapter on Monday December 09, 2024 @02:16PM (#42369444)
One thing I've never figured out is, what is the difference between backups and replication? And, does restoring from backups always mean losing more _recent_ data than replication?
Re:"Hetzner has decided to cancel our account and terminate ... by travisby on Monday December 09, 2024 @02:30PM (#42369589)
For hardware failure, replication is the bees knees and indeed means you'll lose less (no? depending on your replication settings) data.

But, backups will help if you replicated _bad data_, or more accurately _data changes_.

You can restore from backup if you accidentally ran `DELETE FROM foo;`, where replication will not help!

(Insert cryptolocker type viruses, bugs, human query mistakes, etc).

Re:"Hetzner has decided to cancel our account and terminate ... by sidewndr46 on Monday December 09, 2024 @02:40PM (#42369696)
I imagine in that scenario the engineering team can develop inter-dimensional travel, then travel to a universe in which that command was never executed. They bring the data back and restore the database.
Re:"Hetzner has decided to cancel our account and terminate ... by dorgo on Monday December 09, 2024 @03:21PM (#42370144)
I managed to delete all records in a table a week ago ( I blame copilot ). Used time travel ( not quite inter-dimensional travel ) in bigquery to restore. INSERT INTO ... SELECT * FROM ... FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR)
Re:"Hetzner has decided to cancel our account and terminate ... by justusthane on Monday December 09, 2024 @02:26PM (#42369551)
Replication isn't a backup, because if you accidentally delete a file, and that deletion is immediately replicated, then you can't get that file back.

Backups are a specific point in time.

Re:"Hetzner has decided to cancel our account and terminate ... by mavhc on Monday December 09, 2024 @02:54PM (#42369853)
Backup is a useless word, it's too overloaded

Are snapshots backups? snapshots on raid? snapshots on replicated disks?

Re:"Hetzner has decided to cancel our account and terminate ... by ianburrell on Monday December 09, 2024 @04:20PM (#42370642)
Backup describes what they are for. There are many ways to do backups. The main thing is that backups are archive stored away from danger. There are different kinds of danger and different need for protection.

Snapshots can be backups depending on where they are stored usually not if stored locally. For example, RDS snapshot is backup for database going down but not account being deleted or region destroyed. Generally, snapshots are way to make backups to more durable medium.

Re:"Hetzner has decided to cancel our account and terminate ... by andrewaylett on Monday December 09, 2024 @04:23PM (#42370664)
A backup is something that will functionally replace the original should the original fail, regardless of how the original failed. For data, this means that the restore process is part of the backup.

Snapshots are not backups. Snapshots on RAID are not backups. Snapshots on replicated disks are probably backups, so long as the disks being replicated to are not inside the same case/building/city/continent (pick your risk suitably) and you're not able to delete the snapshots from the machine hosting the originals.

The second SIM in my phone provides a backup for my primary service provider, so long as I keep it activated. The torch in my pocket is a backup for the lighting in my house, so long as I keep it charged. My data in tarsnap is a backup, so long as I'm able to restore it. Which means data in tarsnap isn't a complete backup on its own: unless I'm able to recover the encryption key, I don't actually have a backup.

Re:"Hetzner has decided to cancel our account and terminate ... by mavhc on Tuesday December 10, 2024 @06:21AM (#42375827)
Indeed, so if it's on the same continent/building/room is it a backup? depends why you need to restore it. You can't tell whether something is a backup until it's restored, it's Schrodinger's backup.

A snapshot is a backup if a user deletes/edits their file and wants the old version. Raid is a backup if you're recovering from 1 disk failing

Re:"Hetzner has decided to cancel our account and terminate ... by kelnos on Monday December 09, 2024 @02:28PM (#42369570)
One problem with replication is if the disaster is that all the data has been deleted, that deleted state will get propagated to the replica, so you will still have no data.

But yes, if the problem is simply that the main setup is down, replication will often give you a more (or even completely) up-to-date copy than a daily backup will.

Re:"Hetzner has decided to cancel our account and terminate ... by rolph on Monday December 09, 2024 @02:23PM (#42369516)
replication is a snapshot of everything, at the time of file access.

backup is a replacement of specified files required by a system recovery procedure. it may be a total image, or a collection of config, and dat files, that are daily bootup settings,

Re:"Hetzner has decided to cancel our account and terminate ... by bzzzt on Tuesday December 10, 2024 @03:51AM (#42375072)
Depends on the thing you're replicating and the technology you use. If you're replicating a database you get a bunch of 'log' files containing all the changes in chronological order. While you could throw those away after filling a single replica database you also can keep them and use them to recover a database snapshot from a while ago. You're not going to get data that recent with only full backups.
Re:"Hetzner has decided to cancel our account and terminate ... by tetha on Tuesday December 10, 2024 @02:57PM (#42380743)
A simple way to remember, I think by Devops Borat: Redundancy/Replication fix hardware problems. Backups fix stupid human problems.

> And, does restoring from backups always mean losing more _recent_ data than replication?

This depends on the archiving technology and what you're archiving.

Our file and object stores take one full backup every day. This means, we could lose up to 24 hours of data changes on these stores if something happens within these 24 hours. If this is acceptable or not depends on the RPO - the recovery point objective, or the "maximum acceptable data loss". However, especially for documents, 24 hours can be acceptable, because users and customers do tend to have files they uploaded to the system around for a few days. Especially if you have a chance to identify the lost documents.

Both on MySQL with the InnoDB driver, as well as on postgres, you can use PITR backup solutions - point in time recovery. With this, pgbackrest or e.g. xtrabackup store a full backup of the database usually once a day at our place, and then keep archiving the WAL / transaction logs of the system. And we, in turn, archive snapshots of these into the longterm archiving once a day.

If we need a restore, we'd first restore a pgbackrest or xtrabackup state from the long term archiving onto a system. And then we can use the PITR recovery mechanisms to restore at a specific point in time.

Technically, we could precisely recover down to the last transaction before the disastrous transaction to minimize data loss. In fact, I've done so one or two times after some database migrations went haywire. That involved scrolling through transaction logs with a viewer to identify when the migration tool starts running, noting down the transaction ID of the transaction tool starting it's check and then restoring to the transaction before. Very cool tbh.

This is important for an RDBMS, because the data in the relational database tends to be much more volatile than the data in a file or object store. With a filestore, users upload a file and then move it to their recycling bin or their "done" folder on the local system and can easily drag it back out tomorrow. With the database, the user spent 30 minutes to an hour writing up some text or a comment and expects it to be saved and sound once they hit "Reply". Losing this kinda data creates a lot more work & effort for our customers, because then they have to figure out what state the data is in and what to redo. This may also cause their business processes to run haywire and... it's not great.

Re:"Hetzner has decided to cancel our account and terminate ... by sidewndr46 on Monday December 09, 2024 @02:38PM (#42369678)
my dad told me about this customer that had a server that made automatic backups each Sunday night. The backup script would backup all the data then eject the tape so the manager could put it in the vault and rotate in the other one from the vault.

When the hard drive failed, they restored the customer to the latest backup. Which was the tape still sitting in the tape drive in the server. It was from the first Sunday night after the system was installed years ago

Re:"Hetzner has decided to cancel our account and terminate ... by Terr_ on Monday December 09, 2024 @03:41PM (#42370348)
I'm confused, it sounds like you're saying the same tape was being ejected every week and then reinserted without any rotation. But in that case, shouldn't the weekly backup process have failed because the tape was full? Was nobody getting those alerts?

Or do you mean the backup process was fine, but they restored from the wrong media, a very old tape that was about to be overwritten, instead of retrieving the one with last-week's copy?

Re:"Hetzner has decided to cancel our account and terminate ... by ender341341 on Monday December 09, 2024 @03:50PM (#42370428)
I read it as they were saying the manual part of the process never happened, so the backup from the first week was just sitting ejected forever and they had no alarming to notify them that the new backup failed to write to tape.
Re:"Hetzner has decided to cancel our account and terminate ... by sidewndr46 on Monday December 09, 2024 @03:50PM (#42370430)
no, the first Sunday night after the backup process completed. It ejected the tape. It sat there for years until someone realized they needed to restore from the most recent backup. Since a new tape was never inserted, the backup was from years ago.
Re:"Hetzner has decided to cancel our account and terminate ... by cutemonster on Monday December 09, 2024 @10:01PM (#42373287)
What happened afterwards? Was that manager still at the company, at that time?
Re:"Hetzner has decided to cancel our account and terminate ... by remram on Monday December 09, 2024 @02:50PM (#42369817)
This famously happened at GitLab: https://about.gitlab.com/blog/2017/02/01/gitlab-dot-com-data...

> Regular backups seem to also only be taken once per 24 hours, though team-member-1 has not yet been able to figure out where they are stored. According to team-member-2 these don’t appear to be working, producing files only a few bytes in size.

Re:"Hetzner has decided to cancel our account and terminate ... by dawnerd on Monday December 09, 2024 @02:55PM (#42369875)
In addition to making sure it works, you should make sure you know how to deal with restoring. Sure running a command is easy but what about spinning up new infra? What if it’s corrupted? What if the one person that knows the setup is gone or asleep? Mainly a problem for smaller teams that don’t have the redundancy or resources - they really need to make sure there’s at least docs on how stuff was setup. Reminds me I need to do my yearly checkup too.
Re:"Hetzner has decided to cancel our account and terminate ... by bazzargh on Monday December 09, 2024 @02:57PM (#42369891)
A fun one like that, a few years back we had some code using dynamodb that used the automatic point-in-time backups. I asked if it had been tested, need you guess the reply?

Of course it turns out that the restore can only happen to a _new database name_ not the original, and the code had in multiple places hardcoded the assumption of what the db was called.

So restoring also involved patching the code and rolling that out; you can't "roll back" because to roll back the db the code must roll forward.

Re:"Hetzner has decided to cancel our account and terminate ... by banku_brougham on Monday December 09, 2024 @10:39PM (#42373485)
'Roll-middle-out'
Re:"Hetzner has decided to cancel our account and terminate ... by jamesfinlayson on Tuesday December 10, 2024 @12:57AM (#42374183)
Ugh, very annoying limitation. I've written scripts to create dummy tables, restore backups and sync across to existing tables twice now.
Re:"Hetzner has decided to cancel our account and terminate ... by kstrauser on Monday December 09, 2024 @03:32PM (#42370268)
We've avoided that in various shops by making backups/restores part of regular maintenance processes. How do we upgrade the database? By stopping it, backing it up, restoring that to the new server, pointing all code at the new DB, then turning off the old server.

As with code deployment, it's not so scary when it's something you do so frequently that it's just a little script you run.

Re:"Hetzner has decided to cancel our account and terminate ... by diggan on Tuesday December 10, 2024 @09:42AM (#42377248)
> it's not so scary when it's something you do so frequently

Yeah, I've found this to be the trick for ongoing hassle-free maintenance too. Make tearing stuff down and up frequent enough and you'll feel confident and safe when you're required to do so to recover from something.

Scariest are applications/services/servers that has been running for years but never restarted nor ever restored. Those scare me.

Re:"Hetzner has decided to cancel our account and terminate ... by kstrauser on Tuesday December 10, 2024 @11:19AM (#42378265)
Cattle, not kittens. My favorite thing about deploying containerized apps? They’re completely fungible and I never have to care about an individual instance. Oh, it hung due to some weird network interaction? Spawn a new one, then come back to see what went wrong with this one before you kill it.
Re:"Hetzner has decided to cancel our account and terminate ... by belter on Monday December 09, 2024 @05:12PM (#42371123)
"Amateurs backup. Professionals restore."
Re:"Hetzner has decided to cancel our account and terminate ... by auspex on Monday December 09, 2024 @11:17PM (#42373691)
You have to test restoration as part of SOC 2, so most companies with real customers do it at least once a year.