Can anyone tell me why we don't just hook normal RAM up to a small rechargeable battery such that it can maintain its state during a power loss. Alongside that, there is an equivalent amount of flash memory. The flash is never used, except when you get within, let's say, 5% battery life, at which point the entire contents of the RAM are dumped to the flash. Then, on system start up, if the RAM is still loaded, swell. If there is a ram image on the flash drive, load that and continue as normal.
Isn't this essentially NVRAM? What are the downsides to it?
Battery-backed cache has probably been around even longer in write caches for large RAID systems.
The 5% power and shutdown is also how the Macbook laptops handle sleep. Sleep mode is a low power nothing-but-ram mode, and when the battery gets too low, it goes into 'safe sleep', basically a dump-to-disk all-powered-off hibernate.
The main reason it's not all that common is that for the sort of workloads you're prepared to pay for a shitload of RAM, you're probably just using it as a cache for a DB or some monster app, and actually keeping it around isn't that much of a priority. You've got failover somewhere else in the stack, and it's one less thing to buy and maintain.
The other critical flaw is that there is a (potentially huge) performance hit in presenting as a disk vs hanging off the northbridge MMU. Even the latest in new fancy SATA is hilariously slow compared to the actual memory bus (6Gbps for SATA3 vs maybe 100Gbps for DDR3[1]), and having all the filesystem abstraction on top, as in the titular article of this thread mentions, is a whole lot more overhead.
So yeah. We can. Sometimes people do. But it's probably easier and better to just stick it in the actual RAM slots, and use it differently for everything except 5-second boot times.
If you want battery backed ram you might as well use a UPS. There are also corruption issues. A failure can leave data structures in an inconsistent state that applications typically don't worry about in RAM.
Isn't this essentially NVRAM? What are the downsides to it?