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

memoryperformanceramdiskssd

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.

Best Answer

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.

Related Question