Zero-Loss Backup Architecture: 3-2-1-1-0 Strategy, Restic/Borg Deduplication & Restore Drills
Remember: RAID and cloud folder sync are NOT backups. Protect servers and workstations against ransomware and drive failure using the 3-2-1-1-0 rule, client-side AES-encrypted Restic snapshots, immutable Object Lock buckets, and monthly restore drills.
1. The Modern 3-2-1-1-0 Rule (Why RAID & iCloud/OneDrive Are Not Backups)
rm -rf, buggy migration, or ransomware encrypts both mirrored drives instantaneously. Two-way cloud folder sync propagates deletions across every laptop within seconds. Resilient recovery requires 3 total copies, 2 distinct media types, 1 offsite region, 1 immutable/air-gapped copy (append-only S3 Object Lock), and 0 unverified restore errors.| Rule Digit | Architectural Requirement | Threat Mitigated | Copy |
|---|---|---|---|
| 3 Copies | Production data + local snapshot + remote repo | Single storage outage | |
| 2 Media | e.g. Local NVMe ZFS/Btrfs + Cloud S3/B2 | Controller firmware or SSD batch bug | |
| 1 Offsite | Separate physical building / cloud region | Fire, flood, theft, DC outage | |
| 1 Immutable | Append-only / Object Lock (no delete permission) | Ransomware or attacker with root keys | |
| 0 Errors | Automated restore test passes checksum check | Silent repository corruption |
2. Zero-Knowledge Incremental Snapshots With Restic & Backblaze/S3
restic and borgbackup slice files with Content-Defined Chunking (Rabin fingerprints), encrypt every block locally with AES-256/Poly1305 before packets ever leave your machine, and upload only changed blocks.export RESTIC_REPOSITORY="s3:s3.eu-central-003.backblazeb2.com/my-encrypted-backups"
export RESTIC_PASSWORD_FILE="/root/.restic-pass"
restic init
restic backup /srv/app /etc --exclude-caches
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --pruneEncryption keys remain strictly local so cloud storage breaches reveal zero readable files.
3. Never Tar Live Database Files: Consistent SQL Dumps Before Snapshot
/var/lib/postgresql files mid-write produces torn pages and broken WAL replay unless filesystem freeze hooks coordinate checkpoints. Always stream consistent point-in-time dumps via pg_dump or sqlite3 db.sqlite ".backup safe.sqlite" directly into stdin/staging before archiving.pg_dump -Fc -U postgres prod_db > /tmp/prod_db.dump && restic backup /tmp/prod_db.dump && shred -u /tmp/prod_db.dump
sqlite3 /srv/data/app.db ".backup /tmp/app-consistent.db"Guarantees transactionally consistent point-in-time recovery without database lock downtime.
4. An Untested Backup Is Schrรถdingerโs Backup: Monthly Restore Drills
Related Free Online Tools
Put these techniques into practice immediately with our privacy-first browser utilities:
Verify local archive SHA-256 and SHA-512 checksums after offline backup exports.
Compute client-side cryptographic fingerprints for manifest verification.
Schedule automated nightly incremental snapshots and weekly repository prune jobs cleanly.
Independent software developer focused on client-side architectures, local-first computing, WebAssembly, and privacy-first web systems.