4 ms·
What's better about Redis? Many caching strategies require the storage to auto expire, memcache does this automatically. Redis does not do this (I believe). Is
by nahname 13y ago
What's better about Redis? Many caching strategies require the storage to auto expire, memcache does this automatically. Redis does not do this (I believe). Is it significantly faster?
- est 13y agoA simple Google search defeats your belief http://redis.io/commands/set http://redis.io/commands/set > Options > EX seconds -- Set the specified expire time, in seconds. http://redis.io/commands/expireat http://redis.io/commands/expireat > EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970)
- sheldoan 13y agoIn addition, the Redis config file allows you to specify an eviction policy when the maximum memory limit is reached: # volatile-lru -> remove the key with an expire set using an LRU algorithm # allkeys-lru -> remove any key accordingly to the LRU algorithm # volatile-random -> remove a random key with an expire set # allkeys-random -> remove a random key, any key # volatile-ttl -> remove the key with the nearest expire time (minor TTL) # noeviction -> don't expire at all, just return an error on write operations Source: https://raw.github.com/antirez/redis/2.6/redis.conf https://raw.github.com/antirez/redis/2.6/redis.conf
- nahname 13y agoI apologize for not being specific. Setting timed expiration is not what I meant. Memcache will fill the entire cache and auto select items to be destroyed, based on current resource availability and order of entry into the cache (FIFO). I want that behaviour. I do not want to set and manage the time things expire.
- est 13y agoThat's covered as well http://oldblog.antirez.com/post/redis-as-LRU-cache.html http://oldblog.antirez.com/post/redis-as-LRU-cache.html
- nasalgoat 13y agoIt's all the functionality of memcache, plus persistence and data types like lists or sorted sets. You have much more control of your data. It's the swiss army knife of in-memory data stores.