5

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.

4
  • It is the difference between volatile and non-volatile memory. Non-volatile memory is slower and it is very "hard" on the electronics to "burn" (my highly technical term) in the data. Volatile memory is much faster and it is non destructive when you write to it. Costs are simply related to manufacturing techniques I'm sure. – Appleoddity Sep 24 '17 at 3:04
  • @DavidPostill -- This question does have a fact-based answer; I provided one. Just because this question also generates incorrect opinions and guesses would mean that you have to police a lot of other similar questions. This is the 2nd question of this type I've seen in two days. A technical answer (such as mine) needs to put this question to rest. There's a technical reason why you cannot even experimentally kludge SSD or HHD as RAM even if you are willing to tolerate the slower speed of a "disk": the square peg doesn't fit in the round hole. – sawdust Sep 25 '17 at 6:01
  • @sawdust Fair enough. Reopened. – DavidPostill Sep 25 '17 at 6:02
  • I don't see how almost three times to six times the speed would be "not far off" in comparison. – Seth Sep 25 '17 at 6:18
8

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.

6
  • Worth pointing out it normally (today) comes down to speed vs capacity. Which is the reason we have affordable 128 GB DDR4 modules but are struggling with the larger affordable SSD capacities. Eventually a standard will be developed that merges the capacity benefits of DDR and the speed of NAND at an affordable price – Ramhound Sep 24 '17 at 4:08
  • "It all boils down to latency." -- Assume I'm willing to accept this latency penalty by adding as many wait states as necessary. Then how does one replace memory with a SSD? – sawdust Sep 25 '17 at 9:42
  • @sawdust If you're talking about existing technology, of course not — for example, the x86 PC-compatible platform more-or-less requires DRAM (and in a modern context disk access goes through DMA anyway). But if you were building a system from scratch, there's not much stopping you from using a different memory technology. My answer here isn't to say why SSDs can or can't replace RAM, but rather why there's no point in even trying — because the premise in the question, that NAND speeds approach DRAM, is incorrect and looking at the wrong numbers. – Bob Sep 25 '17 at 10:04
  • That said, you do make the good point that NAND isn't byte-addressable — another argument against it. Any interface that tries to hide that difference will have huge performance penalties. – Bob Sep 25 '17 at 10:06
  • That said, I just realised that I'd basically neglected that those latency numbers are only for SSDs in real machines (via higher-latency interfaces), and not necessarily indicative of a dedicated NAND-based memory device. Which ... does mean this answer could be wrong. I'll review it in a few hours; tad busy right now. – Bob Sep 25 '17 at 10:11
2

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!
3
  • @Seth "RAM also needs to read a whole block of data" -- That's not true for all RAM. Apparently you're thinking of memory modules designed for enhanced performance. That's not a required design for all RAM. I work with ARM SoCs that connect to DRAM chips with a 32-bit data path, i.e. classic computer architecture.. "Cache and Registers are ..." -- Neither are part of or used for main memory. RAM in this context is synonymous with main memory of a computer. Your last sentence has bad grammar, and makes no sense. – sawdust Sep 25 '17 at 8:42
  • @Seth -- You're confusing internal details of a memory subsystem with a peripheral interface. That's apples and oranges. "...just to skip the D right after." -- You're not making sense. DRAM, SDRAM, and SRAM refer to actual memory technologies that have specific electrical characteristics, whereas RAM is just a functional characteristic. "SRAM isn't used for main memory" -- Wrong. I've used it on industrial SBCs. There was a PC motherboard that had SRAM for main memory; IIRC it made the cover of BYTE magazine back in the day. – sawdust Sep 25 '17 at 10:06
  • Yes, but 128GB of SRAM would be prohibitively expensive for most people/organisations. Even 128GB ecc ddr4 3200 (not an official jdec spec afaik but such modules exist) is prohibitively expensive for most people. Ram manufacturers are colluding (likely tacit collusion so good luck proving it + it is technically legal even if it shouldn't be) to keep memory prices artificially high. 32 GB ddr3 was ~100 eur in 2015. By now that should be the price for 128 GB ecc ddr4 3200. What's the actual price? I'm afraid to check since I don't want to get a heart attack just yet. – orange_juice6000 Apr 27 '19 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.