Curriculum / Part 2 · Flash and NVMe deep dive
Lesson 6

How NAND works

Cells, pages and erase blocks; SLC to QLC; endurance ratings (DWPD, TBW) and why QLC can suit read-heavy AI datasets.

⏱ 35 min5-question quiz

The simple version

Flash memory is like a notebook written in pen. You can write on any blank line (a page), but you can't erase one line: you have to tear out and replace a whole sheet (an erase block). And each sheet can only be torn out and replaced so many times before the notebook wears out.

Bits per cell

TypeBits per cellVoltage statesTrade-off
SLC12Fastest, most durable, most expensive per bit
MLC24
TLC38Mainstream data-center SSDs
QLC416Densest and cheapest per bit; lower write endurance and slower writes

Each extra bit doubles the voltage states a cell must hold apart, so reads and writes get more delicate, writes slow down and the cell tolerates fewer program/erase (P/E) cycles.

Pages and erase blocks

NAND is programmed (written) a page at a time and erased a block at a time, and a block holds many pages. A page can't be overwritten in place: it must be erased first, and only as part of its whole block. That single rule is the reason the FTL and garbage collection exist (Lesson 7).

Endurance: DWPD and TBW

TBW = DWPD × capacity × 365 × warranty years

Example: a 7.68 TB drive rated 1 DWPD over 5 years → 1 × 7.68 × 365 × 5 ≈ 14,016 TB written (~14 PBW).

Same drive class at 0.3 DWPD → about 4,205 TB.

Compare the rating with the workload: a checkpoint tier rewritten many times a day burns endurance; a training dataset written once and read for weeks hardly does.

Why QLC fits read-heavy AI data

Training datasets are written once (or rarely) and read many times across epochs. That pattern uses little of QLC's limited write endurance while benefiting from its density and lower cost per TB. Checkpoint and scratch tiers, with heavy repeated writes, usually belong on higher-endurance TLC.

Check the datasheet. Endurance, sustained write speed and indirection unit size vary by model. Use the vendor's numbers for any real design.

Tools

nvme smart-log /dev/nvme0
data_units_written and percentage_used show how much endurance is consumed.
nvme id-ctrl /dev/nvme0
Model, firmware and capabilities.

Quiz

Lab

Related lab

Lab 2.1 · The write cliff

A new drive, /dev/nvme1n1, did about 600k 4K random-write IOPS in the vendor's 60-second quick test. In production it delivers far less, and someone suspects a bad batch.

Start lab 2.1 →

Try it now in the simulator (opens with the command ready; press Enter):

$ nvme smart-log /dev/nvme0 | grep -E 'percentage_used|Data Units'