Computer memory comes with many different distinctions.

One of the ones you may have seen is volatile memory vs. non-volatile memory.

The word volatile means something that is transitory or is likely to change.

Article image

In computing, it refers to types of memory that cant retain data when they lose power.

Conversely, non-volatile memory retains its data, even if it doesnt have a power supply.

No delete operation goes through and wipes the volatile memory as your box shuts down.

Volatile memory is simply incapable of holding the electric charge to store data without a constant power supply.

Its also worth noting that different non-volatile memory can lose data over time.

For example, when unpowered, the charge used to store data in SSDs slowly decays.

This results in data loss after a couple of years without power.

Non-volatile memory is ideal for long-term storage.

You probably wont be surprised to hear that your hard drive uses non-volatile memory.

SSDs, HDDs, optical storage media, and magnetic tape are all forms of non-volatile memory.

Technically, you could consider the classic punch cards.

Or printed paper, a form of non-volatile memory.

However, you dont use them that way.

Volatile memory loses any data it holds when it loses power.

This makes it useless for long-term storage.

As any power cut would mean losing your data.

There are uses for volatile memory in computers, though.

System RAM is volatile.

It holds data while the computer is on.

Then loses it when it turns off.

The caches on the CPU die are also volatile memory.

In fact, RAM and CPU cache should lose data when the computer shuts off.

This ensures that the data they hold is adequately cleared and not vulnerable to data recovery when shut down.

Any necessary data can easily be stored in the volatile memory again by reading it from the non-volatile memory.

The Benefits

The main benefit of non-volatile memory is its ability to store data while unpowered.

There are other benefits.

Non-volatile memory is typically cheaper than volatile memory per unit of memory.

This is particularly useful as you need large amounts of non-volatile storage space to store your data long-term.

Non-volatile memory keeps its data when powered down, making it vulnerable to data recovery.

This is good, as it allows you to recover data from a broken hard drive.

Another helpful thing your non-volatile memory can use is pre-saving files that havent been saved.

This allows you to recover your lost document after a reboot.

This wouldnt be possible in a computer with no non-volatile memory as the data would be lost entirely.

The Drawbacks

Non-volatile memory is typically slower than volatile memory.

But thats why volatile memory is used in speed-sensitive places such as RAM and CPU cache.

Not all volatile memory is faster than all non-volatile memory.

It would be crushed if you took RAM from the earliest computers and compared it to a modern SSD.

But thats not a fair comparison.

Technology and connectivity have significantly improved over time.

Non-volatile memory is actually slower than volatile memory in two different ways.

It is slower to read or write data but has a much higher latency.

Latency measures how long it takes for the memory to find and respond to the requested data.

The read or write speed is the actual transmission rate of data.

Non-volatile isnt ideal for storing data that needs to remain secure, as that data can be recovered forensically.

This is an unavoidable risk for sensitive data that must be stored long-term.

Though it can be countered with encryption.

For sensitive ephemeral data, though, you dont want to use non-volatile memory.

For example, temporary encryption keys, such as those used in HTTPS encryption, are stored in RAM.

Suppose you have had these keys for a long time.