Solid state drives: is my data safe?

Solid-state drives (SSDs) based on flash memory are increasingly replacing hard disk drives (HDDs) for mass storage in many applications. A quick check of an online retailer showed that about half the laptops and desktop computers used SSDs.

This is not surprising as they have a number of advantages: lower weight, higher performance, lower power consumption and (in some formats) smaller size. However, they are still more expensive than HDDs for the same storage capacity.

One commonly discussed issue with flash memory is write endurance: the fact that flash memory cells have a limited number of program-erase cycles. This is because of the high voltages used to write and erase data. This causes a small amount of damage to the cells each time. This makes it increasingly difficult to write to the cells. It can also reduce how long data can be retained.

A single-level cell (SLC) typically has a lifetime of about 100,000 cycles. For increasingly common triple-level cell (TLC) or quad-level cell (QLC) memories it can be as low as 1,000 cycles.

When I first got a computer with an SSD, I was a bit worried by this known “weakness” of the technology. Would my data be safe? Even though I am not going to save a Word document 1,000 times, I was aware that the operating system frequently writes data to disk in the background (more obvious with a noisy HDD than a silent SSD).

There are also extra write and erase cycles performed internally by the flash memory to manage storage. This is known as write amplification and is a consequence of the way flash memory works. The data in cells cannot be directly overwritten and so, when the contents of memory is updated, the existing data has to be copied to a new, empty, area of memory and merged with the new data. Garbage collection is also required to consolidate the data so a block can be erased and reallocated for storing more data. These, and other processes, add extra write cycles and so potentially reduce the lifetime of the memory.

So, is this something we need to worry about?

SSD lifetime

Taken in context, this is not as a big a problem as I initially feared. This is partly because these numbers are larger than they look. Also because flash memory controllers use several techniques to maximise the lifetime of the memory system.

To put the number of write cycles in perspective, if you were to completely fill your 256GB SSD with new data every day, it would take you more than 8 years to reach the typical 3,000 cycle limit for TLC flash. And, to be fair, very few users are going to write that much data to disk. 

For comparison, a hard disk drive (HDD) might not survive that long either. Consumer grade HDDs have an average life of about 5 years.

More importantly, flash memory designs use a number of techniques to reduce the effects of limited write endurance. 

One of these is wear levelling: ensuring that write cycles are evenly distributed across the whole memory. This means the controller has to dynamically modify how that the logical addresses used by the operating system are mapped onto physical locations in the memory array.

In addition, SSDs have some level of over provisioning: extra blocks of memory that are used to efficiently mange writing data and to allow for some level of failures in the memory. If a block is found to become unreliable over time, it can be marked as bad and one of the spare blocks used in its place. This allows the available capacity of the drive to be maintained even with some number of failed blocks.  

The Tech Report website did an interesting experiment a few years ago to test the lifetimes of several brands of SSD under stress. This is the last article in the series, with the conclusions: The SSD Endurance Experiment: They’re all dead (it has a link to the first article if you want to follow the whole thing).

Conclusion

In summary, it doesn’t seem that there is any greater risk from using an SSD instead of an HDD. For portable devices, the SSD has the benefit of being shock resistant. They are also faster, lighter and lower power than mechanical drives. The main advantage of HDDs is storage cost, currently about 1/10th the cost per gigabyte. So if you need lots of storage capacity (multiple terabytes) then HDDs are still probably the better choice. 

So, in conclusion, don’t worry about your SSD. But do backup your data!