3 个小时前 Antirez 在博客上发文《 Redis 6.0.0 GA is out!》,从 RC1 版本到今天,算下来也有 130 多天了,除了在 RC1 上已经知道的新功能(没有了解的同学可以看一下我的这篇译文: https://www.v2ex.com/t/630926#reply15 ),这段时间内 Redis 还做了很多优化、更新和功能的重做。
先提纲回顾一下 Redis 6 RC1 时相对于 Redis 5 的变化:
那么下面才是今天的主角,RC1 至 GA 期间的改动:
以下是博文原文
1. Client side caching was redesigned in certain aspects, especially the caching slot approach was discarded in favor of just using key names. After analyzing the alternatives, with the help of other Redis core team members, in the end this approach looks better. Other than that, finally the feature was completed with the things I had in the backlog for the feature, especially the “broadcasting mode”, that I believe will be one of the most popular usage modes of the feature.
When broadcasting is used, the server no longer try to remember what keys each client requested. Instead clients subscribe to key prefixes: they’ll get notifications every time a key matching the prefix is modified. This means more messages (but only for the selected prefixes), but no memory effort in the server side. Moreover the opt-in / opt-out mode is now supported, so it is possible for clients not using the broadcasting mode, to exactly tell the server about what the client will cache, to reduce the number of invalidation messages. Basically the feature is now much better both when a low-memory mode is needed, and when a very selective (low-bandwidth) mode is needed.
2. This was an old request by many users. Now Redis supports a mode where RDB files used for replication are immediately deleted if no longer useful. In certain environments it is a good idea to never have the data around on disk, but just in memory.
3. ACLs are better in a few regards. First, there is a new ACL LOG command that allows to see all the clients that are violating the ACLs, accessing commands they should not, accessing keys they should not, or with failed authentication attempts. The log is actually in memory, so every external agent can call “ACL LOG” to see what’s going on. This is very useful in order to debug ACL problems.
But my preferred feature is the reimplementation of ACL GENPASS. Now it uses SHA256 based HMAC, and accepts an optional argument to tell the server how many bits of unguessable pseudo random string you want to generate. Redis seeds an internal key at startup from /dev/urandom, and later uses the HMAC in counter mode in order to generate the other random numbers: this way you can abuse the API, and call it every time you want, since it will be very fast. Want to generate an unguessable session ID for your application? Just call ACL GENPASS. And so forth.
4. PSYNC2, the replication protocol, is now improved. Redis will be able to partially resynchronize more often, since now is able to trim the final PINGs in the protocol, to make more likely that replicas and masters can find a common offset.
5. Redis commands with timeouts are now much better: not only BLPOP and other commands that used to accept seconds, now accept decimal numbers, but the actual resolution was improved in order to never be worse than the current “HZ” value, regardless of the number of clients connected.
6. RDB files are now faster to load. You can expect a 20/30% improvement, depending on the file actual composition (larger or smaller values). INFO is also faster now when there are many clients connected, this was a long time problem that now is finally gone.
7. We have a new command, STRALGO, that implements complex string algorithms. For now the only one implemented is LCS (longest common subsequence), an important algorithm used, among the other things, in order to compare the RNA of the coronaviruses (and in general the DNA and RNA of other organisms). What is happening is too big, somewhat a trace inside Redis needed to remain.
1
RedisMasterNode OP 再安利最近写的 Redis 6.0 一些新功能的实现的文章:
Redis 6.0 ACL 基于 Bitmap 实现: https://blog.2014bduck.com/archives/343 Redis 6.0 多线程 IO 的实现: https://blog.2014bduck.com/archives/326 文章在 V2EX 上也能找到~不过安利博客大概可以流量+1 我是 小黄鸭 @Shopee ^_^ |
2
boyhailong 2020-05-01 06:16:16 +08:00
楼主这网名 专注 redis ~
|
3
jwenjian 2020-05-01 07:32:36 +08:00 via iPhone
问一下 昨天看 release note 里提到的 6.0 里面 block 在同一个 key 的复杂度从 O(n)优化到了 O(1) 是做了什么?
|
4
msg7086 2020-05-01 08:53:01 +08:00
Redis 的主从能做双主互连么?现在用的是 keydb 互连,不知道能不能转回 Redis 。
|
5
damngood 2020-05-01 09:11:59 +08:00 via iPhone
wow, local cache invalidation 这个功能点非常有升级动力
|
6
xabc 2020-05-01 10:25:20 +08:00
centos7 下 编译失败
|
7
wangyzj 2020-05-01 12:05:32 +08:00
多线程 IO ( Threaded I/O )
|