3 ms·
> You can't use rsync, rsnapshot, or any other tool that manipulates files and/or filesystems, to get a consistent backup of most databases. Sure you can and i
by koolba 10y ago
> You can't use rsync, rsnapshot, or any other tool that manipulates files and/or filesystems, to get a consistent backup of most databases.
Sure you can and if you can't, then get a better database!
A well functioning database should be able to deal with being inconsistently shutdown. If you can't take a snapshot of the disk then what's the difference between that and the power cord being pulled?
The main reason not to do this on a DB server is that the recovery time may large. That doesn't mean it can't be done though.
> Databases come with their own tools and/or commands for creating a consistent "dump". Nothing else is guaranteed to be safe.
Sure they do and you should use those as well, that doesn't mean you can't do this too.
- cyphar 10y agoThe issue is not that you have an atomic copy of the state at a certain point in time, which in a bad database couldn't be loaded. The problem is that when you make a full copy of a file you are copying linearly and if it's a big file a chunk could change while you're reading it (or multiple related chunks which you are in the middle of copying) -- then you have a very inconsistent state which a database can't recover from no matter if their updates are atomically written. The database could do some magic with unlinking, but that would cause massive performance problems.