Disaster Recovery Protocols for Nordic Enterprises: Beyond tar -czvf
It is February 2019. The dust has barely settled from the GDPR enforcement panic of last May, and yet, I still walk into boardrooms in Oslo where the "Disaster Recovery Plan" is a sticky note that says "Call Stian." If you are running mission-critical workloads—whether it's a Magento shop or a fintech API—hope is not a strategy. Hardware fails. Kernel panics happen. And human error? That’s the only constant in system administration.
I recently audited a setup for a client hosting on a generic budget provider. They had backups. Great. But when we simulated a drive failure, the restoration took 14 hours because they were pulling 500GB over a saturated 100Mbps link to a spinning rust HDD. In the e-commerce world, 14 hours of downtime isn't an inconvenience; it's a bankruptcy filing.
This is a technical deep dive into architecting resilience. We aren't talking about "cloud magic." We are talking about raw replication, consistency flags, and why the underlying hardware of your VPS provider—specifically NVMe storage—dictates your Recovery Time Objective (RTO).
The RTO/RPO Reality Check
Before we touch a single config file, define these two metrics. If you can't answer them, you are flying blind.
- RPO (Recovery Point Objective): How much data can you afford to lose? One hour? One second? Zero?
- RTO (Recovery Time Objective): How fast must the service be back online?
If your boss says "Zero data loss and instant recovery," ask for a budget that rivals Equinor's IT department. For the rest of us, we need pragmatism. Achieving an RPO of under 5 minutes requires aggressive database replication, not just nightly dumps.
Database Consistency: The Silent Killer
Most admins script a cron job running mysqldump and call it a day. In a high-concurrency environment (like a busy WooCommerce site during a flash sale), a standard dump lock tables. Your site hangs. You lose customers.
Here is how you do it correctly in 2019 using Percona XtraBackup or a properly flagged `mysqldump` for InnoDB engines without locking the world.
The "Cheap" but Safe Method (MySQL 5.7/8.0)
#!/bin/bash
# Safe backup script for CoolVDS NVMe Instances
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/mnt/backups/mysql"
MYSQL_USER="root"
MYSQL_PASS="SuperSecretPass"
# Ensure the directory exists
mkdir -p $BACKUP_DIR
# --single-transaction: crucial for InnoDB to avoid locking tables
# --quick: retrieves rows one by one instead of buffering the whole set
mysqldump -u$MYSQL_USER -p$MYSQL_PASS \
--all-databases \
--single-transaction \
--quick \
--routines \
--triggers \
| gzip > "$BACKUP_DIR/full_backup_$TIMESTAMP.sql.gz"
# Verification (Trust but Verify)
if [ -s "$BACKUP_DIR/full_backup_$TIMESTAMP.sql.gz" ]; then
echo "Backup Success: $TIMESTAMP"
else
echo "Backup FAILED" | mail -s "ALERT: MySQL Backup Failed" admin@coolvds.com
fi
Note the --single-transaction flag. Without this, you are blocking writes. With it, you get a consistent snapshot without stopping commerce.
The Infrastructure Layer: Why NVMe and KVM Matter
Recovery is an I/O bound operation. This is where the choice of hosting provider stops being about marketing and starts being about physics. When you need to restore 200GB of data, the difference between a SATA SSD (approx 500 MB/s) and an NVMe drive (approx 3000 MB/s) is massive.
At CoolVDS, we standardized on NVMe for this exact reason. In a disaster scenario, I have seen restoration times drop from 4 hours to 45 minutes simply by moving the target infrastructure to NVMe-based KVM instances. Furthermore, using KVM (Kernel-based Virtual Machine) ensures that your resources are isolated. Unlike OpenVZ, where a "noisy neighbor" can steal your CPU cycles during a restore operation, KVM guarantees the compute power you pay for is available when you need to uncompress those massive .tar.gz files.
Offsite Replication with Rsync and SSH
Keeping backups on the same server is suicide. Keeping them in the same datacenter is risky (fires happen). You need to ship data out. Since we are operating in Norway, data sovereignty matters. You want your secondary location to be GDPR compliant, ideally another Norwegian facility or a trusted European partner.
Here is a robust rsync implementation that uses SSH keys for secure transport. This works on virtually every Linux distro available today, from CentOS 7 to Ubuntu 18.04 LTS.
# generate keys if you haven't already
# ssh-keygen -t rsa -b 4096
# The synchronization command
# -a: archive mode (preserves permissions, times, etc)
# -v: verbose
# -z: compress during transport (save bandwidth)
# --delete: remove files on destination that no longer exist on source
rsync -avz --delete \
-e "ssh -i /home/admin/.ssh/id_rsa_backup -p 2222" \
/var/www/html/ \
backup_user@offsite-storage.example.no:/home/backup_user/snapshots/
Pro Tip: Always run rsync inside a `screen` or `tmux` session if doing it manually. There is nothing worse than a dropped SSH connection killing a 300GB transfer at 99%.
High Availability with HAProxy and Keepalived
Backups are for when things die. High Availability (HA) is for ensuring nobody notices they died. In 2019, setting up a Floating IP with Keepalived is the gold standard for bare-metal and VPS environments.
You setup two CoolVDS instances. One is Master, one is Backup. They share a virtual IP. If Master drops, Backup takes the IP.
Config: /etc/keepalived/keepalived.conf
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance VI_1 {
interface eth0
state MASTER
virtual_router_id 51
priority 101
virtual_ipaddress {
10.0.0.100
}
track_script {
chk_haproxy
}
}
On the backup server, change state to BACKUP and priority to 100. This simple text file configures a heartbeat that checks if your load balancer is alive. If the heartbeat stops, the IP moves instantly.
GDPR and The "Datatilsynet" Factor
We cannot ignore the legal landscape. The Norwegian Data Protection Authority (Datatilsynet) is not toothless. If you lose customer data because your backup was corrupted or hosted in a non-compliant jurisdiction, the fines are real.
When you deploy on CoolVDS, you are leveraging infrastructure physically located in Norway (or strict EU zones). This simplifies your Article 32 compliance (Security of processing). But remember: a provider gives you the tools; you must build the house. Encrypt your backups at rest. Use tools like GPG or verify that your backup software supports AES-256 encryption.
Final Thoughts: Test or Fail
A backup that hasn't been restored is not a backup; it's a hope. Schedule a "Fire Drill" this Friday. Spin up a fresh KVM instance on CoolVDS (it takes less than 60 seconds), and try to restore your service from your offsite backups. Time it. Note the errors. Fix the documentation.
Don't wait for the hardware to fail to find out your restore script has a syntax error.
Need a sandbox for your Disaster Recovery drills? Deploy a high-performance NVMe VPS with CoolVDS today and see what legitimate I/O speed feels like.