3 ms·
Redis is not a cache, it is in-memory database. Aside of key-value storage with optional key TTL it has complex data structures with complex operations over the
by SergeAx 5y ago
Redis is not a cache, it is in-memory database. Aside of key-value storage with optional key TTL it has complex data structures with complex operations over them, it has horizontal and vertical clustering, atomic operations, disk persistence, and it can disable data eviction.
- cakoose 5y agoThe beginning of article acknowledges that Redis can do a bunch more things and explicitly scopes things down to caching use case: > None of the the above are going to be covered in any detail. If you do need any of the above functionality, then the answer is use Redis, don't read any further and go for a walk outside.
- SergeAx 5y agoThe only reason of using Redis as a dumb cache I can justify is an unwillingness to introduce another tech into tight stack. In my brief experience memcache also has better performance at scale.
- JensRantil 5y agoNah, Redis also has support for evicting keys when it runs out of memory, thus making it a cache.
- SergeAx 5y agoMy car also has an engine and at least two wheels, thus making it a cool bike)
- harryf 5y agoHaving worked with both, to me an untalked about advantage of memcached is it's a simpler tool - there are less ways to shoot yourself in the foot with it. From a code point of view the only real choice is whether you let LRU exclusively decide when expiry happens or whether you're attaching expiring times to values. Meanwhile Redis - used in a large codebase - seems to be tempting for developers to use it in different ways, sometimes as a cache, sometimes as a database. That in turn makes problems for devops who have to start worrying about how different redis instances are being used. Perhaps I'm just too much of an old goat but to me, reading through all the cool features Redis has, it smells like it violates the Unix philosophy of "do one thing, well" ( https://hackaday.com/2018/09/10/doing-one-thing-well-the-unix-philosophy/ https://hackaday.com/2018/09/10/doing-one-thing-well-the-uni... )