Re:Redis and SQLite: Why wait for good enough?
by rapind on Thursday February 03, 2011 @08:55AM
(#2174692)
You can configure a redis DB using the maxmemory flag instead of setting expiries, so yes it can be used as an LRU cache.
Probably not as fast as memcached, but one situation where it would be appropriate is if you're already using redis in your stack for something else (fast writes). Rather than adding another piece of complexity to your stack you can instead get double use out of redis as a cache as well.
Re:Redis and SQLite: Why wait for good enough?
by mfenniak on Thursday February 03, 2011 @10:26AM
(#2175036)
My mistake, I was not aware of those configuration options. Thanks for the correction.
Re:Redis and SQLite: Why wait for good enough?
by rapind on Thursday February 03, 2011 @12:34PM
(#2175634)
Well in your defence, I don't think they're in the current stable release, but rather the 2.2 branch (RC).
Re:Redis and SQLite: Why wait for good enough?
by andrewvc on Thursday February 03, 2011 @12:38PM
(#2175657)
Except that algorithm isn't lru
Re:Redis and SQLite: Why wait for good enough?
by jamwt on Thursday February 03, 2011 @01:36PM
(#2175996)
It is in 2.2. Check out:
maxmemory-policy allkeys-lru
How do I know? We ( http://bu.mp ) push 100s of GB though redis every day in LRU mode.
Redis will only evict data when it's explicitly removed or expired, and it will store as much data as you put into it.
memcached will evict the least-recently used data based upon memory pressure, and will only use as much memory as you configure it to.
They overlap in functionality, but I find they work better in complement to each other than having one replace the other. Redis for data you want to persist, possibly with a timeout -- user sessions, for example. memcached for data you want to cache, as long you have the free memory for it.