原文:http://blog.nosqlfan.com/html/3729.html

这两年Redis火得可以,Redis也常常被当作Memcached的挑战者被提到桌面上来。关于Redis与Memcached的比较更是比比皆是。然而,Redis真的在功能、性能以及内存使用效率上都超越了Memcached吗?

下面内容来自Redis作者在stackoverflow上的一个回答,对应的问题是《Is memcached a dinosaur in comparison to Redis?》(相比Redis,Memcached真的过时了吗?)

  • You should not care too much about performances. Redis is faster per core with small values, but memcached is able to use multiple cores with a single executable and TCP port without help from the client. Also memcached is faster with big values in the order of 100k. Redis recently improved a lot about big values (unstable branch) but still memcached is faster in this use case. The point here is: nor one or the other will likely going to be your bottleneck for the query-per-second they can deliver.
  • 没有必要过多的关心性能,因为二者的性能都已经足够高了。由于Redis只使用单核,而Memcached可以使用多核,所以在比较上,平均每一个核上Redis在存储小数据时比Memcached性能更高。而在100k以上的数据中,Memcached性能要高于Redis,虽然Redis最近也在存储大数据的性能上进行优化,但是比起Memcached,还是稍有逊色。说了这么多,结论是,无论你使用哪一个,每秒处理请求的次数都不会成为瓶颈。(比如瓶颈可能会在网卡)
  • You should care about memory usage. For simple key-value pairs memcached is more memory efficient. If you use Redis hashes, Redis is more memory efficient. Depends on the use case.
  • 如果要说内存使用效率,使用简单的key-value存储的话,Memcached的内存利用率更高,而如果Redis采用hash结构来做key-value存储,由于其组合式的压缩,其内存利用率会高于Memcached。当然,这和你的应用场景和数据特性有关。
  • You should care about persistence and replication, two features only available in Redis. Even if your goal is to build a cache it helps that after an upgrade or a reboot your data are still there.
  • 如果你对数据持久化和数据同步有所要求,那么推荐你选择Redis,因为这两个特性Memcached都不具备。即使你只是希望在升级或者重启系统后缓存数据不会丢失,选择Redis也是明智的。
  • You should care about the kind of operations you need. In Redis there are a lot of complex operations, even just considering the caching use case, you often can do a lot more in a single operation, without requiring data to be processed client side (a lot of I/O is sometimes needed). This operations are often as fast as plain GET and SET. So if you don’t need just GEt/SET but more complex things Redis can help a lot (think at timeline caching).
  • 当然,最后还得说到你的具体应用需求。Redis相比Memcached来说,拥有更多的数据结构和并支持更丰富的数据操作,通常在Memcached里,你需要将数据拿到客户端来进行类似的修改再set回去。这大大增加了网络IO的次数和数据体积。在Redis中,这些复杂的操作通常和一般的GET/SET一样高效。所以,如果你需要缓存能够支持更复杂的结构和操作,那么Redis会是不错的选择。

来源:Is memcached a dinosaur in comparison to Redis?(其他人的回答同样值得一看)

Redis与Memcached的比较(转)的更多相关文章

  1. 浅谈redis和memcached的区别

    缓存技术方面说到redis大家必然会联想到memcached,了解它们的人应该都知道以下几点吧 redis与 memcached相比,redis支持key-value数据类型,同事支持list.set ...

  2. Redis 对比 Memcached 并在 CentOS 下进行安装配置

    了解一下 Redis Redis 是一个开源.支持网络.基于内存.键值对的 Key-Value 数据库,使用 ANSI C 编写,并提供多种语言的 API ,它几乎没有上手难度,只需要几分钟我们就能完 ...

  3. Redis和Memcached整体

    Redis和Memcached整体对比 Redis的作者Salvatore Sanfilippo曾经对这两种基于内存的数据存储系统进行过比较,总体来看还是比较客观的,现总结如下: 1)性能对比:由于R ...

  4. redis、memcached、mongoDB 对比与安装

    一.redis.memcached.mongoDB 对比 Memcached 和 Redis都是内存型数据库,数据保存在内存中,通过tcp直接存取,速度快,并发高.Mongodb是文档型的非关系型数据 ...

  5. redis和memcached缓存

    memcached memcache开源的,高性能,高并发分布式内存缓存系统,天生支持集群 memcached下载地址: http://memcached.org/downloads python实现 ...

  6. Redis与Memcached的区别

    传统MySQL+ Memcached架构遇到的问题 实际MySQL是适合进行海量数据存储的,通过Memcached将热点数据加载到cache,加速访问,很多公司都曾经使用过这样的架构,但随着业务数据量 ...

  7. Redis和Memcached的区别详解

    转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/119.html?1455855360 Redis的作者Salvatore ...

  8. Redis和Memcached对比

    Redis和Memcached对比 这两年 Redis火得可以,Redis也常常被当作 Memcached的挑战者被提到桌面上来.关于Redis与Memcached的比较更是比比皆是.然而,Redis ...

  9. redis与memcached比较

    引用自:http://blog.csdn.net/e_wsq/article/details/23551799 最近需要用no-sql数据库来保存大量的数据,插入和查询都比较频繁,相对而言查询更加频繁 ...

  10. Redis和Memcached的区别

    From: https://www.biaodianfu.com/redis-vs-memcached.html Redis的作者Salvatore Sanfilippo曾经对这两种基于内存的数据存储 ...

随机推荐

  1. JDBC深度封装的工具类 (具有高度可重用性)

    首先介绍一下Dbutils:    Common Dbutils是操作数据库的组件,对传统操作数据库的类进行二次封装,可以把结果集转化成List. 补充一下,传统操作数据库的类指的是JDBC(java ...

  2. ASP.NET Web API 使用Swagger生成在线帮助测试文档,支持多个GET

    以下为教程: 在现有webapi项目中,nuget安装以下两个插件 swagger.net.ui swashbuckle 安装完毕后可以卸载Swagger.NET,此处不需要! 安装完毕后屏蔽以下代码 ...

  3. JS——覆盖显示,点击显示三层

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. Softmatic ScreenLayers 将截图存为psd格式

    Softmatic ScreenLayers 是 Mac 上的一款截图软件,它与众不同的地方是可以将截取的屏幕图片按PSD格式保存到本地,并且图片里的每一种元素都被单独放入一个独立的layer,比如M ...

  5. css3兼容代码

    1. 渐变:.gradient{ width:300px; height:150px; filter:alpha(opacity=100 finishopacity=50 style=1 startx ...

  6. easyui 扩展layout的方法,支持动态添加删除块

    $.extend($.fn.layout.methods, { remove: function(jq, region){ return jq.each(function(){ var panel = ...

  7. jquery 改变checkbox的值

    似乎没什么用... <script> $(document).ready(function(){ $("#comment").change(function(){ va ...

  8. 【BZOJ】1656:[Usaco2006 Jan]The Grove 树木(bfs+特殊的技巧)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1656 神bfs! 我们知道,我们要绕这个联通的树林一圈. 那么,我们想,怎么才能让我们的bfs绕一个 ...

  9. Git—怎样Windows操作系统中安装Git

    介绍一下怎样在Windows操作系统中安装Git: 一.下载Git安装压缩文件:http://download.csdn.net/detail/wangshuxuncom/8035045 二.解压该压 ...

  10. ActiveMQ安装优化

    ActiveMQ性能測试 http://m.blog.csdn.net/blog/brushli/41750615 1.下载ActiveMQ 官网:http://activemq.apache.org ...