* Hard disks (reminder) electro-mechanical devices, moving parts, magnetic surface can be magnetized in in different polarities (making a 0 or 1). Platter rotates, head moves across platter. Performance limited by mechanical movements of platter and head. Relatively slow devices, but can store a lot of bits per unit volume. * Solid State Drives (SSDs) Flash Media is used to store bits, w/o any moving parts. Is based on older EEPROM technologies (Electrically Erasable, Programmable Read Only Memory). A variant is EPROM: write once, read many. A flash cell takes more energy to erase: an erase turns the cell into a '1'. Then you can write it, by turning it into a 0. So only need to turn 1 bits into 0s. Reading is much faster, takes less energy to sample the state of the flash cell. Erasing is done in large groups of flash chips, b/c it can be done in parallel. Repeated erasing wears out the flash cell until it can no longer hold the charge, or it takes too long to erase. Flash Translation Layer (FTL): maps host LBAs to internal locations. Wear-leveling: flash firmware + FTL record the history of #times each flash chip got erased, and hence its remaining lifetime. Wear-leveling ensures that we redirect new writes to chips that have fewer erasures. An SSD has to know when users are done using virt LBAs, and mark the internally mapped LBAs as "unused" or "garbage". After some time, the flash media will have fragmentation: mixes of valid, erased, and garbage blocks. After a while, the firmware has to perform garbage collection (GC): moving valid blocks to other flash chips that have been erased, remapping the valid blocks that were moved (in the FTL), and then erasing the block with garbage. Now we have reclaimed old garbage blocks, and they can be used to write new data. Performance comparisons: hard disk tend to be slow, reads and writes about the same latency, depends on platter rotation speed and head seeks: latencies can be 100s of ms. Flash is faster (but it depends): 1. reading is really fast, can be done in micro-seconds 2. writing is slower, but much faster than hard disk. Typically writing to flash is 10x slower than reading from flash. Thus, there's big diff b/c reads and write latencies on flash. 3. erasing is much slower, on the order of hard disk ops (100s of ms). Want to minimize #erasures to increase lifetime and reduce latency. However, while SSD is doing GC, the src and dst locations are locked, no host reads/writes can be served. So user processes will be waiting, possibly for 100s of ms. Research literature has called this a "tail latency" -- in worst case, reads can be several seconds long! When a HDD gets near full, it still operates at same speed. When an SSD gets close to full... GC gets slower and slower, b/c there's less temp room for GC to operate on. That's why consumers are told "don't fill up your flash device above 80%/90%". Enterprise SSDs are more expensive, in part b/c they have extra flash space hidden from users, to ensure that GC never becomes too slow. What was the killer app for Flash?! Digital photography, which naturally appends pictures and hence provides a natural wear-leveling w/o the need for a complex FTL or GC. Form factors were Card Flash (CF), then SD-Card (Secure Digital card), then micro-SD. Most of them don't have an FTL or sophisticated GC. Digital photography demanded a lot of flash. Then Apple moved their ipods from using micro-HDDs to small flash ones, now can store more, more reliable, and can produce smaller ipods.