Topic 3 · Hardware
Primary storage, secondary storage, and the cloud
RAM and ROM, magnetic, optical, and solid-state storage, virtual memory, and cloud storage.
Primary storage
Primary storage is directly accessed by the CPU. It holds the data and instructions currently in use.
| RAM | ROM | |
|---|---|---|
| Full name | Random access memory | Read only memory |
| Volatile? | Yes: contents lost when power is off | No: contents kept without power |
| Can be changed? | Read and write | Read only |
| Holds | Programs and data currently in use, including parts of the OS | The start-up instructions (bootstrap / BIOS) |
Key idea. Volatile means the data disappears when the power is switched off.
Secondary storage
Secondary storage is non-volatile and keeps files permanently. It is not directly accessed by the CPU: data has to be loaded into RAM first. There are three technologies:
| Type | How it works | Examples | Strengths | Weaknesses |
|---|---|---|---|---|
| Magnetic | Platters spin; a read/write head magnetises tiny areas to store 1s and 0s | Hard disk drive (HDD) | Large capacity, low cost per GB | Moving parts, slower, can be damaged if dropped |
| Optical | A laser reads pits and lands burned onto the disc surface | CD, DVD, Blu-ray | Cheap, portable | Small capacity, slow, easily scratched |
| Solid-state | Transistors (NAND flash) trap electrons to store data; no moving parts | SSD, USB stick, SD card | Very fast, robust, silent, low power | Higher cost per GB, limited number of writes |
Virtual memory
When RAM is full, the operating system can use part of secondary storage as virtual memory. Data that is not needed right now is moved out of RAM to make room, and swapped back in when it is needed.
This stops the computer crashing when RAM runs out, but secondary storage is much slower than RAM, so if a lot of swapping happens the computer slows down badly (disk thrashing).
- 1RAM is fullA program needs more memory.
- 2Move outData not in use is moved from RAM to virtual memory on the disk.
- 3Load inThe needed data takes its place in RAM.
- 4Swap backWhen the moved data is needed again, it is swapped back into RAM.
Cloud storage
Cloud storage keeps your files on remote servers owned by a provider and accessed over the internet. The data is actually stored on many physical servers, often copied in several places.
- Benefits: access files from any device with internet; easy to share; the provider handles backups and security; pay for only the space you need.
- Drawbacks: no internet means no access; you rely on the provider's security; ongoing subscription costs; uploads and downloads use bandwidth.
Key terms
- Primary storage
- Storage directly accessed by the CPU: RAM and ROM.
- Secondary storage
- Non-volatile storage for keeping files permanently.
- Volatile
- Loses its contents when the power is turned off.
- Virtual memory
- Secondary storage used as an extension of RAM when RAM is full.
- Cloud storage
- Storing data on remote servers accessed over the internet.
Check yourself
Why is the start-up program stored in ROM instead of RAM?Show answer
ROM is non-volatile, so the instructions are still there when the computer is switched on, and they cannot be accidentally changed.
Give two reasons a laptop might use an SSD instead of an HDD.Show answer
SSDs have no moving parts so they are more robust if dropped; they are faster, lighter, quieter, and use less power.
Why can heavy use of virtual memory make a computer slow?Show answer
Secondary storage is much slower than RAM, so swapping data back and forth takes time.