Redis 6.0 正式版终于发布了!除了多线程还有什么新功能?(上)

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,标准版 2GB
推荐场景:
搭建游戏排行榜
日志服务 SLS,月写入数据量 50GB 1个月
简介: Redis 6.0 正式版终于发布了!除了多线程还有什么新功能?

image.png


Redis 6.0.1 于 2020 年 5 月 2 日正式发布了,如 Redis 作者 antirez 所说,这是迄今为止最“企业”化的版本,也是有史以来改动最大的一个 Redis 版本,同时也是参与开发人数最多的一个版本。


所以在使用此版本之前,建议各位开发者先进行深入的测试再考虑投产,毕竟生产坏境无小事。好了,回到本文的重点,接下来我们来重点看下 Redis 6.0.1 给我们带来了那些新功能。


Redis新功能介绍


Redis 6 的更新日志,主要包含以下五部分的内容:


  1. Redis 6.0-RC1 版新功能介绍;
  2. Redis 6.0-RC2 版新功能介绍;
  3. Redis 6.0-RC3 版新功能介绍;
  4. Redis 6.0-RC4 版新功能介绍;
  5. Redis 6.0.0 GA 版新功能介绍。


除了以上这些版本的更新日志外,还有 6.0.1 正式版的更新日志,不过这个正式版的发布时间只比 Redis 6.0.0 GA 晚了两天,因此只修复了一些 bug,所以我们只需要看以上五个日志即可。


1.Redis 6.0-rc1 更新日志


官方更新日志如下:


Redis 6 improves Redis in a number of key areas and is one of the largest Redis releases in the history of the project, so here we'll list only the biggest features in this release:


  • The modules system now has a number of new APIs that allow module authors   to make things otherwise not possible in the past. It is possible to   store arbitrary module private data in RDB files, to hook on different   server events, capture and rewrite commands executions, block clients on   keys, and so forth.
  • The Redis active expire cycle was rewritten for much faster eviction of keys   that are already expired. Now the effort is tunable.
  • Redis now supports SSL on all channels.
  • ACL support, you can define users that can run only certain commands and/or   can only access only certain keys patterns.
  • Redis now supports a new protocol called RESP3, which returns more   semantical replies: new clients using this protocol can understand just   from the reply what type to return to the calling program.
  • There is server-side support for client-side caching of key values. This   feature is still experimental and will get more changes during the next   release candidates, but you can already test it and read about it here:   https://redis.io/topics/client-side-caching
  • Redis can now optionally use threads to handle I/O, allowing to serve   2 times as much operations per second in a single instance when   pipelining cannot be used.
  • Diskless replication is now supported even on replicas: a replica is now   able, under certain conditions the user can configure, to load the RDB   in the first synchronization directly from the socket to the memory.
  • Redis-benchmark now supports a Redis Cluster mode.
  • SRANDMEMBER and similar commands have a better distribution.
  • Redis-cli improvements.
  • Systemd support rewritten.
  • A Redis Cluster proxy was released here:   https://github.com/artix75/redis-cluster-proxy
  • A Disque module for Redis was released here:   https://github.com/antirez/disque-module


此版本新增的内容最大,如下列表所示:


  • 众多新模块(modules)API
  • 更好的过期循环(expire cycle)
  • SSL
  • ACLs 权限控制
  • RESP3 协议
  • 客户端缓存(Client side caching)
  • 多线程 IO(Threaded I/O)
  • 无盘复制副本(Diskless replication on replicas)
  • Redis-benchmark 的集群支持和 redis-cli 优化
  • 重写 Systemd 支持(Systemd support rewrite)
  • Redis 集群代理与 Redis 6 一同发布(但在不同的 repo)
  • Disque 模块与 Redis 6 一同发布


2.Redis 6.0-rc2 更新日志


Hi Redis users, Redis 6 is approaching and will be released 30th of April. New release candidates will be released at the end of March, then another one mid April, to finally reach the GA at the end of April.


Redis 6 RC2 brings many fixes and new things, especially in the area of client side caching. This is the list of big changes in this release. As usually you can find the full list of commits at the end:


New features and improvements:


  • ACL LOG: log denied commands, keys accesses and authentications.
  • Client side caching redesigned. Now we use keys not caching slots.
  • Client side caching: Broadcasting mode implemented.
  • Client side caching: OPTIN/OPTOUT modes implemented.
  • Remove RDB files used for replication in persistence-less instances (option).

Fixes (only selected ones, see commits for all the fixes):

  • Different fixes to streams in edge cases.
  • Fix duplicated CLIENT SETNAME reply because of RESP3 changes.
  • Fix crash due to new active expire division by zero.
  • Avoid sentinel changes promoted_slave to be its own replica.
  • Fix bug on KEYS command where pattern starts with * followed by \x00.
  • Threaded I/O: now the main thread is used as well to do I/O.
  • Many fixes to modules APIs, and more to come in the next RCs.
  • ld2string should fail if string contains \0 in the middle.
  • Make the Redis test more reliable.
  • Fix SPOP returning nil (see #4709). WARNING: API change.


Redis 6 RC2 带来了许多修复和新功能,尤其是客户端的缓存功能,此版本的重大更改如下列表。


  • ACL LOG:记录拒绝的命令,密钥访问和身份验证。
  • 重新设计了客户端缓存。现在,我们使用密钥而不是缓存插槽。
  • 客户端缓存:已实现广播模式。
  • 客户端缓存:已实现 OPTIN/OPTOUT 模式。
  • 删除用于在非持久性实例中进行复制的 RDB 文件(可选)。
  • 修复程序(仅选定的修复程序,请参阅所有修复程序的提交):
  • 在边缘情况下对流的不同修复。
  • 修正由于 RESP3 更改而导致重复的 CLIENT SETNAME 答复。
  • 修正因新的有效到期除以零而导致的崩溃。
  • 避免将哨兵更改提升为自己的副本。
  • 修复了 KEYS 命令中以 * 开头,后跟 \x00 的错误。
  • 线程 I/O:现在也使用主线程来执行 I/O。
  • 对模块API进行了许多修复,而在下一个RC中还会有更多修复。
  • 如果字符串中间包含 \0,则 ld2string 应该失败。
  • 使 Redis 测试更可靠。



相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
8天前
|
消息中间件 存储 NoSQL
剖析 Redis List 消息队列的三种消费线程模型
Redis 列表(List)是一种简单的字符串列表,它的底层实现是一个双向链表。 生产环境,很多公司都将 Redis 列表应用于轻量级消息队列 。这篇文章,我们聊聊如何使用 List 命令实现消息队列的功能以及剖析消费者线程模型 。
45 20
剖析 Redis List 消息队列的三种消费线程模型
|
2月前
|
消息中间件 缓存 NoSQL
Redis快速度特性及为什么支持多线程及应用场景
Redis快速度特性及为什么支持多线程及应用场景
68 11
|
25天前
|
缓存 开发框架 NoSQL
【Azure Redis 缓存】Azure Redis 异常 - 因线程池Busy而产生的Timeout异常问题
【Azure Redis 缓存】Azure Redis 异常 - 因线程池Busy而产生的Timeout异常问题
|
2月前
|
存储 缓存 NoSQL
Redis性能优化问题之优化 Redis fork 耗时严重的问题,如何解决
Redis性能优化问题之优化 Redis fork 耗时严重的问题,如何解决
|
1月前
|
NoSQL 关系型数据库 MySQL
简述redis的单线程模式
简述redis的单线程模式
|
2月前
|
NoSQL Cloud Native Redis
|
2月前
|
Java Redis 数据安全/隐私保护
Redis14----Redis的java客户端-jedis的连接池,jedis本身是线程不安全的,并且频繁的创建和销毁连接会有性能损耗,最好用jedis连接池代替jedis,配置端口,密码
Redis14----Redis的java客户端-jedis的连接池,jedis本身是线程不安全的,并且频繁的创建和销毁连接会有性能损耗,最好用jedis连接池代替jedis,配置端口,密码
|
2月前
|
安全 NoSQL Java
网络安全-----Redis12的Java客户端----客户端对比12,Jedis介绍,使用简单安全性不足,lettuce(官方默认)是基于Netty,支持同步,异步和响应式,并且线程是安全的,支持R
网络安全-----Redis12的Java客户端----客户端对比12,Jedis介绍,使用简单安全性不足,lettuce(官方默认)是基于Netty,支持同步,异步和响应式,并且线程是安全的,支持R
|
3月前
|
NoSQL Redis
Redis系列学习文章分享---第五篇(Redis实战篇--优惠券秒杀,全局唯一id 添加优惠券 实现秒杀下单 库存超卖问题分析 乐观锁解决超卖 实现一人一单功能 集群下的线程并发安全问题)
Redis系列学习文章分享---第五篇(Redis实战篇--优惠券秒杀,全局唯一id 添加优惠券 实现秒杀下单 库存超卖问题分析 乐观锁解决超卖 实现一人一单功能 集群下的线程并发安全问题)
88 0
|
3月前
|
NoSQL Redis
Redis的单线程和高性能
Redis 的单线程主要是指 Redis 的网络 I0 和键值对读写是由一个线程来完成的,这也是 Redis 对外提供键值存储服务的主要流程。 但Redis 的其他功能,比如持久化、异步删除、集群数据同步等,其实是由额外的线程执行的。
22 0