Chapter 3

Storage & RAID

SSD/HDD, RAID 1/5/10, backups vs redundancy.

Learning objectives

  • Compare SSD, HDD, and NVMe for server roles
  • Explain RAID 1, 5, and 10 trade-offs
  • Distinguish redundancy from backups

Storage types

MediaStrengthTypical use
NVMe SSDLow latency, high IOPSOS, MySQL, hot uploads
SATA SSDGood speed, lower costSecondary apps, cache
HDDCheap capacityBackup target, archives

Workshop Co.’s booking DB and PHP code belong on NVMe. Nightly backup dumps can land on separate storage — object storage or a backup server — not the same RAID set without off-site copy.

RAID levels

LevelMin disksFault toleranceNotes
RAID 121 disk failureMirror — simple, 50% capacity
RAID 531 disk failureParity — good read, rebuild stress
RAID 1041 disk per mirror set*Mirror + stripe — performance + redundancy
RAID is not backup

RAID protects against disk failure, not ransomware, accidental deletion, or fire. Workshop Co. still needs off-site backups (3-2-1 rule: three copies, two media, one off-site).

Worked example — Workshop Co. layout

Swift Host provisions:

  • RAID 1 — 2× 960 GB NVMe for OS + MySQL (~960 GB usable)
  • Separate backup: nightly mysqldump + rsync uploads to Swift Host backup storage in another Canadian region
# Example backup cron (conceptual)
0 3 * * * mysqldump workshopco | gzip > /backup/db-$(date +\%F).sql.gz
0 4 * * * rsync -a /var/www/workshopco/ backup@backup.swifthost.ca:workshopco/
Rebuild time

When a disk fails in RAID 5, rebuild can take hours and stress remaining disks. Monitor SMART, hot-spare if offered, and replace failed drives promptly.

Try it yourself — capacity math

Four 960 GB drives in RAID 10. What is usable capacity?

Answer

RAID 10 mirrors pairs then stripes: 2×960 = 1920 GB usable (approximately 1.92 TB).

Spot the mistake

Admin deletes a production database table. RAID 1 is healthy. Can they restore from RAID?

Answer

No — deletion replicates to the mirror instantly. Restore from backup (point-in-time dump or binlog if configured).

Quick quiz

  1. Which RAID level mirrors disks?
  2. Why put MySQL on NVMe?
  3. What is the 3-2-1 backup rule?
Answers
  1. RAID 1 (and mirrors inside RAID 10).
  2. Random read/write performance for database pages and logs.
  3. 3 copies of data, 2 different media types, 1 off-site.