`
linmomo02
  • 浏览: 179010 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

redis 的理解

阅读更多

 

Memcached真的过时了吗?

这两年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? (其他人的回答同样值得一看)

 

转自:http://blog.nosqlfan.com/html/3729.html

分享到:
评论

相关推荐

    redis之相关理解分析以及面试问题总结

    redis之相关理解分析以及面试问题总结,以及更加深入的理解redis存储机制

    redis桌面链接工具redis-desktop

    redis桌面链接工具redis-desktop ...使用Redis Desktop Manager有助于简化Redis数据库日常管理任务,提高开发效率,并且由于其可视化的特性,使得非技术背景的用户也能更容易理解Redis中存储的数据结构和内容。

    Redis面试题50道(含答案)_.pdf

    26、怎么理解 Redis 事务? 27、Redis 事务相关的命令有哪几个? 28、Redis key 的过期时间和永久有效分别怎么设置? 29、Redis 如何做内存优化? 30、Redis 回收进程如何工作的? 31、Redis 回收使用的是什么算法?...

    Redis面试专题30道.zip

    1、什么是 Redis?...26、怎么理解 Redis 事务? 27、Redis 事务相关的命令有哪几个? 28、Redis key 的过期时间和永久有效分别怎么设置? 29、Redis 如何做内存优化? 30、Redis 回收进程如何工作的?

    Redis in action,Redis入门指南和Redis实战三本书

    此资源包括redis in action,redis入门指南和Redis实战。对于理解和学习redis非常有用!

    Redis实战中文PDF

    redis快速入门及加深对redis的理解

    redisStudy.zip

    其他解决方案:使用布隆过滤器(guava 19开始已支持布隆过滤器) 备注:如果你可以理解太白老师讲的基于redis位图自己实现的布隆过滤器,可以说说,更加分 7.缓存击穿 缓存击穿是指缓存中没有但数据库中有的数据...

    redis面试复习.xmind

    ### redis与memecache区别(我们直观能理解的部分) ### redis数据类型 (这里对每个数据类型做了一些我个人能理解到的解释,包括实现的数据结构等) # redis持久化 ### 写了快照和命令行模式的优点缺点 (按道理的话本...

    redis设计与实现, 对于理解redis很有好处

    redis设计与实现, 对于理解redis很有好处

    Redis资料+实例讲解

    Redis资料,详细专业学习redis,更好理解redis,更有实例讲解

    深入了解redis

    深入了解redis,希望大家仔细研究redis,了解redis的原理

    Redis系列:深刻理解高性能Redis的本质.doc

    Redis系列:深刻理解高性能Redis的本质.doc

    Redis实战 一本书理解Redis思想

    Redis实战,Redis是一个数据库,比Memcache更优的性能。轻松实现数据缓存,

    狂神说-Redis完整版笔记

    学习狂神说-Redis视频笔记,笔记完整并且加入了个人的理解和认知,笔记工整清晰,而且适合记忆学习。

    redis中文注释版.conf

    redis的中文注释版,对redis中的内容添加了详细的中文注解,方便理解和修改配置!!! redis的中文注释版,对redis中的内容添加了详细的中文注解,方便理解和修改配置!!! redis的中文注释版,对redis中的内容添加...

    Spring boot 和 Redis集成例子.zip

    Spring boot 和 Redis集成例子,通过代码理解Spring boot 和 Redis集成。

    redis架构分析.docx

    因为近期项目中开始使用Redis,为了更好的理解Redis并应用在适合的业务场景,需要对Redis设计与实现深入的理解。 我分析流程是按照从main进入,逐步深入分析Redis的启动流程。同时根据Redis初始化的流程,理解Redis...

    redis实战pdf

    redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型)。这些数据类型都支持push/pop、add/...

    redis启动流程

    redis 学习 理解 入门 掌握等 主要讲述redis启动运转全部流程 可以经常看下 会对redis掌握更为熟练 适合建立学习体系等同学

    2023年Redis缓存面试题目汇总

    你如何理解Redis的复制?它有什么作用? Redis的集群是如何实现高可用的? 你如何保证Redis的安全性? 你如何优化Redis的性能? 在什么情况下你会使用Redis事务? Redis事务的ACID性质是什么? Redis的Lua脚本有什么...

Global site tag (gtag.js) - Google Analytics