27

I am currently using Redis for my app, and its features are really excellent for my application (lists, sets, sorted sets etc.).

My application relies heavily on sorted sets, lists, sets. And their related functions (push to a list, get list, union of sets etc. The only problem I am facing right now is that my data is large, and most of my data does not need to be in memory, and I want to store them on disk.

**I need an on-disk database with redis data structures **

I read about Cassandra but I am not sure if it supports sorted sets, sets, lists. Or at least if it does, I could not find methods to manipulate them the way Redis does.

Thanks.

Pacemaker
  • 1,117
  • 2
  • 17
  • 36
  • does not redis save the data to disk? mine does. – akonsu Mar 12 '13 at 17:48
  • 3
    it does. But when it is running in memory, you cannot exceed the memory's size, I would like to store data that exceeds memory size, on disk. – Pacemaker Mar 12 '13 at 18:30
  • 4
    It's simply not practical to have many of the features of redis in a disk-based database system, because they could not be stored in the same way they are in-memory. You could not, for example, have O(1) look up times (an indexed simple select query in SQL is usually O(log(n)) for example). However, many of the features you are looking for are available in many sql databases - which are generally disk based (a table with a single column, the primary key, is a set - many DB's support unions etc). – Jonatan Hedborg Mar 13 '13 at 09:24

4 Answers4

11

There are numerous on-disk databases with Redis-like datastructures or even trying to be drop-in protocol-compatible replacements for Redis.

There are excellent recommendations in "Is there something like Redis DB, but not limited with RAM size?" - pity the community considers such questions to be off-topic.

In particular, SSDB is an actively-maintained Redis-like on-disk database (but not directly compatible), and Ardb is an actively-maintained drop-in replacement for Redis that stores the data on disk. Disclaimer: I have not used either of them (yet).

Community
  • 1
  • 1
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324
  • Thanks for the good answer. I cannot see how these questions are off-topic. I find redis's structure excellent for lots of applications that it is a must to have a similar on-disk database like that. – Pacemaker Jul 17 '14 at 10:06
  • I am the author of SSDB(a redis-like on-disk database), many company had replaced their redis instances with SSDB, including QIHU, BIDU. – ideawu Aug 07 '14 at 02:44
9

https://github.com/yinqiwen/ardb another REDIS protocol replacement with LMDB, RocksDB and LevelDB disk-based backend

nice benchmarks

Slach
  • 1,672
  • 13
  • 21
5

try Edis - Erlang implementation of Redis based on leveldb http://inaka.github.io/edis/

Slach
  • 1,672
  • 13
  • 21
0

I am encouraging you to learn Cassandra, while it has some things similar to key/value and sets, it is very different from Redis.

We currently moving one project from Redis (we use sadd / spop) to TokyoCabinet / KyotoCabinet via Memcached protocol. For the moment things looks good and very soon I will publish the lib on github - will be available here:

https://github.com/nmmmnu

and project will be called Simple Message Queue. It will support sadd / spop / sismember only. Also in Python you will be able to use new object instead of Redis object, but only for these three commands.

Hope this helps.


Update 2014.07:

Here is the project I am speaking about.

https://github.com/nmmmnu/MessageQueue

It implements both Redis and Memcached protocols. For back-end it uses memory ndb/mdb or berkeley db.

Nick
  • 9,962
  • 4
  • 42
  • 80
  • I do not understand why someone will do -1. Cassandra is almost like redis and my project is complete now and you can see it here: https://github.com/nmmmnu/MessageQueue - both redis and memcached protocols are implemented and works. Sure, my MessageQueue can not be used directly, but you can get the protocol class and made the rest. – Nick Jul 17 '14 at 13:32
  • 1
    I downvoted it because you state that there are no such databases, when there are. In fact, there are protocol-compatible drop-in replacements even. So this couldn't be further from the truth. I've removed the downvote, please remove that first sentence :) – Roman Starkov Jul 17 '14 at 16:40