Introduction to the Redis 6 release
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. > 模块系统提供了一些新的API,允许模块作者使用新的功能。可以存储任意模块私有数据到RDB文件,以关联在不同的服务器事件,捕获和重写命令执行,阻塞客户端key,等等。
- The Redis active expire cycle was rewritten for much faster eviction of keys that are already expired. Now the effort is tunable. > Redis活跃过期周期被重写,使得更快的过期键被清除。现在这个力度是可调的。
- Redis now supports SSL on all channels. > Redis现在支持所有通道的SSL。
- ACL support, you can define users that can run only certain commands and/or can only access only certain keys patterns. > ACL支持,你可以定义只能运行某些命令和/或只能访问某些特定key的用户。
- 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. > Redis现在支持新协议RESP3,它返回更为语义化的回复:使用这个协议的新客户端可以从回复中知道返回类型。
- 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. > Redis现在可以选择使用线程来处理I/O,单实例在不能使用Pipeline时,每秒可以提供操作数量可以达到以前的2倍。
- 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. > 副本实例现在也支持无磁盘复制了:在某些条件下,用户可以通过配置,使副本实例从套接字直接加载RDB到内存。
- Redis-benchmark now supports a Redis Cluster mode. > Redis-benchmark现在支持Redis Cluster模式了
- SRANDMEMBER and similar commands have a better distribution. > SRANDMEMBER等命令提供更好的取值分布。
- Redis-cli improvements. > Redis-cli提升
- Systemd support rewritten. > Systemd支持被重写了
- A Redis Cluster proxy was released here: https://github.com/artix75/redis-cluster-proxy > Redis集群代理已经发布在这里
- A Disque module for Redis was released here: https://github.com/antirez/disque-module > Redis的Disque模块已经发布在这里
Redis 6.0 is mostly a strict superset of 5.0, you should not have any problem upgrading your application from 5.0 to 6.0. However this is a list of small non-backward compatible changes introduced in the 6.0 release: > Redis 6.0 是 5.0版本的严格子集,你从5.0版本升级到6.0版本应该不会有什么问题。但是,这是6.0版本中新增的一些非向后兼容的变更:
- The SPOP
command no longer returns null when the set key does not exist. Now it returns the empty set as it should and as happens when it is called with a 0 argument. This is technically a fix, however it changes the old behavior. > SPOP <count>
命令在key不存在的时候,不回返回null了,现在它返回空集合,并且参数是0时,也返回空集合。理论上这时一个问题修复,但它改变了命令的返回结果。