一、什么是 Redis
REmote DIctionary Server(Redis) 是一个由 Salvatore Sanfilippo 写的 key-value 存储系统。Redis 提供了一些丰富的数据结构,包括 lists, sets, ordered sets 以及 hashes ,当然还有和Memcached一样的 string 结构(key-alue)。Redis当然还包括了对这些数据结构的丰富操作。
二、Redis vs. MongoDB vs. Memcache
系统 |
Redis |
Memcache |
MongoDB |
简介 |
advanced key-value ‘data structure server‘ |
distributed memory object caching system |
NoSQL database |
存储 |
内存映射文件 |
内存(LRU策略) |
内存映射文件 |
操作 |
|
SQL 的操作 | |
数据格式 |
任意小数据 (strings, objects) |
BSON (Binary JSON) | |
可靠性 |
依赖快照进行持久化,AOF[2] |
不支持 |
多备份 |
数据一致性 |
保证事务中的每个操作连续执行 |
|
基于 CAS 的一致性策略 |
扩展性 |
分区 |
分区 |
Sharding[1] |
三、Redis 的初探[3]
Redis 的状态转移图
请求处理模型
多副本
参考资料:
[0]. Redis 设计与实现:http://redisbook.readthedocs.org/en/latest/index.html
[1]. sharding 介绍, http://qing.blog.sina.com.cn/tj/88ca09aa330004tp.html
[2]. AOF 介绍, http://blog.nosqlfan.com/html/199.html
[3]. Redis 原理分析, http://www.cnblogs.com/shenguanpu/archive/2011/12/28/2305253.html
[4]. Redis及其产品定位, http://www.infoq.com/cn/articles/tq-why-choose-redis
原文:http://www.cnblogs.com/lf1205/p/3564954.html