# What Every Programmer Should Know About SSDs

DevFeed: [What Every Programmer Should Know About SSDs](<https://devfeed.tech/articles/what-every-programmer-should-know-about-ssds-25072.md>)

Original publisher: [Read original article](<https://databasearchitects.blogspot.com/2021/06/what-every-programmer-should-know-about.html>)

Author: Viktor Leis (noreply@blogger.com)

Published: 2021-06-18T11:52:00Z

Content type: article

Language: en

Sources: [Database Architects](<https://devfeed.tech/sources/database-architects.md>)

Topics: [Hardware](<https://devfeed.tech/topics/hardware.md>), [IO](<https://devfeed.tech/topics/io.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [Filesystems](<https://devfeed.tech/topics/filesystems.md>), [io\_uring](<https://devfeed.tech/topics/io-uring.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [io](<https://devfeed.tech/tags/io.md>), [io-uring](<https://devfeed.tech/tags/io-uring.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [performance](<https://devfeed.tech/tags/performance.md>), [ssd](<https://devfeed.tech/tags/ssd.md>), [storage](<https://devfeed.tech/tags/storage.md>)

## AI overview

This article explains how NAND-flash SSDs differ from magnetic disks and how those differences affect software performance. It covers lower random-read latency, internal parallelism, concurrent I/O, and the effect of volatile write caching on observed write latency.

## Source excerpt

Solid-State Drives (SSDs) based on flash have largely replaced magnetic disks as the standard storage medium. From the perspective of a programmer, SSDs and disks look very similar: both are persistent, enable page-based (e.g., 4KB) access through file systems and system calls, and have large capacities. However, there are also important differences, which become important if one wants to achieve optimal SSD performance. As we will see, SSDs are more complicated and their performance behavior can appear quite mysterious if one simply thinks of them as fast disks. The goal of this post is to provide an understanding of why SSDs behave the way they do, which can help creating software that is capable of exploiting them. (Note that I discuss NAND flash, not Intel Optane memory, which has different characteristics.) Drives not Disks SSDs are often referred to as disks, but this is misleading as they store data on semiconductors instead of a mechanical disk. To read or write from a random block, a disk has to mechanically move its head to the right location, which takes on the order of 10ms. A random read from an SSD, in contrast, takes about 100us - 100 times faster. This low read latency is the reason why booting from an SSD is so much faster than booting from a disk. Parallelism Another important difference between disks and SSDs is that disks have one disk head and perform well only for sequential accesses. SSDs, in contrast, consist of dozens or even hundreds of flash chips ("parallel units"), which can be accessed concurrently. SSDs transparently stripe larger files across the flash chips at page granularity, and a hardware prefetcher ensures that sequential scans exploit all available flash chips. However, at the flash level there is not much difference between sequential and random reads. Indeed, for most SSDs it is possible to achieve almost the full bandwidth with random page reads as well. To do this, one has to schedule hundreds of random IO requests concurre