Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. Introduction介绍

本也描述了一个针对 Redis的适配器实现This page describes the implementation of an adapter to Redis.
2. Related Documents相关文档
Redis website网站http://redis.io/
Redis Data Types 数据类型 http://redis.io/topics/data-types
3. Terminology术语
Redis -  an open-source, networked, in-memory, key-value data store一个开源的, 网络化, 内存级, 键值数据存储

4. Requirements需求



5. Architectural 架构描述 Description

The adapter本适配器, called GemFireRedisServer称为GemFireRedisServer, understands the Redis protocol but uses Geode underneath as the data store. This allows Redis clients to seamlessly switch to Geode allowing them to obtain the same functionality as before but now on a distributed system. The point of emphasis in this server adapter is to handle all of the data types normally implemented in Redis. This includes 与 Redis 协议兼容, 但是使用 Geode 作为底层的数据存储引擎. 它允许 Redis 客户端无缝地切换到 Geode 上, 允许它们拥有和以前一样相同的功能, 但是是分布式系统. 这个服务器适配器的重点是处理所有的数据类型, 正常在 Redis 服务器上实现的. 这包括 Strings, Lists, Hashes, Sets and , SortedSets and HyperLogLogs. It is important to note that these terms are Redis specific and the server's handling of the data types will be as such. The specifics of each type will be detailed below这些术语都是 Redis 特定的, 服务器的数据类型处理也相同. 每个类型的规范详细描述如下.

5.1 Strings
Redis Strings are just strings of data. These are binary safe implying that they can be used to store any kind of data and have a maximum size of 512MB. All Strings of a cache will be stored in one Geode region.是数据字符串. 它是二进制安全型, 暗示着它们能够保存任意类型的数据, 最大的大小可以是 512MB. 一个 Cache 所有的字符串都可以使用一个Geode region来保存.
已支持的 Redis 字符串命令Supported Redis Strings commands: APPEND, BITCOUNT, BITOP, BITPOS, DECR, DECRBY, GET, GETBIT, GETRANGE, GETSET, INCR, INCRBY, INCRBYFLOAT, MGET, MSET, MSETNX, PSETEX, SET, SETBIT, SETEX, SETNX, STRLEN

5.2 Lists
Redis Lists are generally linked lists of Strings and the operations for the lists are designed around heavy access at the extremities of the list. Lists are stored in Geode by loose indexing and retrieved by querying. It is important to understand the limitations of Lists as they are implemented in this adapter. Geode has no implicit notion of lists and therefore lists are simulated in Regions. For this reason lists become data scalable at the expense of increased latency. As opposed to Sets or Hashes, which have no notion of order, Lists require extra care to ensure order and consistency which takes a heavy toll on performance. For example, the LPUSH command requires to determine the left most index of the list, append to the beginning of the list and update the index of the list. In Redis, lists do not scale and therefore these tasks are trivial but in Geode, even a simple pop/push on a distributed list can introduce multiple network hops. Also, because indexes are mapped to list elements, shifting list elements is unrealistic and LINSERT is not supportedLists 是一个字符串的Linked Lists,  此列表的操作被设计成可以进行达到 List 极限的重度访问. Lists 保存在 Geode 中, 通过松耦合的索引进行保存, 通过Query 进行查询. 理解 List 限制就显得十分重要. Geode 没有 Lists 的内隐观念, 因此 List 是在 Regions 中模拟出来的. 由于这个原因, lists 是数据弹性扩展的, 以增加延时为代价. 与Sets 或 Hashes相反, 它是无序的, Lists 需要格外地小心排序和一致性问题,  在性能上会有很大代价. 举个例子, LPUSH 命令需要确定 List 最左边的索引, 追加到 List 起始处, 同时更新 List 索引. 而在 Redis 中, lists 并不是可扩展的, 因此这些任务是不重要的, 但是在 Geode 中, 在分布式 List 中, 一个简单的 pop/push 操作都能够引入多个网络跳. 因为索引被映射到 List 元素中, 移动 list elements 是不现实的, LINSERT 是不支持的.

Supported Redis Lists commands: LINDEX, LLEN, LPOP, LPUSH, LPUSHX, LRANGE, LREM, LSET, LTRIM, RPOP, RPUSH, RPUSHX

...