The storage hierarchy
Fast, small, expensive at the top β slow, large, cheap at the bottom.
Computers use multiple kinds of storage at once because no single technology gives all of: speed, capacity, durability AND low cost.
| Tier | Examples | Speed | Capacity | Volatile? |
|---|---|---|---|---|
| Registers | CPU registers | Fastest | Bytes | Yes |
| Cache | L1, L2, L3 cache | Very fast | KB-MB | Yes |
| Primary | RAM, ROM | Fast | GB | RAM yes; ROM no |
| Secondary | SSD, HDD | Medium-slow | TB | No |
| Off-line | USB, optical, tape | Slow | Varies | No |
| Cloud | Remote servers | Network-bound | Effectively unlimited | No |
The CPU only directly accesses primary memory. To work on a file, it has to be loaded from secondary storage into RAM first.
Cambridge tip. Mark scheme expects the distinction: PRIMARY = directly accessible by CPU (RAM, ROM); SECONDARY = NOT directly accessible β must be loaded into RAM first.
- Trade-offs are universal β there's no perfect medium.
- Primary is CPU-accessible; secondary is not.
- Virtual memory and cache exist to bridge speed gaps.