Ask HN: How do you backup your database?
The database is at the core of our business.
But there has to be a better way to create automatic backups.
The way I currently do it is with cronjobs and scripts that move the transaction logs to another cloud provider (every xx minutes) and do a full backup every night.
Is this really the way to do this?
[+] [-] buildint|3 years ago|reply
How many transactions are you doing on the DB? What's writing to it?
How big is the DB? https://mariadb.org/cyber-protection-best-practices/
[+] [-] yawgmoth|3 years ago|reply
A common pattern with Postgres databases is to replicate the WAL to a read replica. If the primary goes down you promote the replica to master. I have to imagine there is a similar recipe for MariaDB.
[+] [-] janxgeist|3 years ago|reply
[+] [-] brudgers|3 years ago|reply
If the way you are doing it works, there isn't a better way.
So to me, the place to start is to make sure what you are doing is working (if you haven't).
I mean having one copy on another cloud provider isn't very deep.
As in only one cancelled credit card from failure (or maybe two).
Or two compromised credentials, at best.
Backing up either sucks or it isn't really backing up. It is not a good place to look for efficiency, because not backing up is always going to be easier than what you are doing.
Good luck.
[+] [-] janxgeist|3 years ago|reply
If I want to check if everything works, I have to check several places. My own documentation of this backup process is several pages long.
Considering how many people need to backup databases on linux, I was hoping there'd be a better, simpler practice.
[+] [-] vxxzy|3 years ago|reply