Given that NoSQL databases are designed to support horizontal scalability by throwing in more servers, are there any that are designed to do entirely without persistent disk storage?

I'm looking at an application that requires horizontal scalability but that also needs to encrypt any data at rest. That could end up meaning pulling a lot of the data from the NoSQL database into an in-memory cache like memcached. That got me wondering: Is there any single product that had the scale and fault-tolerance characteristics of a NoSQL database but operated solely in memory?

  • Is there a specific platform you'd like to target? Here is a useful discussion on the topic that may be useful in getting started se-radio.net/2010/11/…
    – eradman
    Oct 13, 2011 at 14:41
  • Check out Recommendation for an in-memory database.
    – Lazer
    Oct 15, 2011 at 6:01
  • Yes there some out there, for example CouchBase and Cassandra. Could you try those?
    – tecnocrata
    Jul 24, 2012 at 22:39
  • @tecnocrata Cassandra is not in memory; it will cache the data in memory, but the first thing it does when it receives new data is write it to its journal. So it accesses the disk. Feb 7, 2022 at 22:59

3 Answers 3


The issue with storing your database in memory is if you have any sort of memoery issue or server has to be restarted or anything of that issue all your memory will get flushed.

That is the reason people don't store their database in memory.

Now, there are caching tools which are in-memory and can work as a very simple database like memcached. That may meet your needs. If you look in to tmpfs and ramfs you can create a folder that exists in memory and move your files in there normally.

So, if you are working with MongoDB, mysql or whatever you work with, you can have the data folder live in the RAM folder. This will give the database super fast read and writes. Everything will be really fast. You will be limited to how much RAM you have minus the size of your OS and other things running.

Also, just be careful: MongoDB likes to store writes in memory until the disk has a chance to write, it so you may want to turn that feature off because it will be the same speed.

My recommendation is to work with memcached and then mix it with a normal database that lives on disk. The concept is done with PHP sessions on some systems.


The basic way it works is, if your record is found in memcached, then it will not check the database. If it is not found, then do three(3) things:

  1. check the db
  2. send the data to memcached
  3. send the data to calling function



Redis can be used as a in-memory database by disabling both its rdb and aof based persistence .


I take it the data can be lost if it is all in RAM. Some of the products work much like an in-memory database already. For example Redis. Also mongodb which performs like an in memory database when the dataset is smaller than ram and more like a traditional database when the data set is much much bigger.

Another option that would work with anything is a ram disk.

  • "much much bigger" — I would think that it's still going to be smaller than the total RAM available when they start saving on disk, otherwise it would have to use the swap (if available) or just crash... Also they may save on disk either way (like Redis) in case of a crash or server restart. Feb 7, 2022 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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