When discussing flash memory vs. RAM, you might be inclined to lump them together based on their similarities. While both technologies are made up of solid-state chips and fall into the category of solid-state storage, the way they are made, their performance specifications and the relative costs give them entirely different roles in a computer system.
Flash memory is used primarily for storage, while RAM (random access memory) performs calculations on the data retrieved from storage. By their nature, flash memory and RAM are faster than storage alternatives, such as hard disk and tape.
In terms of flash memory vs. RAM speed, RAM is the faster of the two, but it is also more expensive. There are two types of RAM commonly used in a computer system: dynamic RAM (DRAM) and static RAM (SRAM). In addition to being the fastest option, SRAM is much more expensive than DRAM, so it is mainly used as the cache memory inside the integrated circuit that is a computer's CPU. DRAM is mainly used as the primary operational memory, running the OS and applications.
Less expensive still is flash memory. Flash memory is non-volatile and can hold data even without power, unlike RAM. Compared to either type of RAM, flash memory speed is significantly slower. Because of its reduced power consumption, persistent nature and lower cost, flash is used for storage memory, in devices such as SD cards, USB drives and SSDs.
This article is part of
How RAM works
At a basic level, RAM enables users to read from or write to any element of memory in whatever order they please. This sets it apart from tape and hard-disk storage, which require drives to be accessed in a specific order.
SRAM is built into a CPU and can't be adjusted by the user, so let's take a closer look at how DRAM works to better understand RAM. DRAM uses storage cells made up of a capacitor and a transistor. DRAM storage is dynamic -- it needs a new electronic charge every few milliseconds to compensate for charge leaks from the capacitor. Those storage cells are built into a solid-state chip, and those chips are collected into the familiar rectangular RAM module that is placed into the RAM connectors on a computer's motherboard.
The computer OS running in RAM calls for data from storage when needed, and the bits that make up that data are held in the storage cells until the OS or application calls for them to be written back to the storage memory.
How flash memory works
Flash memory is made of solid-state chips in which the transistors are connected, so they function similarly to the logic gate type called NAND. NAND was developed to help reduce flash memory costs per bit and increase chip capacity. These developments have helped give flash memory a fighting chance against the cheaper hard-disk storage options in the market.
Data has to be erased from NAND flash memory in entire blocks -- even if you only need to erase a few bits of data in the block -- as opposed to individual bits, as is the case with RAM. In addition to helping make flash memory slower than RAM, early flash requirements to erase data in entire blocks also caused it to wear out faster than RAM.
Today, flash memory lasts much longer due to software functions such as wear leveling. Wear leveling can prolong the life of flash memory by arranging the data in a way that more evenly distributes rewrites and erasures. This avoids single blocks from a high concentration of write cycles, which can cause early failure.
NAND flash could be overtaken by technologies
Flash technology advancements overcome server-side flash challenges
Flash takes on role as complement to DRAM