{"id":87041,"date":"2020-04-26T06:12:33","date_gmt":"2020-04-25T22:12:33","guid":{"rendered":"http:\/\/4563.org\/?p=87041"},"modified":"2020-04-26T06:12:33","modified_gmt":"2020-04-25T22:12:33","slug":"redis-6-0-%e6%ad%a3%e5%bc%8f%e5%8f%91%e5%b8%83%ef%bc%81","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=87041","title":{"rendered":"Redis 6.0 \u6b63\u5f0f\u53d1\u5e03\uff01"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Redis 6.0 \u6b63\u5f0f\u53d1\u5e03\uff01               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RedisMasterNode <\/span>  <span><i><\/i> 16<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>3 \u4e2a\u5c0f\u65f6\u524d Antirez \u5728\u535a\u5ba2\u4e0a\u53d1\u6587\u300a Redis 6.0.0 GA is out!\u300b\uff0c\u4ece RC1 \u7248\u672c\u5230\u4eca\u5929\uff0c\u7b97\u4e0b\u6765\u4e5f\u6709 130 \u591a\u5929\u4e86\uff0c\u9664\u4e86\u5728 RC1 \u4e0a\u5df2\u7ecf\u77e5\u9053\u7684\u65b0\u529f\u80fd\uff08\u6ca1\u6709\u4e86\u89e3\u7684\u540c\u5b66\u53ef\u4ee5\u770b\u4e00\u4e0b\u6211\u7684\u8fd9\u7bc7\u8bd1\u6587\uff1a https:\/\/www.v2ex.com\/t\/630926#reply15 \uff09\uff0c\u8fd9\u6bb5\u65f6\u95f4\u5185 Redis \u8fd8\u505a\u4e86\u5f88\u591a\u4f18\u5316\u3001\u66f4\u65b0\u548c\u529f\u80fd\u7684\u91cd\u505a\u3002<\/p>\n<p>\u5148\u63d0\u7eb2\u56de\u987e\u4e00\u4e0b Redis 6 RC1 \u65f6\u76f8\u5bf9\u4e8e Redis 5 \u7684\u53d8\u5316\uff1a<\/p>\n<ul>\n<li>\u4f17\u591a\u65b0\u6a21\u5757\uff08 modules \uff09 API<\/li>\n<li>\u66f4\u597d\u7684\u8fc7\u671f\u5faa\u73af\uff08 expire cycle \uff09<\/li>\n<li>SSL<\/li>\n<li>ACLs \u6743\u9650\u63a7\u5236<\/li>\n<li>RESP3 \u534f\u8bae<\/li>\n<li>\u5ba2\u6237\u7aef\u7f13\u5b58\uff08 Client side caching \uff09<\/li>\n<li>\u591a\u7ebf\u7a0b IO \uff08 Threaded I\/O \uff09<\/li>\n<li>\u65e0\u76d8\u590d\u5236\u526f\u672c\uff08 Diskless replication on replicas \uff09<\/li>\n<li>Redis-benchmark \u7684\u96c6\u7fa4\u652f\u6301\u548c Redis-cli \u4f18\u5316<\/li>\n<li>\u91cd\u5199 Systemd \u652f\u6301\uff08 Systemd support rewrite \uff09<\/li>\n<li>Redis \u96c6\u7fa4\u4ee3\u7406\u4e0e Redis 6 \u4e00\u540c\u53d1\u5e03\uff08\u4f46\u5728\u4e0d\u540c\u7684 repo \uff09<\/li>\n<li>Disque \u6a21\u5757\u4e0e Redis 6 \u4e00\u540c\u53d1\u5e03<\/li>\n<\/ul>\n<p>\u90a3\u4e48\u4e0b\u9762\u624d\u662f\u4eca\u5929\u7684\u4e3b\u89d2\uff0cRC1 \u81f3 GA \u671f\u95f4\u7684\u6539\u52a8\uff1a<\/p>\n<ol>\n<li>\u5ba2\u6237\u7aef\u7f13\u5b58\u7684\u91cd\u505a\uff0c\u7528\u4e86\u65b0\u7684\u5b9e\u73b0\uff08 broadcasting mode \uff09<\/li>\n<li>\u7528\u4e8e\u4e3b\u4ece\u590d\u5236\u7684 RDB \u6587\u4ef6\u4f1a\u5728\u5b8c\u6210\u4f7f\u547d\u540e\u5220\u9664<\/li>\n<li>\u65b0\u589e ACL LOG \u547d\u4ee4\uff0c\u8fd9\u662f Antirez \u5728 twitch \u4e0a\u76f4\u64ad\u5f00\u53d1\u7684\u529f\u80fd\uff0c\u76f4\u64ad coding \u8fc7\u7a0b\u633a\u6709\u610f\u601d\u7684\uff0c\u8a00\u5f52\u6b63\u4f20\uff0c\u8fd9\u4e2a\u547d\u4ee4\u63d0\u4f9b\u4e24\u4e2a\u529f\u80fd\uff1a\u67e5\u770b\u6700\u8fd1 ACL \u4e0d\u901a\u8fc7\u7684\u547d\u4ee4\u548c\u7528\u6237 &amp; \u6e05\u7406 ACL \u4e0d\u901a\u8fc7\u7684\u65e5\u5fd7\uff1b\u5f53\u7136\u8fd8\u6709\u81ea\u52a8\u751f\u6210\u5bc6\u7801\u547d\u4ee4\uff08 ACL GENPASS \uff09\u7684\u4e00\u4e9b\u5185\u5bb9\uff0c\u5177\u4f53\u53ef\u4ee5\u770b\u535a\u6587\u539f\u6587\u3002<\/li>\n<li>\u4f18\u5316 PSYNC2<\/li>\n<li>\u5e26\u8d85\u65f6\u9009\u9879\u7684\u547d\u4ee4\u4f18\u5316<\/li>\n<li>RDB \u6587\u4ef6\u52a0\u8f7d\u4f18\u5316\uff0c20-30%\u7684\u63d0\u5347<\/li>\n<li>\u4e0a\u4e2a\u6708\u65b0\u52a0\u7684\u547d\u4ee4\uff08 STARLGO \uff09\uff0c\u7ed3\u5408 Redis \u548c LCS \uff08\u6700\u957f\u516c\u5171\u5b57\u7b26\u4e32\uff09\u7684\u7b97\u6cd5\u6765\u5b9e\u73b0\u4e00\u4e9b\u529f\u80fd<\/li>\n<\/ol>\n<p>\u4ee5\u4e0b\u662f\u535a\u6587\u539f\u6587<\/p>\n<pre><code>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 \u201cbroadcasting mode\u201d, 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\u2019ll 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 \u201cACL LOG\u201d to see what\u2019s 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 \u201cHZ\u201d 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. <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1359287\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : RedisMasterNode <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u518d\u5b89\u5229\u6700\u8fd1\u5199\u7684 Redis 6.0 \u4e00\u4e9b\u65b0\u529f\u80fd\u7684\u5b9e\u73b0\u7684\u6587\u7ae0\uff1a<\/p>\n<p>Redis 6.0 ACL \u57fa\u4e8e Bitmap \u5b9e\u73b0\uff1a https:\/\/blog.2014bduck.com\/archives\/343<br \/>Redis 6.0 \u591a\u7ebf\u7a0b IO \u7684\u5b9e\u73b0\uff1a https:\/\/blog.2014bduck.com\/archives\/326<\/p>\n<p>\u6587\u7ae0\u5728 V2EX \u4e0a\u4e5f\u80fd\u627e\u5230~\u4e0d\u8fc7\u5b89\u5229\u535a\u5ba2\u5927\u6982\u53ef\u4ee5\u6d41\u91cf+1<\/p>\n<p>\u6211\u662f \u5c0f\u9ec4\u9e2d @Shopee ^_^                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1359288\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : boyhailong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u8fd9\u7f51\u540d \u4e13\u6ce8 redis \uff5e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1359289\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jwenjian <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u95ee\u4e00\u4e0b \u6628\u5929\u770b release note \u91cc\u63d0\u5230\u7684 6.0 \u91cc\u9762 block \u5728\u540c\u4e00\u4e2a key \u7684\u590d\u6742\u5ea6\u4ece O(n)\u4f18\u5316\u5230\u4e86 O(1) \u662f\u505a\u4e86\u4ec0\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1359290\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Redis \u7684\u4e3b\u4ece\u80fd\u505a\u53cc\u4e3b\u4e92\u8fde\u4e48\uff1f\u73b0\u5728\u7528\u7684\u662f keydb \u4e92\u8fde\uff0c\u4e0d\u77e5\u9053\u80fd\u4e0d\u80fd\u8f6c\u56de Redis \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1359291\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : damngood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             wow, local cache invalidation \u8fd9\u4e2a\u529f\u80fd\u70b9\u975e\u5e38\u6709\u5347\u7ea7\u52a8\u529b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1359292\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xabc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             centos7 \u4e0b \u7f16\u8bd1\u5931\u8d25                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1359293\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wangyzj <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u591a\u7ebf\u7a0b IO \uff08 Threaded I\/O \uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Redis 6.0 \u6b63\u5f0f\u53d1\u5e03\uff01 \u8cc7&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/87041"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=87041"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/87041\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=87041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=87041"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=87041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}