RAM vs disk.
RAM is your desk; the disk is the filing cabinet across the room.
A computer has two very different places to keep data, and confusing them causes a lot of mix-ups. RAM (memory) is the desk you work at; the disk (storage) is the filing cabinet.
You spread out on the desk because it is right in front of you, but it is small and clears off when you leave. The cabinet holds far more and keeps it forever, but you have to get up and walk over.
- 1
RAM is the desk right in front of you; disk is the filing cabinet across the room.
- Right here.2
The desk is tiny but instant — what you grab is already under your hand.
- 3
The cabinet holds far more and keeps it forever, but you have to get up and walk.
- It’s… gone?4
Pull the plug and the desk clears off — unsaved work was only ever there.
- Filed away.5
Saving a file is just copying it from the fast desk to the permanent cabinet.
- 6
So good software keeps the data it needs on the desk, not running to the cabinet.
How they work together
Programs live on disk when they are not running. To use one, the computer loads what it needs into RAM, works on it there, and writes results back to disk to save them. "Saving a file" is really copying it from the fast, temporary desk to the slow, permanent cabinet.
This is also why unsaved work vanishes in a power cut: it was only ever on the desk.
Why the speed gap shapes software
Reaching RAM is enormously faster than reaching disk — different worlds of speed. So a huge amount of software design is about keeping the data you need on the desk instead of running to the cabinet. That instinct is exactly why caching exists, and why databases work hard to keep hot data in memory.