How Solid State Storage Works

If you're a computer guy (or gal), you probably already know what a Solid State Drive (aka, an SSD) is and the main thing most people who know about them only know that they're faster because they use memory chips rather than spinning platters in traditional HDDs. Have you ever wondered how they really work though? If you're not a computer guy (or gal), then lets bring you up to speed (pun intended) with why people are ditching spinning disks for SSDs.




SSDs actually serve a very similar purpose, in principle. Instead of platters on a spindle with an actuator arm being held over the surface of the platters like I talked about in a previous post, you have flash memory. This is the same technology that's allowed us to have USB storage in our pockets, portable MP3 players that don't vibrate when in use (remember the original iPods?) and now super fast storage for your computer. At a high level, flash memory is very similar to the RAM (Random Access Memory) in your computer. For the longest time, the HDD was effectively the slowest part of your computer (aka, the bottleneck). As flash memory increases in storage size and drops in price, it's now poised to replace your old spinning disk HDD with a new SSD. The information discussed below applies to Solid State Storage, which is made up of Solid State Drives (SSDs) and Solid State Cards (SSCs). I'll be talking about SSDs for for the purpose of the discussion, SSCs are the same thing.

Flash Memory

SSDs use NAND flash memory rather than spinning magnetic disks found in traditional HDDs. NAND flash can only be written to so many times, which is measured in P/E Cycles or Program/Erase Cycles. Flash memories are organized into Cells, which contain Pages, which contains Blocks, which I'll explain a bit deeper shortly. NAND flash is non-volatile which means that it doesn't require constant power to retain data, unlike the normal DRAM found inside most computers.

NAND Types

NAND flash memory chips contain Cells, as mentioned above. Performance and Endurance can be determined by which type of Cells the flash memory uses. There are 3 types; SLC, MLC and TLC. SLC, or Single Level Cell, flash can only store 1 bit of data per cell. SLC flash typically comes with high performance and high endurance (roughly 100k P/E Cycles) but at a very high cost. MLC, or Multi Level Cell, flash can store 2 bits of data per cell. Here you'll find a decent cost vs performance ratio and with an endurance around 10k P/E Cycles). 3rd, you'll find TLC, or Triple Level Cell, flash which can stores 3 bits of data per cell. The endurance is lower (at around 1k P/E Cycles), as is the performance, but the price can make it more attractive for some, as it'll be cheaper than it's SLC or MLC brethren.

Cells, Pages & Blocks

As stated earlier, flash storage organizes data into cells, pages and blocks. This organization is very similar to the idea of platters, tracks and sectors that we discussed for HDDs. Cells contain Pages and Pages contain Blocks. Flash writes are a bit complicated, at least when compared to writes to magnetic media (tapes, HDDs, etc.). In order to erase a cell that already has data, the controller has to load the block contents into it's own DRAM, erase the block and then re-write the entire block from DRAM with the changed information. This is known as Write Amplification. Cells can be written to when empty at the cell-level but erased only at the block level.

Controllers

Just like HDDs, SSD's have controllers that run the whole show. They contain an LBA map specifying what is where. Except that instead of mapping data to platters, tracks and sectors, it's done for cells, pages and blocks. The controller also has a number of housekeeping tasks that run in the background, such as Garbage Collection, Wear Leveling and Flash Overprovisioning. Garbage Collection is a process that erases blocks that contain data marked for deletion, which helps quell Write Amplification. Wear Leveling is a task that makes sure each Cell is getting used as much as, or close to, thte same as the rest. Since different flash types only have a finite number of writes, this prevents one cell from wearing out well ahead of another. Flash Overprovisioning is for Write Amplification situations where the controller sort of hides storage space for itself. Rather than writing data over 250Gb of space in a 250Gb drive, the controller would "forget" about some of that space, leaving fresh, pre-erased space until it was in a Write Amplification situation.

Interfaces & Protocols

I hit on a lot of the main storage interfaces and protocols in my post about HDDs, so I'm going to only add the relevant details here about flash storage. Older SSDs, did have have PATA and SCSI interfaces but they weren't very common. Those were typically found when flash storage didn't have nearly the cost/density ratio that spinning disks had and their price-point wasn't really in any kind of consumer market. They were mostly niche enterprise offerings at that time. Currently, SATA SSDs are very common in desktop and laptop computers, while SAS SSDs are common in the enterprise storage market.

Flash storage devices can also connect directly to a motherboard using an M.2 interface, which looks similar to a WiFi or Bluetooth controller on a laptop. They can also connect to a desktop using a PCIe or PCI Express slot.

For the most part, SSDs are becoming very competitive to HDDs, but each still have their strengths. SSDs make great upgrades to end-user workstations and as a primary storage platform for servers. However, due to their finite writes, they don't make great options for high-write jobs such as backups.

I had a lot of fun researching this so I hope you enjoyed reading it and I hope that this helps you better understand solid-state storage.   

Comments

Popular posts from this blog

Installing CentOS 7 on a Raspberry Pi 3

Modifying the Zebra F-701 & F-402 pens

How to fix DPM Auto-Protection failures of SQL servers