9

I've read that some commercially available SSD are capable of 4GB/s writing speeds top, while current DDR4 Ram speed can be between 15GB/s and 25GB/s, meaning we're not far off. In fact RAM can already be used as a virtual drive for example a RAM disk (though volatile). I also know general SSD durability is not great although vastly exaggerated, but still don't understand the underlaying mechanical reasons.

So what are the reasons and differences why SSD can't be used as RAM, especially what makes RAM cells so fast and durable vs NAND cells, and also why (it's probably related) does RAM cost more per GB than SSD?

Thanks.

yazze
  • 121

3 Answers3

14

It all boils down to latency.

DDR4 latencies are measured in nanoseconds. It's typically somewhere under 20ns.

SSD latencies are measured in microseconds. The fastest SSDs are in the region of 25μs.

1μs = 1000ns. Your fastest SSD has a latency 1000x longer than DDR4.

Even more telling is that RAM is actually too slow, so there's L1 and L2 cache on top. Every time you hit DRAM, you're wasting about 100 cycles waiting for the data fetch — so on-CPU cache is used to reduce that to <10 cycles for frequently-accessed data. Imagine waiting 100,000 cycles instead...


Another, related, factor is random access times. You quote 4GB/s — that's sequential speeds. With random read, you see something more like 50MB/s, while random write might top out at 150MB/s. And RAM is read a lot more than it is written.

Compared to DRAM, SSDs are optimised for high throughput, not a high number of operations per second. As another example, erase blocks on SSDs are quite big, which means rewriting many small chunks is expensive.


There are technologies that bridge the gap. 3D XPoint, branded Optane by Intel, is faster than NAND (SSDs) and cheaper than DRAM.

Bob
  • 63,170
3

SSD vs RAM: what's the cost/durability difference and limitation to using SSD as memory?

The cost, durability, and performance, e.g. latency, comparisons are actually irrelevant because you simply cannot use a SSD as (main) memory or RAM. One important distinction is that RAM is byte and/or word addressable. Mass storage devices such as SSD or HDD are block devices that are only sector addressable.

You cannot read or write just one byte or word from/to a block device. In order to perform a read or write operation from/to a block device, an entire (physical) block (aka sector) has to be read or written. You need RAM to buffer the block between the CPU and the mass storage device.

Bottom line: you cannot simply replace RAM with a block device.

If you try to expand the existing amount of RAM used for main memory by copying code and data to/from a SSD/HDD, then you're essentially using virtual memory (and you'll need a Memory Management Unit).


ADDENDUM

Comparing the performance (e.g. latency, throughput, et cetera) between RAM technology versus SSD technology to answer the question about "why SSDs can't be used as RAM" is misguided because it's irrelevant. A mass-storage block device is incompatible as a substitute for RAM as main memory.

IMO it's like asking "how much pizza do I have to eat to stay hydrated?", and answers cite the water content of different pizza toppings. But the correct and simple answer is that pizza is not a replacement for drinking water.

Likewise a SSD (with its block interface) is not a replacement for RAM in a computer. In other words, the correct answer is based on computer architecture concepts rather than comparing performance numbers.


what makes RAM cells so fast and durable vs NAND cells,

You're trying to compare apples to oranges.

RAM (Random Access Memory) is a functional classification of memory. The acronym does not specify a technology, i.e. RAM for main memory is typically a type of SDRAM in a modern PC. Older computers used ferrite cores for RAM.

For economic reasons it's common that faster speed means less capacity and slower speeds mean more capacity. Your average computer will have SDRAM for main memory (usually shortened to just RAM) and SRAM for CPU caches. SRAM is really expensive in comparison to SDRAM but also much faster. See Why is SRAM faster than DRAM? for information as to why SRAM is faster than SDRAM. There are also exceptions to this for embedded devices or other kinds of computers like the Cray X-MP.

NAND is technology for flash memory. Note that NAND flash (at the chip level) typically has to be accessed as a block device.

why (...) does RAM cost more per GB than SSD?

Same apples to oranges comparison. Supply versus demand (which is driven by performance) has a huge influence on pricing. In addition the manufacturing processes are different which also has an impact. You can't just use your SDRAM chips and put them in an SSD and call it a day.


for example a RAM disk (though volatile).

RAM is the acronym for Random Access Memory. There is no assumption or characterization about volatility. In fact, if you're old enough to remember, computers (but not PCs) up to the 1980s used (non-volatile) ferrite core memory. Battery-backed static RAM is another way to implement (main) memory that is non-volatile. Some devices like RAID cards actually need such mechanisms even today.

It's the (now prevalent) use of (synchronous) dynamic RAM for main memory and its attribute of volatility that leads to the (common but) faulty association of RAM and volatility.

  • RAM is (commonly) implemented by (synchronous) dynamic RAM.
  • (S)DRAM is volatile.
  • Therefore RAM is volatile. Improper (if not faulty) syllogism!
Seth
  • 9,393
sawdust
  • 18,591
0

Computer data storage has always been multi-level. Traditionally it looks like this, going from fastest to slowest, from smallest capacity to largest capacity, and from largest cost per byte to lowest cost per byte.

  • CPU register memory
  • L1 cache memory
  • L2..L4 cache memory
  • System memory
  • Disk (including SSD)
  • Removable disk
  • Tape

Not all systems have all of these levels. The first systems only had CPU registers and tape. Today's systems typically don't have tape, but tape is still alive and well, it's not gone!

In a little more detail, CPU register memory and L1 cache are typically SRAM, which is power hungry and bulky but very fast. Subsequent cache memories are further and further from the CPU with more overhead, and may be shared with other CPU cores, and thus are slower. System memory is additionally slower. System memory is currently DRAM.

Typically the speed differences from one level to the next are around 4-10x, so for you to say that 15G/s ram vs. 4G/s SSD are "close" is not correct, this is a huge difference, and typical for the speed difference from one level to the next.

Future technologies are coming that will change this picture. The next promising technology is MRAM, which uses fewer transistors per bit than SRAM, is almost as fast as SRAM, and is much faster than DRAM. And just for an extra twist, it is non-volatile, so it is no longer true that non-volatile memory is slower. The catch is that MRAM is not yet mature, and even though it uses less transistors than SRAM, it is sill larger because it hasn't been shrunk enough yet.

Actually, one of the early "fast" memories was core memory, which is also non-volatile, so this isn't the first time for non-volatile memory to be used for primary memory.

user10489
  • 2,081