{"id":188730,"date":"2024-11-12T01:17:24","date_gmt":"2024-11-11T17:17:24","guid":{"rendered":"https:\/\/server.hk\/cnblog\/188730\/"},"modified":"2024-11-12T01:17:25","modified_gmt":"2024-11-11T17:17:25","slug":"%e6%8e%a2%e7%b4%a2redis%e4%b9%8b%e5%a4%96%e7%9a%84%e7%9b%b8%e4%bc%bc%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88%ef%bc%88redis%e7%9b%b8%e4%bc%bc%e7%9a%84%e5%b7%a5%e5%85%b7%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/188730\/","title":{"rendered":"\u63a2\u7d22Redis\u4e4b\u5916\u7684\u76f8\u4f3c\u89e3\u6c7a\u65b9\u6848\uff08redis\u76f8\u4f3c\u7684\u5de5\u5177\uff09"},"content":{"rendered":"<h1 id=\"%e6%8e%a2%e7%b4%a2redis%e4%b9%8b%e5%a4%96%e7%9a%84%e7%9b%b8%e4%bc%bc%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88%ef%bc%88redis%e7%9b%b8%e4%bc%bc%e7%9a%84%e5%b7%a5%e5%85%b7%ef%bc%89-TpsOoFhfxz\">\u63a2\u7d22Redis\u4e4b\u5916\u7684\u76f8\u4f3c\u89e3\u6c7a\u65b9\u6848\uff08redis\u76f8\u4f3c\u7684\u5de5\u5177\uff09<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u4e16\u754c\u4e2d\uff0c\u5feb\u901f\u4e14\u9ad8\u6548\u7684\u6578\u64da\u5b58\u53d6\u662f\u8a31\u591a\u61c9\u7528\u7a0b\u5e8f\u6210\u529f\u7684\u95dc\u9375\u3002Redis\u4f5c\u70ba\u4e00\u7a2e\u6d41\u884c\u7684\u5167\u5b58\u6578\u64da\u7d50\u69cb\u5b58\u5132\uff0c\u56e0\u5176\u9ad8\u6027\u80fd\u548c\u9748\u6d3b\u6027\u800c\u53d7\u5230\u5ee3\u6cdb\u4f7f\u7528\u3002\u7136\u800c\uff0c\u9664\u4e86Redis\u4e4b\u5916\uff0c\u9084\u6709\u8a31\u591a\u5176\u4ed6\u76f8\u4f3c\u7684\u89e3\u6c7a\u65b9\u6848\u53ef\u4ee5\u8003\u616e\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u5e7e\u7a2e\u8207Redis\u76f8\u4f3c\u7684\u5de5\u5177\uff0c\u4e26\u5206\u6790\u5b83\u5011\u7684\u7279\u9ede\u548c\u9069\u7528\u5834\u666f\u3002<\/p>\n<h2 id=\"1-memcached-TpsOoFhfxz\">1. Memcached<\/h2>\n<p>Memcached\u662f\u4e00\u500b\u9ad8\u6027\u80fd\u7684\u5206\u4f48\u5f0f\u5167\u5b58\u5c0d\u8c61\u7de9\u5b58\u7cfb\u7d71\uff0c\u4e3b\u8981\u7528\u65bc\u52a0\u901f\u52d5\u614bWeb\u61c9\u7528\u7a0b\u5e8f\u3002\u5b83\u901a\u904e\u6e1b\u5c11\u6578\u64da\u5eab\u8ca0\u8f09\u4f86\u63d0\u9ad8\u6027\u80fd\uff0c\u7279\u5225\u9069\u5408\u65bc\u9700\u8981\u5feb\u901f\u8b80\u53d6\u7684\u5834\u666f\u3002<\/p>\n<ul>\n<li><strong>\u7279\u9ede\uff1a<\/strong>Memcached\u652f\u6301\u591a\u7a2e\u6578\u64da\u985e\u578b\uff0c\u4e26\u4e14\u80fd\u5920\u5728\u591a\u500b\u4f3a\u670d\u5668\u4e4b\u9593\u5206\u914d\u6578\u64da\u3002<\/li>\n<li><strong>\u4f7f\u7528\u5834\u666f\uff1a<\/strong>\u9069\u5408\u7528\u65bc\u7de9\u5b58\u67e5\u8a62\u7d50\u679c\u3001\u6703\u8a71\u6578\u64da\u7b49\u3002<\/li>\n<\/ul>\n<pre><code>\u4f7f\u7528Memcached\u7684\u57fa\u672c\u793a\u4f8b\uff1a\n$memcache = new Memcache;\n$memcache-&gt;connect('localhost', 11211);\n$memcache-&gt;set('key', 'value', false, 3600);\n$value = $memcache-&gt;get('key');\n<\/code><\/pre>\n<h2 id=\"2-apache-ignite-TpsOoFhfxz\">2. Apache Ignite<\/h2>\n<p>Apache Ignite\u662f\u4e00\u500b\u5206\u4f48\u5f0f\u6578\u64da\u5eab\u548c\u8a08\u7b97\u5e73\u53f0\uff0c\u63d0\u4f9b\u4e86\u5167\u5b58\u8a08\u7b97\u7684\u80fd\u529b\u3002\u5b83\u4e0d\u50c5\u652f\u6301\u9375\u503c\u5b58\u5132\uff0c\u9084\u652f\u6301SQL\u67e5\u8a62\u548cACID\u4e8b\u52d9\u3002<\/p>\n<ul>\n<li><strong>\u7279\u9ede\uff1a<\/strong>\u652f\u6301\u591a\u7a2e\u6578\u64da\u5b58\u5132\u683c\u5f0f\uff0c\u4e26\u4e14\u80fd\u5920\u5728\u5167\u5b58\u4e2d\u9032\u884c\u8a08\u7b97\u3002<\/li>\n<li><strong>\u4f7f\u7528\u5834\u666f\uff1a<\/strong>\u9069\u5408\u9700\u8981\u9ad8\u541e\u5410\u91cf\u548c\u4f4e\u5ef6\u9072\u7684\u61c9\u7528\uff0c\u5982\u91d1\u878d\u670d\u52d9\u548c\u96fb\u5546\u5e73\u53f0\u3002<\/li>\n<\/ul>\n<pre><code>\u4f7f\u7528Apache Ignite\u7684\u57fa\u672c\u793a\u4f8b\uff1a\nIgnite ignite = Ignition.start();\nIgniteCache&lt;String, String&gt; cache = ignite.getOrCreateCache(\"myCache\");\ncache.put(\"key\", \"value\");\nString value = cache.get(\"key\");\n<\/code><\/pre>\n<h2 id=\"3-hazelcast-TpsOoFhfxz\">3. Hazelcast<\/h2>\n<p>Hazelcast\u662f\u4e00\u500b\u958b\u6e90\u7684\u5167\u5b58\u6578\u64da\u7db2\u683c\uff0c\u63d0\u4f9b\u4e86\u5206\u4f48\u5f0f\u6578\u64da\u7d50\u69cb\u548c\u8a08\u7b97\u80fd\u529b\u3002\u5b83\u7684\u8a2d\u8a08\u65e8\u5728\u7c21\u5316\u5206\u4f48\u5f0f\u7cfb\u7d71\u7684\u958b\u767c\u3002<\/p>\n<ul>\n<li><strong>\u7279\u9ede\uff1a<\/strong>\u652f\u6301\u591a\u7a2e\u6578\u64da\u7d50\u69cb\uff0c\u5982\u5730\u5716\u3001\u96c6\u5408\u548c\u968a\u5217\uff0c\u4e26\u4e14\u5177\u6709\u81ea\u52d5\u5206\u7247\u548c\u6545\u969c\u8f49\u79fb\u529f\u80fd\u3002<\/li>\n<li><strong>\u4f7f\u7528\u5834\u666f\uff1a<\/strong>\u9069\u5408\u9700\u8981\u9ad8\u53ef\u7528\u6027\u548c\u53ef\u64f4\u5c55\u6027\u7684\u61c9\u7528\uff0c\u5982\u5be6\u6642\u5206\u6790\u548c\u6578\u64da\u8655\u7406\u3002<\/li>\n<\/ul>\n<pre><code>\u4f7f\u7528Hazelcast\u7684\u57fa\u672c\u793a\u4f8b\uff1a\nHazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance();\nIMap&lt;String, String&gt; map = hazelcastInstance.getMap(\"myMap\");\nmap.put(\"key\", \"value\");\nString value = map.get(\"key\");\n<\/code><\/pre>\n<h2 id=\"4-aerospike-TpsOoFhfxz\">4. Aerospike<\/h2>\n<p>Aerospike\u662f\u4e00\u500b\u9ad8\u6027\u80fd\u7684NoSQL\u6578\u64da\u5eab\uff0c\u5c08\u70ba\u5927\u6578\u64da\u61c9\u7528\u800c\u8a2d\u8a08\u3002\u5b83\u63d0\u4f9b\u4e86\u4f4e\u5ef6\u9072\u7684\u6578\u64da\u5b58\u53d6\u548c\u9ad8\u53ef\u64f4\u5c55\u6027\u3002<\/p>\n<ul>\n<li><strong>\u7279\u9ede\uff1a<\/strong>\u652f\u6301\u591a\u7a2e\u6578\u64da\u6a21\u578b\uff0c\u4e26\u4e14\u80fd\u5920\u5728\u5167\u5b58\u548c\u78c1\u789f\u4e4b\u9593\u81ea\u52d5\u7ba1\u7406\u6578\u64da\u3002<\/li>\n<li><strong>\u4f7f\u7528\u5834\u666f\uff1a<\/strong>\u9069\u5408\u9700\u8981\u5feb\u901f\u67e5\u8a62\u548c\u9ad8\u5beb\u5165\u541e\u5410\u91cf\u7684\u61c9\u7528\uff0c\u5982\u5ee3\u544a\u6280\u8853\u548c\u793e\u4ea4\u5a92\u9ad4\u3002<\/li>\n<\/ul>\n<pre><code>\u4f7f\u7528Aerospike\u7684\u57fa\u672c\u793a\u4f8b\uff1a\nAerospikeClient client = new AerospikeClient(\"localhost\", 3000);\nKey key = new Key(\"test\", \"demo\", \"key\");\nBin bin = new Bin(\"bin\", \"value\");\nclient.put(null, key, bin);\nRecord record = client.get(null, key);\n<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-TpsOoFhfxz\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5b58\u5132\u89e3\u6c7a\u65b9\u6848\u6642\uff0c\u958b\u767c\u8005\u61c9\u6839\u64da\u5177\u9ad4\u9700\u6c42\u8003\u616e\u4e0d\u540c\u5de5\u5177\u7684\u7279\u9ede\u548c\u512a\u52e2\u3002\u7121\u8ad6\u662f\u9078\u64c7Memcached\u3001Apache Ignite\u3001Hazelcast\u9084\u662fAerospike\uff0c\u6bcf\u7a2e\u5de5\u5177\u90fd\u6709\u5176\u7368\u7279\u7684\u61c9\u7528\u5834\u666f\u548c\u6027\u80fd\u512a\u52e2\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6027\u80fd\u548c\u53ef\u64f4\u5c55\u6027\u7684\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684\u89e3\u6c7a\u65b9\u6848\u81f3\u95dc\u91cd\u8981\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u53ef\u9760\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u4f86\u90e8\u7f72\u9019\u4e9b\u6280\u8853\uff0cServer.HK\u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\u4ee5\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22Redis\u4e4b\u5916\u7684\u76f8\u4f3c\u89e3\u6c7a\u65b9\u6848\uff0c\u4e86\u89e3\u5176\u4ed6\u9ad8\u6548\u7684\u6578\u64da\u5b58\u5132\u5de5\u5177\uff0c\u63d0\u5347\u61c9\u7528\u6027\u80fd\u8207\u64f4\u5c55\u6027\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-188730","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/188730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=188730"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/188730\/revisions"}],"predecessor-version":[{"id":188731,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/188730\/revisions\/188731"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=188730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=188730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=188730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}