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
| Media | Strength | Typical use |
|---|---|---|
| NVMe SSD | Low latency, high IOPS | OS, MySQL, hot uploads |
| SATA SSD | Good speed, lower cost | Secondary apps, cache |
| HDD | Cheap capacity | Backup 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
| Level | Min disks | Fault tolerance | Notes |
|---|---|---|---|
| RAID 1 | 2 | 1 disk failure | Mirror — simple, 50% capacity |
| RAID 5 | 3 | 1 disk failure | Parity — good read, rebuild stress |
| RAID 10 | 4 | 1 disk per mirror set* | Mirror + stripe — performance + redundancy |
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+rsyncuploads 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/
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
- Which RAID level mirrors disks?
- Why put MySQL on NVMe?
- What is the 3-2-1 backup rule?
Answers
- RAID 1 (and mirrors inside RAID 10).
- Random read/write performance for database pages and logs.
- 3 copies of data, 2 different media types, 1 off-site.