An SSD controller is the chip inside every solid-state drive (SSD), together with its firmware, that manages the drive's flash memory. It spreads writing evenly, so that no flash cell wears out early. It finds and fixes errors. And it keeps track of where each piece of data is actually stored. Firmware is the software that runs on a device's own chip.
Why does flash need a manager? NAND flash memory follows three awkward rules. It is written in small pages, about 16 KB each, but it can be erased only in large blocks of several megabytes. A page cannot be overwritten in place: it must first be erased with the rest of its block. Each block wears out after a limited number of erases, about 1,000 to 3,000 for common flash. And cells make occasional errors, more often as they wear.
The controller hides all of this from the computer. The computer asks to read or write data at an address, called a logical address, as if the drive were one simple list of places. The controller writes each piece of new data to a fresh page, wherever it chooses. It then records, in a mapping table, which physical page now holds each logical address. On a 1 TB drive, this table takes about 1 GB, and it is kept in a small DRAM chip inside the SSD. The old copy is marked invalid. Later, when a block is mostly invalid, the controller copies its few valid pages elsewhere and erases the whole block. This is called garbage collection. The controller also counts the erases of every block, and sends new data to the least-worn blocks. This is called wear levelling. Every page is stored with extra error-correcting bits, from which the controller can rebuild bits that the flash got wrong.
Consider an employee in the accounts team at a firm in Nagpur, who saves a 2 MB spreadsheet on her laptop's 1 TB SSD. The controller splits the file into 128 pages of 16 KB each. It writes them to free pages in its least-worn blocks, with error-correcting bits added to each. It updates the mapping table, so that the file's logical addresses now point to the 128 new pages. The 128 pages that held the previous version of the file are marked invalid. Hours later, while the laptop is idle, garbage collection copies the valid pages out of one mostly invalid block and erases it, ready for new data.
Because the controller writes evenly across all the blocks, a drive rated for 600 full rewrites can usually last for years of office work. Large companies use the same kind of controller in the flash drives of enterprise storage systems and software-defined storage, where the controller also reports how worn each drive is, so that it can be replaced in time. Some of the world's SSD controllers and their firmware are designed in Bengaluru.