skilltheamps@feddit.org 1 day ago
You need to ask yourself what properties you want in your storage, then you can judge which solution fits. For me it is:
- effortless rollback (i.e. in case something with a db updates, does a db migration and fails)
- effortless backups, that preserve database integrity without slow/cumbersome/downtime-inducing crutches like sql dump
- a scheme that works the same way for every service I host, no tailored solutions for individual services/containers
- low maintenance
The amount of data I’m handling fits on larger harddrives (so I don’t need pools), but I don’t want to waste storage space. And my homeserver is not my learn and break stuff environment anymore, but rather just needs to work.
I went with btrfs raid 1, every service is in its own subvolume. The containers are precisely referenced by their digest-hashes, which gets snapshotted together with all persistent data. So every snapshot holds exactly the amount of data that is required to do a seamless rollback. Snapper maintains a timeline of snapshots for every service. Updating is semi-automated where it does snapshot -> update digest hash from container tags -> pull new images -> restart service. Nightly offsite backups happen with btrbk, which mirrors snapshots in an incremental fashion on another offsite server with btrfs.