如题,见过一些工程同时使用Redis和Memcached,感觉这样很麻烦。
如果不是早期使用Memcached且难以移植到Redis,还有没有其他可能性?
高洛峰2017-04-22 09:01:06
This is how the former factory used it:
protobuf
encoding, with an expiration date of one week, as MySQL's second-level cacheSummary:
json
would become a bottleneck, so we later changed it all to json
的包装和解析会成为瓶颈,所以后来我们全部换成了protobuf
天蓬老师2017-04-22 09:01:06
When you need to support more data types besides key/value or when the stored data cannot be eliminated, it is more appropriate to use Redis. And if you just simply cache data, it is obviously more appropriate to use memcached. In other words, in comparison, redis is more suitable for storage, while memcache is more suitable for caching.
巴扎黑2017-04-22 09:01:06
Someone on stackoverflow asked this question "Is memcached a dinosaur in comparison to Redis?", and the author of redis gave the answer (http://stackoverflow.com/questions/2873249/is-memcached-a-dinosaur-in- comparison-to-redis). Overall, the performance of both is very good, so there is no need to worry about which one has higher performance. However, the persistence and data synchronization mechanisms provided by redis are not available in memcached, so if you want persistence, you can only use redis. In addition, memcached is sufficient for simple key-value storage, but if you want to use more advanced data structures, such as hash, list, set, zset, etc., redis provides these types, which are more convenient to use.