If one kind of memory were fast, huge, cheap and permanent all at once, computers would have exactly one kind. None is. Speed costs money and capacity, and permanence costs speed. So every computer builds a hierarchy: a tiny amount of the fastest memory nearest the CPU, backed by progressively larger and slower layers, each one hiding the slowness of the one below it.
The layers, from the CPU outward
| Layer | Typical size | Typical access time | Volatile? |
|---|---|---|---|
| Registers | A few hundred bytes | < 1 ns | Yes |
| L1 cache | 32–64 KB per core | ~1 ns | Yes |
| L2 cache | 256 KB – 2 MB per core | ~4 ns | Yes |
| L3 cache | 8–64 MB shared | ~15 ns | Yes |
| Main memory (RAM) | 8–64 GB | ~60 ns | Yes |
| SSD | 250 GB – 4 TB | ~50 µs | No |
| Hard disk | 1–20 TB | ~10 ms | No |
RAM and ROM
- Volatile: contents vanish without power
- Read and written freely at full speed
- Holds the OS, running programs and their data
- DRAM needs constant refreshing; SRAM (used for cache) does not
- Non-volatile: keeps contents with no power
- Written rarely, or never after manufacture
- Holds firmware — the UEFI/BIOS that starts the machine
- Modern flash-based ROM can be updated, which is why firmware updates exist
Choosing secondary storage
| HDD | SATA SSD | NVMe SSD | |
|---|---|---|---|
| Sequential read | ~150 MB/s | ~550 MB/s | 3 000–7 000 MB/s |
| Random access | Very slow (head must move) | Fast | Fast |
| Cost per TB | Lowest | Moderate | Higher |
| Shock resistance | Poor — moving parts | Excellent | Excellent |
| Wear limit | Mechanical failure | Finite write cycles | Finite write cycles |
| Best use | Bulk archive, backups | General upgrade | OS and demanding applications |
The headline sequential figures undersell the difference. What makes an SSD feel transformative is random access: a hard drive has to physically move its head and wait for the platter to rotate under it, which takes milliseconds every time. Booting an OS or launching an application means thousands of small scattered reads, and that is where a drive with no moving parts wins by a factor of a hundred, not a factor of four.