3

I can’t find anything on the specifics of WHAT exactly makes ram so much faster than disk drives/ ssds. What’s different in how ram reads and writes data from how permanent storage does? What’s so fundamentally different between them that leads to such drastic differences? Permanent vs temporary storage. Slow vs fast read/write. What in ram makes it so much faster

2
  • Ignoring mechanical HDDs, which are self-explanatory, Its always been explained to me in terms of cost. Cache memory costs a fortune, so you only get a few MB of it, placed directly in the CPU, where it can do the most good. Cache operations are on the order of nanoseconds. RAM is also expensive by volume, so you only get a few GB of it, and it operates in approximately microsecond time. SSDs aren't particularly useful unless they are sufficiently capacious, and affordably priced, so many compromises are made to make them cheaper. look at the difference between SLC, MLC, TLC, and VNAND SSDs. Dec 30, 2021 at 5:41
  • RAM is a functional description, i.e. memory that is randomly addressable, and commonly used as the main memory of a computer system. Your question would make more sense if you considered the technology that implements that RAM. Historically computer RAM used ferrite core, then static (SRAM) and dynamic (DRAM) memory.
    – sawdust
    Dec 30, 2021 at 8:09

1 Answer 1

4

There are a lot of differences between both what happens at a physical level and what happens at the interface between the CPU and the devices that affect the speed of these devices.

Note: there are other types of RAM (FeRAM, PRAM and so on) and other storage systems, for the purposes of discussion I am only considering the major components as used in computers.

Physical differences

There is a fundamental difference between a "simple" electronic state change that is used in RAM versus a physical world change that is used in HDD and SSD devices.

Conventional RAM uses a handful of transistors to hold a state. Transistors are inherently fast devices that operate purely based on electric currents. They operate in the same way as the CPU and their speed also comes with a downside in that they are volatile, meaning that if power is ever removed then the data is lost.

Hard drives have a much more physical change happening. Rather than changing the state of an electronic circuit you are essentially trying to force a change in the physical medium. With a HDD it is a similar process to remagnetising a needle, you need to use a magnet to push the atoms around to align their magnetic fields and the process is relatively slow compared to a pure electronic based transistor switch.

Solid State Drives (SSDs) are an odd halfway house between normal RAM and hard drives, they are essentially an electronic storage device but in order to write to them there is still a physical change that has to happen. Electrons have to be forced into an area that they do not normally want to go using a higher voltage. That higher voltage and act of force writing requires more work than a simple transistor state change. Reading is slightly more complicated as well making them slightly slower there. I've written more on how flash storage works on this answer.

Interface differences

There is also the nature of the interface to these devices to consider as well. Storage devices such as HDDs and SSDs have a controller and an interface that combines both address and data lines into a protocol based command interface. In order to do anything we have to send a command that states give me the data from block 3192 or write this <data> to block 549,321,974 which the controller needs to decode and then put into action. Due to the spinning nature of a physical HDD they work best when each request for data follows the previous data in sequence.

SSDs are a much more forgiving device and don't really care about the data requests being in sequence, but they do still need the controller in the device to handle commands sent over the "simple" interface.

HDD and SSD interfaces to their controller (and modern protocol based interfaces in general) operate in a "serial" mode. What this means is that there is essentially a single data line that must be toggled repeatedly to build up a command. In order to transfer a single byte of data the serial line must toggle at least 8 times. On top of just data you have a lot of "overhead" in sending bytes for commands telling the controller whether you are asking it to read or write.

RAM on the other hand has an interface to the CPU that is very wide, and it is also a "parallel" interface. It has both multiple address and data lines and needs no real controller (except the memory controller built into the CPU) to handle marshaling data in and out. The CPU changes the address lines to what it wants, sets another couple of lines to say whether it is reading or writing, and then starts sending data out on multiple data lines. It is a far more complex arrangement, but because of the dedicated "wide" data bus bigger blocks of data can be sent out at once, achieving larger bulk speeds as a result.

I've written more about the interface differences in my answer about why Random Access Memory is called "Random Access"

1
  • Exactly what I was looking for! Thank you very much!
    – Jcsq6
    Dec 31, 2021 at 0:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .