About the use of memcached and Redis scene, according to the great God's discussion and I found the information on the Internet, summed up: The comparison: The Redis provides data persistence function, memcached no persistence; Redis's data structure is richer than memcached, and can accomplish things beyond the scene; memcached's single key is limited to 512MB of K and V in 1mb;redis, of course, these values can be modified in the source code; Memcached Data recycling is based on the LRU algorithm, Redis provides a variety of recycling strategies (including LRU), but the expiration logic of the Redis recovery policy is not dependent on the existence of a key to determine whether the expiration. However, it can be judged whether the expiration is based on the TTL return value, memcached using multiple threads, and Redis using a single-threaded, high-speed access based on Io multiplexing. So it can be understood that in extreme cases memcached throughput is greater than redis. Redis Hgetall's pit, you can check it out on the Internet. Conclusion: ordinary kv scene: Memcached, Redis all can. From the point of view of the single function module, recommend memcached, only do the cache one thing. In the case where the kv length is large, the data structure is complex (such as taking a piece of data of a value), need to be persisted, it is more suitable to use Redis: But when using Redis, the blocking of a single request causes a backlog of subsequent requests, needing attention to the code base memcached:
Https://github.com/memcached/memcached/blob/master Redis code Base:
Https://github.com/antirez/redis