Redis5.x:第一个稳定版本发布及新特性

star2017 1年前 ⋅ 321 阅读

在缓存领域,Redis 处于遥遥领先的地位,Redis 4 第一个稳定版本发布已经一年多,中间有些小版本的更新。

Redis 新的大版本 Redis 5 于 2018年10月17日(周三) 发布了第一个稳定版本:Redis 5.0.0 stable。

Redis 官网, Redis 5.0 release notes, Redis GitHub

Redis 5 新特性

  1. 引入新的数据类型:Stream,借签了 Kafka,以更抽象的方式模拟日志数据结构。

  2. Redis 定时器、集群、和字典模块新增了 API

  3. RDB 现在可存储 LFULRU 信息。

  4. 集群管理器抛弃之前 Ruby(主要依赖 redis-trib.rb 脚本) ,改为完成由 C 来实现,查看redis-cli --cluster help了解更多信息。

  5. 新的有序集命命令:ZPOPMIN/MAX和 阻塞变种(blocking variants) 。

  6. 升级 Active defragmentation(主动碎版整理) 至 v2 版本。

  7. 改进了数据类型 HyperLogLog 的实现。

  8. 更好的内存报告功能.

  9. 为带子命令的命令提供一个 HELP 子命令。

  10. 为客户端经常频繁连接/断开提供更优的性能。

  11. 修复许多 Bug 和其它的改进。

  12. 内存分配库 Jemalloc 升级到5.1版。

  13. 引入 CLIENT UNBLOCK 和 CLIENT ID

  14. 新增 LOLWUT 命令,该命令是为了娱乐,且每个版本可能都不一样。 具体可参考LOLWUT: a piece of art inside a database command

  15. 如果不是为了向后兼容,将弃用 "slave" 术语(因政治正确而议论比较大导致)。

  16. 网络层中的差异优化。

  17. Lua 相关的改进:

    将 Lua 脚本更好地传播到 replicas / AOF。
    Lua 脚本现在可以超时并在副本中进入 -BUSY 状态。

  18. 引入动态的 HZ(Dynamic HZ) 以平衡空闲 CPU 使用率和响应性。

  19. 对 Redis 核心代码进行了重构并在多方面进行了改进。

虽然发布了 Redis 5 第一个稳定版本,但短期内将其应用于生产是不合适的,比如有些公司现在才开始将 Redis 集群中的实例从 Redis 3 逐步更新到 Redis 4版本,应用于大规模的生产最好是在其被检验一段时间后再评估。

目前 Redis 4.x系列 文章基于 4.x 版本对其功能特性进行详解和实践,过一段时间后再对 Redis 5.0 新特性进行深入理解和实践。

发布说明原文

================================================================================
Redis 5.0 RC1   Released Tue May 29 14:14:11 CEST 2018 
#Redis 5.0 RC1 版本于 2018-05-29 14:14:11(夏令时)发布
================================================================================

Upgrade urgency LOW: This is the first RC of Redis 5.
#升级紧急 低:Redis 5.0 第一个候选版本

Introduction to the Redis 5 release 
# Redis 5 介绍
===================================

Redis 5 is a release focused on a few important features. While Redis 4
was very very focused on operations, Redis 5 changes are mostly user-facing,
with the implementation of new data types and operations on top of existing
types. The following are the major features of this release:
#Redis 5 是一个专注于一些重要特性的版本,而 Redis 4 非常关注操作。
#Redis 5 的更新大多是面向用户,在现有数据基础上实现新的数据类型和操作类型。 
#以下是此版本的主要功能:

1. The new Stream data type. https://redis.io/topics/streams-intro 
    #新的 Stream 数据类型
2. New Redis modules APIs: Timers, Cluster and Dictionary APIs. 
    #新的Redis模块API:计时器,集群 和 字典API
3. RDB now store LFU and LRU information.
    #RDB持入化增加存储LFU(最近不经常使用)和LRU(最近最少使用)信息
4. The cluster manager was ported from Ruby (redis-trib.rb) to C code 
    #集群管理从 Ruby(redis-trib.rb)脚本移植 C 实现集成到 redis-cli 客户端内部
   inside redis-cli. Check `redis-cli --cluster help` for more info. 
    # 执行 redis-cli --cluster help 命令获取更多信息
5. New sorted set commands: ZPOPMIN/MAX and blocking variants. 
    #有序集合Sorted Set新的命令:ZPOPMIN/MAX 和阻塞变种
6. Active defragmentation version 2.
    #主动碎片整理升级到版本2
7. Improvemenets in HyperLogLog implementations.
    #改进了HyperLogLog数据类型的实现
8. Better memory reporting capabilities.
    #更好的内存报告功能
9. Many commands with sub-commands now have an HELP subcommand.
    #为带有子命令的命令提供子命令的Help
10. Better performances when clients connect and disconnect often.
    #为客户端频繁连接/断开提供更优的性能
11. Many bug fixes and other random improvements.
    #修复许多Bug和其它的改进
12. Jemalloc was upgraded to version 5.1 
    #内存分配库升级到 5.1版本
13. CLIENT UNBLOCK and CLIENT ID. 
    # 引入 CLIENT UNBLOCK and CLIENT ID
14. The LOLWUT command was added. http://antirez.com/news/123 
    #新增 LOLWUT 命令
15. We no longer use the "slave" word if not for API backward compatibility.
    #如果不是为了API向后兼容,将不再使用【slave】词
16. Differnet optimizations in the networking layer.
    #网络层中的差异优化
17. Lua improvements: 
    # Lua 提升
    - Better propagation of Lua scripts to slaves / AOF.
        #更好地将LUA脚本传播到 slaves / AOF
    - Lua scripts can now timeout and get in -BUSY state in the slave as well.
         #Lua脚本现在可以超时,并且在slave中进入 -BUSY状态。
18. Dynamic HZ to balance idle CPU usage with responsiveness.
        #引入动态的HZ(Dynamic HZ)以平衡空闲CPU使用率和响应性。
19. The Redis core was refactored and improved in many ways. 
        #Redis内核很多方面进行了重构和改进。

Thanks to all the users and developers who made this release possible.
We'll follow up with more RC releases, until the code looks production ready
and we don't get reports of serious issues for a while.

A special thank you for the amount of work put into this release
(in decreasing number of commits) by:

Fabio Nicotra, <artix2@gmail.com>
Soloestoy <zhaozhao.zz@alibaba-inc.com>
Itamar Haber <itamar@redislabs.com>
Oran Agra <oran@redislabs.com>
Dvir Volk <dvirsky@gmail.com>
dejun.xdj <dejun.xdj@alibaba-inc.com>
Guy Benoish <guy.benoish@redislabs.com>
Charsyam <charsyam@gmail.com>
Otmar Ertl <otmar.ertl@gmail.com>
Jan-Erik Rediger <janerik@fnordig.de>
Spinlock <wnzheng@gmail.com>

Migrating from 4.0 to 5.0 #从4.0迁移到5.0
=========================

Redis 4.0 is mostly a strict subset of 5.0, you should not have any problem
upgrading your application from 4.0 to 5.0. However this is a list of small
non-backward compatible changes introduced in the 5.0 release:

* redis-cli now implements the cluster management tool. We still ship the
  old redis-trib, but new fixes will be implemented only in redis-cli.
  See `redis-cli --cluster help` for more info.

  #redis-cli 实现了集群管理工具,我们仍保留了旧的 redis-trib 脚本,但新的修复将只在redis-cli中实现

* The RDB format changed. Redis 5.0 is still able to read 4.0 (and all the
  past versions) files, but not the other way around.

  #改变了RDB 持久化格式。Redis 5.0 仍然可以读取 4.0(及所有以前版本)文件,但旧版本不能读取版本文件(相反不行)

* Certain log formats and sentences are different in Redis 5.0.

  #Redis 5.0 中的某些日志格式和语句是不同的

* Now by default maxmemory is ignored by slaves, and used only once a slave
  is promoted to master. It means that in setups where you want slaves to
  enforce maxmemory in an independent way from the master (that will anyway
  stream the key eviction DEL commands), you should active this feature manually
  and make sure you understand that it breaks consistency if writes are not
  always idempotent. TLDR: the new behavior is much better for 99.999% of use
  cases, revert it if you really know what you are doing.

  #现在默认情况下 maxmemory 被 slave 忽略,并且只在 slave 提升级 master 时使用一次。
  #这意味着,在您希望 slave 以独立于 master 的方式强制执行 maxmemory 的设置中(无论如何,stream the key 逐出DEL命令),
  #您应该手动激活此功能,并确保您了解,如果写入操作不是幂等的,则它会破坏一致性。
  #TLDR:对于99.999%的用例,新行为要好得多,如果您真的知道自己在做什么,请把它还原。

* Scripts are only replicated by their *effects* and not by sending EVAL/EVALSHA
  to slaves or the AOF log itself. This is much better in the general case
  and in the future we want to totally remove the other possiblity of
  propagating scripts the old way (as EVAL). However you can still turn this
  back to the default via the non-documented (if not here) Redis configuration
  directive "lua-replicate-commands yes" or
  "DEBUG lua-always-replicate-commands 0". However note that Redis 6 may
  completely remove such feature.
  Scripts are only replicated by their *effects* and not by sending EVAL/EVALSHA  to slaves or the AOF log itself. 

  #脚本只能通过它们的*effects*来复制,而不是通过将EVAL/EVALSHA发送到slaves或AOF日志本身来复制。
 #这在一般情况下要好得多,将来我们希望完全移除以旧方式传播脚本的其他可能性(如EVAL)。
  #但是,您仍然可以通过未记录的(如果不在这里)Redis配置指令“lua replicate commands yes”或“DEBUG lua always replicate commands 0”将其恢复为默认值。
 #但是请注意,Redis 6可能会完全删除此功能。

* Because of the above change related to scripts replication, certain Redis
  commands that in Redis 4 had their result ordered lexicographically before
  being passed to Lua via the return value of redis.call(), now have a behavior
  more similar to calling the commands directly from a normal client. For
  instance the ordering of elements returned by SMEMBERS or SDIFF is now
  undetermined in Lua, exactly as it is by default when calling the commands
  from a non-scripting context.
  #由于上述与脚本复制有关的更改,某些Redis命令在Redis 4中的结果按字典顺序排序,然后通过redis.call()的返回值传递给Lua,
  #现在的行为与从一个普通道客户端直接调用命令类似。例如,现在在Lua中是不确定SMEMBERS或SDIFF返回的元素的顺序,这与从非脚本上下文调用命令时的默认情况完全相同。
更多内容请访问:IT源点

相关文章推荐
  • 该目录下还没有内容!

全部评论: 0

    我有话说: