六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 27|回复: 0

Redis, from the Ground Up(2)

[复制链接]

升级  22%

78

主题

78

主题

78

主题

举人

Rank: 3Rank: 3

积分
266
 楼主| 发表于 2013-1-28 18:26:04 | 显示全部楼层 |阅读模式
Key Disadvantages

Redis requires that the whole dataset be loaded into main memory at all times. (Redis Virtual Memory, which we’ll discuss later, relaxes this requirement, but still needs all keys to always be in memory.). Guaranteed in-memory access to most of the dataset is Redis' main performance driver — and is also responsible for creating its main limitations.
RAM

RAM is the gold of cloud computing. (Cloud servers are primarily priced based on the amount of available RAM. By comparison, disk and CPU are cheap.)
The amount of RAM that Redis needs is proportional to the size of the dataset. Large datasets in Redis are going to be fast, but expensive.
Persistence

Redis persistence is highly configurable but the implementation makes extremely heavy use of I/O resources. Furthermore, most save operations require additional memory to complete successfully, and, in some cases, asynchronous saves can block the server for lengthy periods of time. (These points are discussed in more detail, below; see thePersistence section.)
Memory Bloat

Redis' internal design typically trades off memory for speed. For some workloads, there can be an order of magnitude difference between the raw number of bytes handed off to Redis to store, and the amount of memory that Redis uses.
Diving In

String Keys

Regardless of the data type, the data is always identified by a key, and the key is always a string.
For example, using the string data type:
<div style="padding-top: 0.5em; padding-right: 1em; padding-bottom: 0.5em; padding-left: 1em; margin-bottom: 1em; font-family: monaco, monospace; line-height: 1.1em; background-color: #111111; color: #ffffff; font-size: 18px;" class="highlight">    redis> SET foo bar    OK    redis> GET foo    "bar"    redis> GET dne    (nil)
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表