原文:http://blog.163.com/sun_jian_zhang/blog/static/187804041201310795917333/
1. Redis中,并不是所有的数据都一直存储在内存中的,这是和Memcached相比一个最大的区别。
2. Redis不仅仅支持简单的k/v类型的数据,同时还提供list,set,hash等数据结构的存储。
3. Redis支持数据的备份,即master-slave模式的数据备份。
4. Redis支持数据的持久化,可以将内存中的数据保持在磁盘中,重启的时候可以再次加载进行使用。
Redis在很多方面具备数据库的特征,或者说就是一个数据库系统,而Memcached只是简单的K/V缓存
来看下Redis作者对比redis和memcache
来源:《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会是不错的选择。
1、 Redis和Memcache都是将数据存放在内存中,都是内存数据库。不过memcache还可用于缓存其他东西,例如图片、视频等等。
相关推荐
1、Redis和Memcache都是将数据存放在内存中,都是内存数据库。不过memcache还可用于缓存其他东西,例如图片、视频等等; 2、Redis不仅仅支持简单的k/v类型的数据,同时还提供list,set,hash等数据结构的存储; 3...
1、里面包含Redis、MongoDB、Memcache相关的学习文档 2、对这三者有比较详细的应用场景告之,并描述出了三者之间区别 3、提供JAVA连接Redis常见问题的解决方案 4、对MongoDB的特性有专门文档作描述 5、对于新手而言...
实现redis和memcache的基本功能,做缓存实例处理的最快实现。
包含Redis,memcache,encache的NoSQL入门
windows php7.3.~redis和memcache扩展包,每次安装都要找好久,存到这里分享一下吧
memcache和redis是互联网分层架构中,最常用的KV缓存。不少同学在选型的时候会纠结,到底是选择memcache还是redis。
各系统版本安装redis以及memcache时对应所需要的扩展包
文件中包含MemCache和Redis的jar包、下载的exe文件以及相关介绍和配置!
memcache、redis、tair性能对比测试报告,分布缓存技术预言中有包括ehcache、memcache、redis、tair,还包括了基于MongoDB的分布式技术。测试中,考虑到各自功能的差异化特点,其中选择了memcache、redis、tair功能...
该脚本基于阿里云服务器安装脚本,并只能运用于centos / aliyun os(因为内部使用了yum安装unzip和dos2unix),该脚本使用时,需要与阿里云安装脚本的install.sh放在同一目录下。有缘人切忌乱用
NULL 博文链接:https://greemranqq.iteye.com/blog/1997809
花了好长时间才收集齐,除memcache php7的是csdn中下(在线查毒安全),其它全部php.net中下载 花了好长时间才收集齐,除memcache php7的是csdn中下(在线查毒安全),其它全部php.net中下载
使用c#读取memcached中的数据,再转移到指定的redis中。解决比如token的保持,让客户端登录不效。
它提供以下内容: 支持Redis和Memcache协议(文本和二进制) 多线程多客户端执行多种配置选项,包括: 阅读:写比率随机和顺序密钥名称模式策略随机或远程密钥到期Redis集群TLS支持...以及更多阅读更多信息:入门...
memcache&redis构建缓存服务pdf文档
windows平台下php5.3.13memcache和redis扩展
memcache redis tair 性能测试报告,精心准备的常用缓存工具的性能测试报告,非常详细
为什么使用 Redis,不用 Memcache 和 MongoDB?
Redis 安装1、Redis的数据类型: 字符串、列表(lists)、集合(sets)、有序集合(sorts sets)、哈希表(hashs)2、Redis和memcache相比的独特之处: (1)redis可以用来做存储(storge)、而memcache是来做缓存...