Versions Compared

Key

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

...

对于每个 key, 后面的 Regions 默认情况下是分区的, 但是默认的 region 类型能够通过系统属性来配置. 如果不同的 keys 被要求有不同的 Region 类型, 这些Regions 必须被定义在 cache.xml中. 其他配置需要考虑应用场景 定义了 worker 线程的数量为 Redis客户端使用. This is also defined by system property and more information can be found in the GemFireRedisServer javadoc. To put it all together, this adapter can be instantiated through invoking 它也能够通过系统属性来定义, 更多的信息将在 GemFireRedisServer javadoc中描述. 为了将它们放到一起, 此适配器能够被实例化, 通过独立调用 com.gemstone.gemfire.redis.GemFireRedisServer independently or programmatically, or through GFSH when the property 或者通过 GFSH,  当属性 redis-port is set被设置.
Supported Key commands: DEL, DBSIZE, EXISTS, EXPIRE, EXPIREAT, FLUSHALL, FLUSHDB, KEYS, PERSIST, PEXPIRE, PEXPIREAT, PTTL, SCAN, TTL

...

Supported Transaction commands: DISCARD, EXEC, MULTI

6. Comparison to Redis 进行比较
如下点是 The following points are the main differentiators between Geode/GemFireRedisServer and Redis和 Redis的主要区别
6.1 Concurrency并发性
  • Redis is a single-threaded server. It is not designed to benefit from multiple CPU cores. People are supposed to launch several Redis instances to scale out on several cores if needed. It is not really fair to compare one single Redis instance to a multi-threaded data store.是单线程服务器.它并没有设计成多核CPU的执行服务器. 通常情况下, 大家启动多个 Redis 实例, 如果需要的话. 当然, 一个 Redis单实例和一个多线程数据存储比较是不公平的.
我们已经利用了Geode高并发地特性来使 GemFireRedisServer 获得了高并发的能力. 每个服务器实例将启动 4 * (CPU 核数) 线程来响应客户端请求,  但是它能够通过系统属性来配置,每个连接一个线程被创建, 或者一个特定数量的客户端处理器线程能够被请求We have leveraged the highly concurrent nature of Geode to make GemFireRedisServer concurrent. Each server instance will start 4 * (number of processor cores) threads for processing client requests,  but this can be configured by system property where either one thread per connection can be created or a specific number of client handler threads can be requested.
6.2 Scalability可扩展性
在 Redis中, 一个单数据结构不能扩展, 超过了内存可用大小In Redis, a single data structure cannot scale beyond the memory available on a single box. From: http://redis.io/topics/partitioning
  • The partitioning granuliary is the key, so it is not possible to shard a dataset with a single huge key like a very big 分区粒度是按 key, 因此它不可能分片一个带有大 key 的数据集, 如一个很大的 sorted set.
(In Redis在 Redis中, key is the name of the data structure, so a 是数据结构的名称, 因此一个 hashmap.get() take the form 以 HGET key fieldfield的形式出现)
This limitation is not expected to go away even with the introduction of redis-cluster (which is going to partition the key space i.e. data structure name space). So, with Redis cluster you can scale up the number of data structures, not the data structures themselves.
随着 redis 集群引入, 这些限制也没有随之消失, 按照 key space(数据结构命名空间) 进行分区. 因此, 在 Redis 集群中你能够扩展数据结构的数量, 但是不能够扩展数据结构本身.
在 GemFireRedisServer中, 所有 Redis 数据结构通过PartitionedRegions支持, 因此每个 Redis 数据结构是水平扩展的In GemFireRedisServer, all Redis data structures are backed by PartitionedRegions, so each Redis data structure is horizontally scalable
6.3 Replication复制
In Redis, you can have any number of slaves for a master server. Replication from master to slave is always asynchronous, which may lead to data loss when master crashes before replicating.
When a slave is started, it gets entire data set from the master (even though the salve was persistent). It does, however, support a "Partial resynchronization" from master to slave, if the link between master and slave goes down.
Slaves can be used for scaling read operations.
在 Redis中, 对于一个 master 服务器, 你能够有任意的slaves数量. 从 master 复制到slave 经常是异步的, 在复制之前, 当 master 故障时导致了数据丢失.
当一个slave 启动时, 它从master获得整个数据集 (虽然 salve 是持久化的). 它支持一个 "Partial resynchronization" 从 master 到 slave, 如果在master 和 slave之间 link 断掉后.
Slaves  被用于扩展读操作.
在 Geode中, 你能够配置3个冗余拷贝 (对于分区Regions).  当持久化时, 这些复制节点先从本地磁盘中恢复, 只从主节点上获得delta.  这些拷贝被用于读取操作In Geode, you can have upto 3 redundant copies (for partitioned regions). When persistent, these replicas will first recover from local disk and only get the delta from the primary.  These copies can be used for read operations
6.4 Persistence持久化
Redis supports Snapshots as well as 支持快照, 如 AOF (Append Only)  persistence持久化. AOF is a log of all the operations, which needs to be rebuilt on re-starts. AOF is automatically re-written when it gets too large.是所有操作的日志, 在重启的时候需要重新构建. 当太大的时候, AOF 被自动重写.
Geode 持久化也是 append only, 而 keys 和 values 保存在磁盘上的单独文件中. 在重启时, 只有 key 文件需要读取Geode persistence is also append only, however keys and values are kept in separate files on disk. On restarts, only the key's file needs to be read.
6.5 HA
Redis uses Sentinel for managing HA. User starts a number of sentinel processes by providing them a list of all the masters (the slaves are automatically detected). When a primary crashes, the sentinels gossip and elect a new primary from among the slaves.使用 Sentinel 来管理 HA高可用. 用户开启一些 sentinel processes 通过提供它们在所有的masters列表上 (slaves 被自动检测到). 当主节点出现故障时, sentinels gossip 和 从 slaves 中选举新的主节点成员.
在Geode中, 所有成员都与其他成员连接, 故障切换是自动的. (不需要提供所有的成员列表In Geode, all members are connected to all other members, failover is automatic. (no need to provide a list of all members, which is error prone)
6.6 Network Partition网络分区
With the sentinel approach, there is no real protection from network partition. The documentation mentions that write quorum should be used to guard against writing to a primary on the loosing side, however, since the replication is asynchronous, there will still be some amount of data loss. (This will be fixed with redis-cluster, no more need of sentinels for partition detection)
Geode has network partition detection built in. The loosing side servers will shutdown/fence themselves, so that clients cannot connect to them.
7. Performance and Scalability
到达时, 网络分区其实并没有真正的保护. 写Quorum 将被用于防护写入到主节点, 然而, 复制是异步的, 仍然有一定量的数据丢失. (这将在edis-cluster中修复, 在分区检测上不需要太多的 sentinels 帮助)
Geode 内置了网络分区检测机制. 松耦合的服务器将停机, 因此客户端不能连接到它们.
7. 性能和扩展性
 redis-benchmark 可以对 Redis 进行压力性能测试. 所有的测试都使用'裸金属'方式部署每个节点和客户端These are some performance numbers acquired using the redis-benchmark utility. All these tests are run using separate bare metal machines for each node and client.
Run using no pipelining and 1KB payloads

Redis

SET: 100894.94 requests per second

GET: 103504.02 requests per second

INCR: 99662.14 requests per second

SADD: 99559.35 requests per second 

GemFireRedisServer

SET: 87627.06 requests per second

GET: 102988.52 requests per second

INCR: 92251.61 requests per second

SADD: 92254.50 requests per second

 

Pipelining 16 requests at a time

SET: 109277.91 requests per second

GET: 113583.70 requests per second

INCR: 1061300.75 requests per second

SADD: 989119.69 requests per second

GemFireRedisServer

SET: 109109.55 requests per second

GET: 113523.87 requests per second

INCR: 575023.25 requests per second

SADD: 644678.81 requests per second

Scalability is not within the framework of this specification as Geode handles the scaling independently of this implementation扩展性并不在本规范的讨论范围, Geode 处理扩展性独立于此实现.
8. Testing
TBD
9. Documentation

...