Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question
    
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 '11 at 14:41
    
Check out Recommendation for an in-memory database. –  Lazer Oct 15 '11 at 6:01
    
Yes there some out there, for example CouchBase and Cassandra. Could you try those? –  tecnocrata Jul 24 '12 at 22:39

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.

http://mickeyben.com/2009/12/30/using-nginx-as-a-load-balancer.html

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

:)

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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