Original address: http://blog.csdn.net/sunmenggmail/article/details/36176029
There is no need to pay too much attention to performance. because Redisonly single cores are used, andMemcachedMulti-core can be used , so on the comparison, on average each core Redis compared to 100k memcached performance is higher than redis redis is also recently storing Big Data for performance optimizations, but memcached
You need to focus on memory utilization. For key-value Such simple data storage, The memory utilization of span style= "Font-family:verdana" >memcache hash font-family structure Font-family:verdana ">redis
You need to focus on redis redis
You should be concerned about the actions you need. redis supports a lot of complex operations, even considering only memory usage, You can often do a lot in a single operation without having to read the data to the client (this will require a lot of io operation). These complex operations are basically the same as pure get post operation as fast, so you don't just need get/set But more action, redis
for the choice of the two is to see the specific application scenario, if you need to cache the data is only key-value Such a simple structure, I am in the project or the use of memcache , it is also stable and reliable enough. If you are involved in a series of complex operations such as storage, sorting, and so on, Redis is no doubt chosen .
As for the differences between Redis and memcache , here are some relevant statements for recording:
Redis and the Memecache the difference is [2] :
1, storage mode:
Memecacheall the data in memory, will be hung up after the power outage, the data can not exceed the memory size
RedisSome exist on the hard disk, this can guarantee the persistence of data, support the persistence of data ( author Note: There are snapshots and AOF Log two persistent ways, in the actual application, pay special attention to the configuration file snapshot parameters, or it is likely that the server is frequently loaded dump ).
2 , data support type:
Redis compared to data support memecache much more.
Personal summary, with persistent requirements or applications with advanced requirements for data structure and processing, choose Redis, other simple key/value storage, select memcache .
Redis and Memcache comparison and selection (reproduced)