Skip to main content

Storage: HDD, SSD & NVMe โ€” Overview

Overviewโ€‹

Storage is the persistent tier of the memory hierarchy: unlike RAM, it retains data with the power off. This section covers the two dominant physical technologies (spinning magnetic disks and flash memory) and the interfaces used to talk to them, because the physical mechanism directly explains their performance characteristics โ€” why HDDs are bad at random access, why SSDs wear out, and why NVMe exists.

Core Conceptsโ€‹

TermMeaning
HDD (Hard Disk Drive)Persistent storage using spinning magnetic platters and a moving read/write head.
SSD (Solid-State Drive)Persistent storage using NAND flash memory cells, with no moving parts.
NVMe (Non-Volatile Memory Express)A modern host-controller interface/protocol designed for flash storage attached via PCIe, replacing the older SATA/AHCI stack.
IOPSInput/Output Operations Per Second โ€” the key throughput metric for random-access workloads (databases, VMs).
LatencyTime for a single storage operation to complete โ€” dominates for HDDs (mechanical seek time) far more than for SSDs.

Comparison at a Glanceโ€‹

AspectHDDSATA SSDNVMe SSD
MechanismSpinning platters, moving headNAND flashNAND flash
Random read latency~5-10 ms~50-100 ยตs~10-50 ยตs
InterfaceSATA/SASSATA (AHCI)PCIe (NVMe protocol)
Typical IOPS~100-200~90,000~500,000+
Failure modeMechanical wearFlash cell wear (limited write cycles)Flash cell wear
Cost per GBLowestMediumHighest

In This Sectionโ€‹

  • Hard Disk Drives โ€” platters, heads, seek time, rotational latency, and why RPM matters.
  • SSDs & NAND Flash โ€” cell types, pages/blocks, the flash translation layer, wear leveling, TRIM, and write amplification.
  • NVMe & Storage Interfaces โ€” the PATA โ†’ SATA/AHCI โ†’ NVMe/PCIe evolution, and why M.2 is a connector, not a protocol.
  • Filesystems Basics โ€” inodes vs. FAT-style layouts, journaling, and copy-on-write filesystems.

Why It Mattersโ€‹

  • Memory Hierarchy & RAM: storage sits below RAM in the hierarchy โ€” orders of magnitude slower, which is why OSes and databases cache aggressively in RAM.
  • Buses & I/O: NVMe's performance advantage comes largely from being attached directly over PCIe with a leaner command protocol than legacy SATA/AHCI.
  • Databases: storage-engine design (B-trees vs. LSM-trees) is chosen specifically around the random vs. sequential I/O characteristics described here.