ELI5 · How computers work

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 · desk disk · cabinet across the room
    1

    RAM is the desk right in front of you; disk is the filing cabinet across the room.

  2. Right here.
    data
    2

    The desk is tiny but instant — what you grab is already under your hand.

  3. huge · permanent walk over…
    3

    The cabinet holds far more and keeps it forever, but you have to get up and walk.

  4. It’s… gone?
    gone power cut!
    4

    Pull the plug and the desk clears off — unsaved work was only ever there.

  5. Filed away.
    file desk save cabinet
    5

    Saving a file is just copying it from the fast desk to the permanent cabinet.

  6. hot data, kept close
    6

    So good software keeps the data it needs on the desk, not running to the cabinet.

RAM is the desk in front of you; disk is the cabinet across the room. One is fast and fleeting, the other slow and permanent.

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.

The real version How memory works →
Found this useful?