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

本文涉及的产品
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 测试更可靠。



相关文章
|
监控 NoSQL 安全
如何在 Redis 中正确使用多线程?
【10月更文挑战第16天】正确使用 Redis 多线程需要综合考虑多个因素,并且需要在实践中不断摸索和总结经验。通过合理的配置和运用,多线程可以为 Redis 带来性能上的提升,同时也要注意避免可能出现的问题,以保障系统的稳定和可靠运行。
331 2
|
存储 NoSQL Redis
Redis 新版本引入多线程的利弊分析
【10月更文挑战第16天】Redis 新版本引入多线程是一个具有挑战性和机遇的改变。虽然多线程带来了一些潜在的问题和挑战,但也为 Redis 提供了进一步提升性能和扩展能力的可能性。在实际应用中,我们需要根据具体的需求和场景,综合评估多线程的利弊,谨慎地选择和使用 Redis 的新版本。同时,Redis 开发者也需要不断努力,优化和完善多线程机制,以提供更加稳定、高效和可靠的 Redis 服务。
284 1
|
8月前
|
缓存 NoSQL 中间件
Redis的线程模型
Redis采用单线程模型确保操作的原子性,每次只执行一个操作,避免并发冲突。它通过MULTI/EXEC事务机制、Lua脚本和复合指令(如MSET、GETSET等)保证多个操作要么全成功,要么全失败,确保数据一致性。Redis事务在EXEC前失败则不执行任何操作,EXEC后失败不影响其他操作。Pipeline虽高效但不具备原子性,适合非热点时段的数据调整。Redis 7引入Function功能,支持函数复用,简化复杂业务逻辑。总结来说,Redis的单线程模型简单高效,适用于高并发场景,但仍需合理选择指令执行方式以发挥其性能优势。
216 6
|
11月前
|
NoSQL Redis
单线程传奇Redis,为何引入多线程?
Redis 4.0 引入多线程支持,主要用于后台对象删除、处理阻塞命令和网络 I/O 等操作,以提高并发性和性能。尽管如此,Redis 仍保留单线程执行模型处理客户端请求,确保高效性和简单性。多线程仅用于优化后台任务,如异步删除过期对象和分担读写操作,从而提升整体性能。
204 1
|
存储 运维 NoSQL
Redis为什么最开始被设计成单线程而不是多线程
总之,Redis采用单线程设计是基于对系统特性的深刻洞察和权衡的结果。这种设计不仅保持了Redis的高性能,还确保了其代码的简洁性、可维护性以及部署的便捷性,使之成为众多应用场景下的首选数据存储解决方案。
191 1
|
NoSQL Redis 数据库
Redis单线程模型 redis 为什么是单线程?为什么 redis 单线程效率还能那么高,速度还能特别快
本文解释了Redis为什么采用单线程模型,以及为什么Redis单线程模型的效率和速度依然可以非常高,主要原因包括Redis操作主要访问内存、核心操作简单、单线程避免了线程竞争开销,以及使用了IO多路复用机制epoll。
363 0
Redis单线程模型 redis 为什么是单线程?为什么 redis 单线程效率还能那么高,速度还能特别快
|
NoSQL 网络协议 Unix
1)Redis 属于单线程还是多线程?不同版本之间有什么区别?
1)Redis 属于单线程还是多线程?不同版本之间有什么区别?
306 2
|
6月前
|
缓存 NoSQL 关系型数据库
美团面试:MySQL有1000w数据,redis只存20w的数据,如何做 缓存 设计?
美团面试:MySQL有1000w数据,redis只存20w的数据,如何做 缓存 设计?
美团面试:MySQL有1000w数据,redis只存20w的数据,如何做 缓存 设计?
|
1月前
|
缓存 负载均衡 监控
135_负载均衡:Redis缓存 - 提高缓存命中率的配置与最佳实践
在现代大型语言模型(LLM)部署架构中,缓存系统扮演着至关重要的角色。随着LLM应用规模的不断扩大和用户需求的持续增长,如何构建高效、可靠的缓存架构成为系统性能优化的核心挑战。Redis作为业界领先的内存数据库,因其高性能、丰富的数据结构和灵活的配置选项,已成为LLM部署中首选的缓存解决方案。

热门文章

最新文章