For database servers with many writes, I am wondering why can't these ramdisk/ramdrive be a solution to avoid wearing out SSDs and to avoid losing data if too much is kept in normal ram. Can these have any benefit at all for db servers ?

enter image description here

  • What if the battery dies?
    – J.D.
    Sep 8 at 1:50
  • Then data will be collected again :) Avoiding data loss is not critical. But I am curious on why these are not used for db servers. Other than the battery risk.
    – adrianTNT
    Sep 8 at 2:05
  • Of course, but my point is they couldn't replace more durable storage like an SSD, albeit interesting nonetheless. 🙂
    – J.D.
    Sep 8 at 2:56
  • @J.D. Yes, the battery could die, but so could an SSD. These batteries are designed to be durable. And enterprise SSDs also contain capacitors in case of power failure, for the same reason. Normally these RAMdisks are backed by a regular drive, so it's just used as a cache. It's mainly because RAM is much more expensive than SSDs that we don't use RAMdisks. Sep 9 at 14:38
  • @Charlieface The capacitors aren't there to realistically prevent data loss, and an electrical engineer could explain the actual reasoning behind them. Despite cost per space differences, you can't discount the higher durability of an SSD than RAM. In fact, a big sell of SSDs over HDDs was the improved durability (since there's less moving parts / lack of spinning platters now). RAM which doesn't persist data, is definitely more susceptible to data loss even with a backup battery than an SSD is. But yes, there is also the limitation on how much RAM one can put into a machine realistically too.
    – J.D.
    Sep 9 at 14:58

The trouble with a RAM disk is that if it fails (or if just turned off), then everything in it just disappears, like the morning mist.

You say that your data "will be collected again", but into what?

Database != File 

In order to store data, the database process needs to have a Data File in which to put "stuff" and that Data File has to be formatted in a way that the database can make use of it.
If the RAM disk has been wiped clean, then the file that used to be there is gone ("Solid, Gone!") There is nowhere for the database to store the incoming data - in all likelihood, the database won't even start up, because it has a great big "hole" where one of it's Data Files used to be!

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.