Is solid state storage non-volatile?

Solid state storage drives (SSDs) have become increasingly popular in recent years as an alternative to traditional hard disk drives (HDDs). One of the key advantages often cited for SSDs is that they are non-volatile, meaning they retain data even when power is removed. But is this claim of being non-volatile really true for SSDs? In this article, we’ll take an in-depth look at how SSDs work and whether they can truly be considered non-volatile storage.

What is non-volatile memory?

Non-volatile memory is any type of computer storage that retains its data even when the power is turned off. This is in contrast to volatile memory like random access memory (RAM) that loses all stored data when power is removed. Non-volatile memory is critical for long-term data storage, as you don’t want to lose files or programs every time a device is powered down.

Some common examples of non-volatile memory include:

– Flash memory – Used in USB drives, SSDs, and memory cards
– Read-only memory (ROM) – Stores permanent data like firmware and boot instructions
– Magnetic storage – Hard disk drives, floppy disks, magnetic tape
– Optical discs – CDs, DVDs, Blu-ray discs

A defining characteristic of non-volatile memory is that it can store data for long periods of time – typically 10 years or more – without needing power. This gives non-volatile memory the ability to be a reliable form of long-term data storage.

How do SSDs work?

SSDs provide non-volatile storage through the use of flash memory chips. Flash memory is a type of electronically erasable programmable read-only memory (EEPROM) that can be electrically erased and reprogrammed.

The basic building block of flash memory is a floating gate transistor. These transistors have an extra gate between the control gate and substrate called a floating gate. Charge can be stored on this floating gate, modifying the threshold voltage required to allow current to flow through the transistor. The presence or absence of current flow then represents the 1s and 0s used to store data.

To write data, a high voltage is applied to the control gate and drain of the transistor, forcing electrons to tunnel through the thin oxide layer onto the floating gate in a process called Fowler–Nordheim tunneling. This increases the transistor’s threshold voltage so that it conducts less current when read.

To erase the data, a high voltage of the opposite polarity is applied between the control gate and substrate, pulling electrons off the floating gate and lowering the threshold voltage.

Data read and write operations in a flash memory chip are managed by an embedded memory controller. This controller interfaces between the flash memory and the SSD controller to provide functions like reading, writing, erasing, wear leveling, error correction, and bad block mapping.

In an SSD, arrays of flash memory chips are packaged together on memory modules called NAND flash dies. The SSD controller connects to the flash memory modules over channels. It has firmware that manages all the flash memory in the SSD by executing the flash memory controllers’ instructions for read, write and erase operations.

The SSD controller is also responsible for error checking and correction, wear leveling, mapping logical block addresses to physical locations on the flash memory, and handling bad block replacement. It has volatile SRAM and non-volatile flash memory caches that help improve performance.

Are SSDs non-volatile?

Based on their underlying flash memory technology, SSDs would seem to clearly meet the definition of non-volatile memory. However, there are some caveats that mean SSDs may not fully retain data in all situations when power is removed.

One issue is that SSDs have a small amount of DRAM cache memory and capacitors that allow data in flight to be committed to flash when power loss is detected. But very brief power interruptions may not provide sufficient energy to fully save cached data that hasn’t yet been written to flash, resulting in data loss. However, new SSDs support power loss data protection to mitigate this concern.

Wear leveling and garbage collection operations that run in the background on SSDs could potentially cause data loss if power is suddenly interrupted. Blocks are erased before data is rewritten, so a loss of power during this process would make recently deleted data unrecoverable. However, the risk is low and SSD controllers minimize disruption from these background activities.

Importantly, SSDs do not have full end-to-end data integrity protection with checksums that can detect silent data corruption issues. So bit rot over time can occur on stored data that goes undetected on SSDs. However, the chance of errors is very low because flash memory itself does not degrade like magnetic or optical media.

Overall, while rare edge cases exist, SSDs still provide excellent data retention and integrity when powered off. No storage medium can provide absolute and indefinite data persistence. But SSDs come much closer to the ideal of non-volatile storage compared to volatile memory technologies.

Comparing SSDs and HDDs for non-volatile storage

When it comes to non-volatile storage, SSDs have some advantages over traditional hard disk drives:

SSDs HDDs
No moving parts and better shock resistance reduces risk of data loss if power is interrupted. Spinning magnetic platters are vulnerable to damage if power loss occurs while drive heads are writing data.
Data is spread across many flash memory chips in parallel. Failure of one chip only causes loss of a small amount of data. Entire drive failure can occur if spindle motor or read/write heads fail.
Flash memory retains data for years without power. Less volatile degradation over time. Magnetic regions used to store data can start to decay after a few years without power refreshing the data.

However, HDDs have the advantage of lower cost per gigabyte of storage. For archival storage needing infrequent access, HDDs can provide excellent non-volatile storage at lower expense.

Overall, SSDs are better suited for more active storage needs, while HDDs are preferable for colder data that can tolerate slower access speeds in exchange for lower costs. Using a tiered storage approach with SSDs and HDDs in combination provides a good balance of speed, persistence, and cost that leverages the non-volatile strengths of each technology.

Enhancing non-volatile storage with RAID

Redundant Array of Independent Disks (RAID) can be used with both SSDs and HDDs to improve non-volatile data storage capabilities. By combining multiple drives together into a RAID array, storage performance, capacity, and fault tolerance can be improved.

Some common RAID levels and their benefits for non-volatile storage include:

– **RAID 1** – Disk mirroring that duplicates all data across two or more drives. If one drive fails, data can still be accessed from the other mirrored drive(s) without loss.

– **RAID 5** – Block-level striping with distributed parity. Protects against loss of any single drive.

– **RAID 6** – Block-level striping with double distributed parity. Can survive loss of up to two drives without data loss.

– **RAID 10** – Combines mirroring and striping for both speed and redundancy.

The improved fault tolerance provided by RAID can significantly enhance the non-volatile reliability of storage. Even inexpensive commodity drives can be combined into high availability storage with extremely low risk of data loss due to disk failure when properly implemented in a RAID configuration.

RAID also improves performance, helping to mitigate potential data loss on SSDs or HDDs during power failure by reducing the window of vulnerability when data is being written or modified.

Using capacitors and batteries to improve SSD non-volatility

SSD manufacturers have introduced capacitors and batteries into SSD design to safeguard against data loss on sudden power failure:

– **Capacitors** – Can provide enough power for the SSD controller to complete read/write operations of data in cache to the non-volatile flash memory if power is lost. Typically enough reserve power for a few seconds.

– **Supercapacitors** – Special capacitors with higher capacitance that can supply power for 30 seconds or more. Allows nearly all volatile cache data to be flushed.

– **Batteries** – Small batteries integrated into the SSD can power the device long enough to write cache data when external power is lost.

These power backup sources allow SSDs to provide true non-volatile storage by giving them time to complete cached data write operations even if power is unexpectedly disrupted.

With capacitors or batteries, SSDs can pragmatically provide non-volatile data retention and persistence equivalent or superior to traditional spinning hard drives. The latest SSD models include some form of power fail protection for data in flight, eliminating most issues that could theoretically lead to data loss.

File systems and non-volatile storage

The file system manages the logical storage of data on a drive and plays a role in ensuring proper non-volatile storage. Journaling file systems like NTFS and ext4 log their intent to modify data before executing changes. If power loss occurs, this journal can be replayed when the system reboots, avoiding potential corruption from partial write operations.

Log-structured file systems like ReFS and ZFS provide transactional consistency by structuring all writes sequentially in an append-only log format. Uncommitted transactions are simply aborted if power fails rather than risking incomplete changes to metadata or partially written data blocks.

Copy-on-write file systems like Btrfs also enhance non-volatile reliability. Any changes first get written to unused space before metadata pointers are updated. This atomic redirect-on-write model avoids corruption if power fails during an update.

Thus proper choice of enterprise file system can provide crucial protection against unexpected loss of power, complementing capabilities of the SSD or HDD hardware to actually make writes persistent.

Other factors influencing non-volatile storage reliability

Beyond the storage media itself, there are additional factors that influence the integrity of non-volatile data storage:

– **Operating temperature** – SSDs and HDDs are designed for optimal operation within certain temperature ranges. Exceeding these recommended temperatures can increase the probability of errors or failure.

– **Controller bugs** – Firmware problems in either the flash memory controllers inside SSDs or the disk controllers in HDDs can potentially cause data errors or loss in rare instances.

– **Write cycles** – Flash memory cells have a finite number of times they can be reprogrammed before wearing out. Excessive writes can wear out cells.

– **Magnetic fields** – Very strong magnetic fields can corrupt data on HDDs by altering the magnetic charge of the platters. SSDs are immune to this issue.

– **Physical damage** – Severe impacts, shocks, or vibration can disrupt internal components, making both SSDs and HDDs vulnerable to mechanical damage.

Mitigating these risks comes down to designing, engineering, and operating storage systems properly for their intended environment and workload characteristics.

Conclusion

In summary, solid state drives can generally be considered non-volatile storage from a practical point of view, but they are not quite as perfect in this regard as the ideal of indefinite persistent memory. Power loss during write caching operations can potentially lead to some data loss, but the probabilities are extremely low, especially with capacitors or batteries to provide backup power. Compared to mechanical hard drives, SSDs meet or exceed expectations for reliably retaining data without power. When implemented properly in enterprise-class storage systems, both SSDs and HDDs can provide excellent non-volatile storage with very minimal risks of unrecoverable data loss.