I’m looking to start using a key/value store for some side projects (mostly as a learning experience), but so many have popped up in the recent past that I’ve got no idea where to begin. Just listing from memory, I can think of:
- CouchDB
- MongoDB
- Riak
- Redis
- Tokyo Cabinet
- Berkeley DB
- Cassandra
- MemcacheDB
And I’m sure that there are more out there that have slipped through my search efforts. With all the information out there, it’s hard to find solid comparisons between all of the competitors. My criteria and questions are:
- (Most Important) Which do you recommend, and why?
- Which one is the fastest?
- Which one is the most stable?
- Which one is the easiest to set up and install?
- Which ones have bindings for Python and/or Ruby?
Edit:
So far it looks like Redis is the best solution, but that’s only because I’ve gotten one solid response (from ardsrk). I’m looking for more answers like his, because they point me in the direction of useful, quantitative information. Which Key-Value store do you use, and why?
Edit 2:
If anyone has experience with CouchDB, Riak, or MongoDB, I’d love to hear your experiences with them (and even more so if you can offer a comparative analysis of several of them)
I recommend Redis. Why? Continue reading!!
I can’t say whether it’s the fastest. But Redis is fast. It’s fast because
it holds all the data in RAM. Recently, virtual memory feature was added but still all the keys stay in main memory with only rarely used values being swapped to disk.
Again, since I have no direct experience with the other key-value stores I can’t compare. However, Redis is being used in production by many web applications like GitHub and Instagram, among many others.
Redis is fairly easy to setup. Grab the source and on a Linux box run
make install. This yieldsredis-serverbinary that you could put it on your path and start it.redis-serverbinds to port 6379 by default. Have a look atredis.confthat comes with the source for more configuration and setup options.Redis has excellent Ruby and Python support.
In response to Xorlev’s comment below: Memcached is just a simple key-value store. Redis supports complex data types like lists, sets and sorted sets and at the same time provides a simple interface to these data types.
There is also
make 32bitthat makes all pointers only 32-bits in size even on 64 bit machines. This saves considerable memory on machines with less than 4GB of RAM.