SSD basics

SSD is a NAND-type flash. RAM has infinite number of READ & WRITE capability. SSD(or Flash memory) can be overwritten something less than 100,000 times. (Depending on the type of flash memory, it may be as few as 1,000 times)

SSD Types
Single level cell (SLC): Stores 1 bit per internal cell, has a higher number of write cycles. Expensive.
Multi level cell (MLC): Stores multiple bits per internal cell. Cheap and consumes more power.

Sector, Block and Page in SSD
     Sector/Page = 4,096 byte.             // Unit of Read/Write
     Block = 1024 * sector                  // Unit of Erasing
     Chip  = Thousands of Blocks

Read/Write unit and Erasable unit (Performance degrade and Aging)
Key thing is Unit of Erasing is larger than Unit of Read/Write. This affects the speed at which data is written to blank SSD and crowded SSD. Writing to blank SSD is fast because there is no need to make space, and writing to crowded SSD is slow because making space is an expensive operation.

Example, here we write a single sector on to a crowded SSD
1.   Read the entire Block into the controller’s internal RAM. (because unit of Erasing is Block)
2.   Erase the Block in the SSD.
3.   Write new sector in to Block sitting in RAM.
4.   Write the entire Block on to the SSD
As you see, writing one sector required working on extra 1023 sectors because unit of Erasing (one Block has 1024 sectors) is Block. So as SSD gets crowded, the rate of erasing increases resulting in not only bad performance but also aging because SSD has fixed number Write cycles.

This is implemented inside controller, to spread the wear (erases) across the SSD. This means SSD ages uniformly.

File Deletion and the Trim Command
Magnetic disk reads and writes nativley, in terms of sector, so the file deletion is a check-box inside a data structure. SSDs do not read and write sectors natively, and that lead to problems in earlier SSD. Then SSD controller's came with TRIM command.

1.   Fragmentation is not problem in SSD. If used, Disk defragmenter will wear our SSD faster.
2.   NTFS was not designed with SSD in mind. NTFS issues lots of small writes to increase reliability and this is not good for SSD.
3.  Using an SSD as your C: drive may drastically increase the speed of your system, but it will wear out before a magnetic disk would.
4.  High-end magnetic disks can outperform low-end SSDs in some cases because many low-end SSDs perform poorly for small, random writes, which is a characteristic of the typical Windows workload

Source: Windows Internals (edition 6) by Mark E. Russinovich

No comments: