转载自:http://stackoverflow.com/questions/10558465/memcached-vs-redis

Updated 10/9/2014

Today marks the day that memcached no longer has any significant advantages over redis, while redis continues to have many distinct advantages over memcached. Today, redis 3.0, which includes Redis Cluster, entered the Release Candidate stage. Previously when looking at memcached vs redis you might have been inclined to choose memcached due to the 3rd party clustering tools available. Now redis offers clustering, and unlike memcached support is provided out-of-the-box. Being built-in provides a more robust solution that is easier to administrate. Combined with other high availability tools in-the-box like replication and Sentinel (monitoring), redis clearly has the more compelling scaling story today.

As of today every major feature and strength memcached offers are now a subset of redis' features and strengths. Any use case you might use memcached for redis can solve equally well. They are both lightning fast as volatile caches. While that's all that memcached is its only the tip of the redis iceberg.

Memcached is a volatile in-memory key/value store. Redis can act like one (and do that job as well as memcached), but it is a data structure server.

The Redis Superset

Here are a few of the features that redis offers which memcached doesn't and allows redis to be used as a "real" data store instead of just a cache.

  • Powerful data types and powerful commands to leverage them. Hashes, Sorted Sets, Lists, and more.
  • Persistence to disk, by default.
  • Transactions with optimistic locking (WATCH/MULTI/EXEC)
  • Pub/sub. Extremely fast.
  • Values up to 512MB in size (memcached limited to 1MB per key)
  • Lua scripting (as of 2.6)
  • Built in clustering (as of 3.0)
  • Extremely fast at everything. Benchmarks are often conflicting, but this much is clear: when used like memcached Redis falls somewhere between nearly as fast or maybe even a little faster. Like memcached it is often bound by available network or memory bandwidth instead of CPU or other bottlenecks and will rarely be the culprit when your app is slowing down.

The powerful data types are particularly important. They allow redis to provide a fantastic shared queue (lists), a great messaging solution (pub/sub), a good place for storing sessions (hashes), and a compelling place for high score tracking (sorted sets). These are just a few examples that scratch the surface.

Conclusion

To answer your original question: The performance and memory usage of Redis compared to memcached should be relatively similar. Close enough that for most uses any performance difference in either direction is academic as neither is likely to be the bottleneck.

Unless you already have a large investment in memcached, going forward redis is the obvious solution. For solutions both tools would solve, go with the one that offers more flexibility for new use cases and also provides better out-of-the-box availability, scalability, and administration: redis.

关于redis与memcached区别(转载自stackoverflow)的更多相关文章

  1. 白话Redis与Memcached区别

    如果简单地比较Redis与Memcached的区别,外在的区别是: 1  Redis不仅仅支持简单的k/v类型的数据,同时还提供list,set,zset,hash等数据结构的存储. 2  Redis ...

  2. Redis和Memcached区别

    本文参考 Redis与Memcached的区别. 如果简单地比较Redis与Memcached的区别,大多数都会得到以下观点: Redis不仅仅支持简单的k/v类型的数据,同时还提供list,set, ...

  3. Redis(Windows安装方法与Java调用实例 & 配置文件参数说明 & Java使用Redis所用Jar包 & Redis与Memcached区别 & redis-cli.exe命令及示例)

    Windows下Redis的安装使用 0.前言 因为是初次使用,所以是在windows下进行安装和使用,参考了几篇博客,下面整理一下 1.安装Redis 官方网站:http://redis.io/ 官 ...

  4. redis与memcached区别

    不同点: (1) redis中并不是所有数据在有效期内只能常驻内存的(如果需要,可定期同步持久化到磁盘),这是和memcached相比一个最大的区别(memcached中的数据在有效期内是以键值对的形 ...

  5. Redis和memcached区别须知

    1.支持的数据类型不同(memcached只支持简单的key-value的数据类型,Redis支持5种数据类型(1.string,2.list,3.set,4.zset,5.hash)) 2.redi ...

  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. C#语法——泛型的多种应用 C#语法——await与async的正确打开方式 C#线程安全使用(五) C#语法——元组类型 好好耕耘 redis和memcached的区别

    C#语法——泛型的多种应用   本篇文章主要介绍泛型的应用. 泛型是.NET Framework 2.0 版类库就已经提供的语法,主要用于提高代码的可重用性.类型安全性和效率. 泛型的定义 下面定义了 ...

  9. Redis与Memcached的区别

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

随机推荐

  1. passwd: Have exhausted maximum number of retries for service【转】

    使用命令passwd修改密码时,遇到如下问题: # echo 'utf8'|passwd zhangsan --stdin Changing password for user zhangsan. p ...

  2. MySQL版本升级参考资料【转】

    MySQL升级参考资料 MySQL 升级的最佳实践 - 技术翻译 - 开源中国社区https://www.oschina.net/translate/mysql-upgrade-best-practi ...

  3. plsql developer日期类型数据格式不对如何设置?

    当把一个数据库中的数据复制到另一个数据库时,如果数据中包含日期类型,会提示数据格式不正确.或者两个plsql developer设置不同,但实际上建表语句一样. 此时可在plsql中做如下设置: 首选 ...

  4. (并发编程)全局解释器锁(GIL)-----有了GIL不用给线程加锁了?

    一.全局解释器锁 (GIL)运行test.py的流程:a.将python解释器的代码从硬盘读入内存b.将test.py的代码从硬盘读入内存  (一个进程内装有两份代码---一份cpython解释器代码 ...

  5. javascript 练习题目答案

    //廖雪峰的博客的这个教程的答案//https://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb300 ...

  6. Numpy详解

    NumPy 简介 Python并没有提供数组功能.虽然列表可以完成基本的数组功能,但它不是真正的数组,而且在数据量比较大时,使用列表的速度会很慢.为此,Numpy提供了真正的数组功能,以及对数据进行快 ...

  7. java中文GBK和UTF-8编码转换乱码的分析

    原文:http://blog.csdn.net/54powerman/article/details/77575656 作者:54powerman 一直以为,java中任意unicode字符串,可以使 ...

  8. vue路径优化之resolve

    通过vue-cli来创建vue+webpack的项目时,已经有很多都配置好了,但是路径方面为了方便开发,还可以优化. 1. resolve.extensions 在webpack.base.conf. ...

  9. JS高级 - 面向对象3(面向过程改写面向对象)

    改写: 1.前提:所有东西都在 onload 里 2.改写:不能有函数嵌套,可以有全局变量 onload --> 构造函数 全局变量 --> 属性 函数 --> 方法 4.改错: t ...

  10. 《JavaScript 高级程序设计》第四章:变量、作用域和内存问题

    目录 变量的引用 执行环境及作用域 作用域链延长 块级作用域 垃圾回收机制 变量的引用 当一个变量保存了基本数据类型时,此时对于变量的操作(赋值,运算)就是操作这个基本数据的本身,就算是赋值操作,赋值 ...