10 ms·
Why I like Redis
- andr 17y agoKey-value stores develop fairly quickly. We need an up to date comparison between their features and metrics (performance, code coverage, bugs filed per month, etc.).
- russss 17y agoWe made a start on this at the NoSQL meetup, the spreadsheet is here: http://spreadsheets.google.com/ccc?key=0Ale_YaCwKEUVclVFVFlrUWt5aWhQaGQ0OXVCMUl4Vmc&hl=en http://spreadsheets.google.com/ccc?key=0Ale_YaCwKEUVclVFVFlr... It covers a bit more than KV stores - it's basically all of the non-relational data stores. If anyone wants access to update it, let me know.
- nico 17y agoThanks! nice work. Would love to see some kind of benchmark on that table though. I know it's hard to compare, but maybe add some comments to the results?
- antirez 17y agoHello, it seems unfair for me to update the doc, but I can give you some info. Language: C License: BSD (new version) Partitioning: Client Expansion: not sure about the meainig SLOC: 9262 including all the libs, no external dependence Persistence: snapshotting on disk Client protocol: custom ASCII Data model: data structures (Strings, Lists, Sets) Docs: can't rate it myself Community: It's more known inside the Ruby community AFAIK
- aolnerd 17y agoNice work. It would be nice to know which projects have production sites that store the primary copy of data in these projects, as opposed to a secondary copy that is used for fast reads.
- mahmud 17y agoWho do I contact about reviewing Lisp K/V stores? I would double the content of your list and give exposure to some Lisp gems you haven't heard of :-) Yes, Lisp stores with C API :-D AllegroCache, Elephant and ManarDB.
- russss 17y agoNever heard of any of them, but then I don't code Lisp ;). I have to say that I'm only considering free, open source solutions in that spreadsheet.
- mahmud 17y ago~3 are MIT licensed. I have brewed up my own thing as well. Shoot me an email will ya? or I can get yours off of the .uk site in your profile. Cheers!
- joubert 17y agoElephant now has its own native storage? (When I used it last it still relied on BerkeleyDB or a SQL store for data persistence).
- mahmud 17y agoElephant has various backends, a Redis backend looks inevitable, imo ;-)
- holygoat 17y agoI'd call AllegroCache and Elephant object persistence frameworks, not KV stores. AllegroCache can store persistent maps and sets, so you could use it as a KV store, but that's hardly taking advantage of its power.
- yummyfajitas 17y agoSide note: how does Tokyo Tyrant get listed as a "highly scalable data store"? The only way you can scale with TT is by buying a bigger machine.
- wmf 17y agoYou're missing eXist, MonetDB, Sedna, etc.
- mumrah 17y agoIs there some reason why Amazon SimpleDB not included these type lists? It always seems to be excluded from NoSQL discussions
- antirez 17y agoThere is the wrong idea that it's simple to compare KV stores. Actually they are very very different beasts, for instance Redis is not a plain KV store, it can perform even high level stuff for you server side, including sortings, intersections between sets, and so on. So for instance even if you know that the KV store "Foo" is faster and has better coverage than "Bar" you can't just pick "Foo". It's like a programming language. Most KV stores are proposing some kind of data model, not just an implementation of a distributed persistent hash table. The kind of comparison needed in my opinion is a document explaining the different data model of the different projects, and of course also more general information like speed, test coverage, user base, and so on.
- thegoleffect 17y agoI like redis a lot. It feels like an extension of python that gives you orthogonal persistence for free.
- jhammerb 17y agoSee http://bitbucket.org/_ben_/cassdict/overview/ http://bitbucket.org/_ben_/cassdict/overview/ for an implementation of orthogonal persistence for Python's dictionary data structure using Cassandra.
- ntoshev 17y agoDoes anyone know what is the concurrency control used by Redis? I couldn't find anything related to transaction isolation in the docs.
- simonw 17y agoMany of the operations are documented as being atomic - you can get a surprisingly long way using atomically incrementing counters and atomic set operations. If you search through the Redis mailing list there are some interesting discussions around lock-free algorithms, CAS and potentially adding a LOCK command. There's also a recently commited SETNX command for atomically applying a number of changes to a set of keys at once.
- ntoshev 17y agoLock-free algorithms can be very fast, but they are also hard to implement. It seems Redis is going to get some lock-based pessimistic concurrency control eventually: http://groups.google.com/group/redis-db/browse_thread/thread/6b8ccada4d4b79fa/cfccd6ef0409ea79 http://groups.google.com/group/redis-db/browse_thread/thread...
- antirez 17y agoIndeed there are plans for LOCK / TRYLOCK and UNLOCK. It's just a matter of time, because from the feedbacks from the community it seems like sorted sets and hashes are the priority, together with strategies to improve the memory usage. For instance Redis edge (the latest git version) is able to save a lot of RAM (more or less 25%) encoding in a particular way objects that can be represented as integers internally, but there is still a lot of work to do in this regard.
- henriklied 17y agoRedis is great. I use it in quite a few of my spare time projects. The versatility is my main reason for loving it. From working on large a dataset without waiting for it to finish loading (…as mr. Willison explained), to storing object properties in a webapp-environment, to simple persistent object queues, etc.. It's a very nice tool to have in the box.
- antirez 17y agoThis seems like the right thread to tell you I'm working on a new data type for Redis, that is, ordered sets: http://pastie.org/664270 http://pastie.org/664270 Any feedback is really welcomed, for instance, do you know of better data structures to do the work? I'm using a red black tree and an hash table. The pastie above documents the specification more or less. Thanks
- kingkilr 17y agoWhy not use a hashtable with a linked list running through it (basically the python ordered dictionary class without the mapping). I believe ruby 1.9 uses these for its default hash type.
- antirez 17y agoinsert in order inside a linked list is O(N), or I missed something? Maybe they are using some more advanced kind of linked list where it's possible to run a binary search (like skip lists or alike).
- kingkilr 17y agoSorry this assumes that you wanted consistent ordering, not necessarily that you want to be able to create arbitrary ordering for it. So you'd have insert ordering.
- papaf 17y agoI like the idea of Redis but it has the obvious limitation that it can only be used when the data you're working with will absolutely never grow bigger than available memory. This not only reduces the problems it can be used on but makes the Twitter example given on the Redis website very unrealistic.
- antirez 17y agoHello papaf. If you try to do the math of the number of messages you can hold using four 64 GB Linux boxes you'll find that it's a perfectly viable (and very scalable) solution to use Redis in a number of real-world scenarios. Note that with this setup you don't need N additional memcached servers, so all the $ can be spent in RAM for the DBs. Im my personal experience with high traffic web services what I discovered is that anyway when the on-disk dataset starts to get bigger than the available RAM performances are horrible anyway. Also note that when there is a lot of data to Index, the right thing to do can be the following: take all the metadata on Redis, for fast access. Take the "bulk" data on MySQL, just an incremental ID + Blob field. Perform queries against both. It is absolutely possible to add some kind of aging algorithm to swap not recently used keys on disk to Redis in order to allow for bigger than RAM datasets, but most people dealing with high traffic sites told me "don't do it, it's useless because we have access patterns that are more or less evenly distributed among the key space".
- simonw 17y agoJust out of interest, do you know what the largest Redis instance in production is? It would be fascinating to hear a case study about a real-life 16GB+ store.
- antirez 17y agoI don't know if they ever continued to use it in production, but there was a guy experimenting with a number of 128 GB Redis servers :) This guy found most of the bugs with huge datasets, and thanks to his work Redis 1.01 was tested in extreme conditions.
- 17y ago
- zacharypinter 17y agoAre there any talks/videos about redis available online? This was the only one I could find: http://mwrc2009.confreaks.com/13-mar-2009-19-24-redis-key-value-nirvana-ezra-zygmuntowicz.html http://mwrc2009.confreaks.com/13-mar-2009-19-24-redis-key-va...
- antirez 17y agoToday the is the NoSQL event in Berlin, and they plan to take videos of the talks. (http://nosqlberlin.de/ http://nosqlberlin.de/) Unfortunately my spoken English is even worse than my written one, so go figure what can happen if I try to make Redis videos... :) Edit: another video by Bob Ippolito: http://blip.tv/file/1949416/ http://blip.tv/file/1949416/
- dualogy 17y agoDang I missed this simply because I was busy developing =/
- antirez 17y agoedit: all this is based on retwis.antirez.com memory usage. Ok, just did some math. In order to run Twitter using just Redis 1.001 without to use any new feature that may allow for memory savings, and guessing that Twitter currently contains 4,000,000,000 of tweets (assuming they save the full history for all the users, and that the recent 32 bit overflow means they rougly have 4 billion messages), 30 128GB Linux Boxes are needed. Is this crazy? I don't know honestly as I don't know how many servers they may be using currently for the DB backend. Btw the whole point is, IMHO, that many times to take the full dataset on Redis is not needed. For instance in twitter only recent messages are accessed frequently, together with user data, so it's probably a good idea to take only the latest N messages of every user in Redis (with background jobs moving old messages on disk incrementally), and take all the rest on MySQL or other on disk solution suitable to access stuff by-id. So when you want to get a message from Redis, and from time to time get a NULL accessing to message:<id> you can run the same query against MySQL to get the data. That's something like this: def getMessageById(id) m = redis.get("message:"+id) if !m m = getMessageFromMySQL(id) end return m end In this context it is very simple to move old messages from a Redis server to a MySQL server, since messages are on a redis list, so it's possible to RPOP to get old elements, if LLEN (List length) reports that this user has more tweets that we want to take in the "fast path". Also note that Redis supports expires in keys. So old messages got from MySQL can be set as expiring keys in order to avoid that a message that got linked in some front page will stress the MySQL too much. This is just to give a feeling about scaling a pretty big service using Redis as main DB without caching layers.
- antirez 17y agoI'm investigating about this issue more, it could be very interesting to know how many tweets twitter itself is indexing currently to do a precise estimation.
- antirez 17y agoOh... I just found this in the high scalability web site (http://highscalability.com/scaling-twitter-making-twitter-10000-percent-faster http://highscalability.com/scaling-twitter-making-twitter-10...): Update 6: Some interesting changes from Twitter's Evan Weaver: everything in RAM now, database is a backup; peaks at 300 tweets/second; every tweet followed by average 126 people; vector cache of tweet IDs; row cache; fragment cache; page cache; keep separate caches; GC makes Ruby optimization resistant so went with Scala; Thrift and HTTP are used internally; 100s internal requests for every external request; rewrote MQ but kept interface the same; 3 queues are used to load balance requests; extensive A/B testing for backwards capability; switched to C memcached client for speed; optimize critical path; faster to get the cached results from the network memory than recompute them locally.
- huyegn 17y agoI LOVE redis, I'm surprised there is so much talk about tokyo cabinet et al, but noone says anything about redis. It's dead simple to setup. The python libraries are super easy to work with. For simple persistence and queue-like abilities there's nothing that can match it.