{"id":10020386,"date":"2024-11-08T13:34:22","date_gmt":"2024-11-08T05:34:22","guid":{"rendered":"https:\/\/itmax.cn\/?p=10020386"},"modified":"2024-11-08T13:34:22","modified_gmt":"2024-11-08T05:34:22","slug":"%e8%af%84%e8%ae%ba%e7%b3%bb%e7%bb%9f%e8%ae%be%e8%ae%a1%e6%80%9d%e8%b7%af","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10020386","title":{"rendered":"\u8bc4\u8bba\u7cfb\u7edf\u8bbe\u8ba1\u601d\u8def"},"content":{"rendered":"<p>@[toc]<br \/>\u65e0\u8bba\u6211\u4eec\u662f\u9605\u8bfb\u516c\u4f17\u53f7\u6587\u7ae0\u8fd8\u662f\u5237\u77ed\u89c6\u9891\uff0c\u73b0\u5728\u90fd\u6709\u8bc4\u8bba\u529f\u80fd\uff0c\u800c\u4e14\u8fd9\u4e9b\u8bc4\u8bba\u57fa\u672c\u4e0a\u4e5f\u90fd\u662f\u652f\u6301\u201c\u697c\u4e2d\u697c\u201d\uff0c\u4e5f\u5c31\u662f\u6587\u7ae0\u4e0b\u9762\u6709\u8bc4\u8bba\uff0c\u8bc4\u8bba\u4e0b\u9762\u6709\u56de\u590d\uff0c\u56de\u590d\u4e0b\u9762\u53c8\u6709\u56de\u590d\uff0c\u56de\u590d\u8fd8\u53ef\u4ee5\u7ee7\u7eed\u56de\u590d&#8230;<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000045457027\" alt=\"\" title=\"\"><\/p>\n<p>\u5982\u679c\u6570\u636e\u91cf\u4e0d\u5927\u7684\u8bdd\uff0c\u8fd9\u4e2a\u8868\u5176\u5b9e\u5f88\u597d\u8bbe\u8ba1\uff0c\u4e00\u5f20\u8868\u5c31\u53ef\u4ee5\u641e\u5b9a\uff0c\u7c7b\u4f3c\u6211\u4eec\u5e38\u89c1\u7684\u7701\u5e02\u53bf\u8868\u7ed3\u6784\uff1a<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000045457028\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<pre><code class=\"sql\">CREATE TABLE administrative_divisions (\n  id INT AUTO_INCREMENT PRIMARY KEY,\n  name VARCHAR(100) NOT NULL,\n  parent_id INT DEFAULT NULL,\n  level TINYINT NOT NULL,\n  country_code VARCHAR(10),\n  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n  INDEX idx_parent_id (parent_id),\n  INDEX idx_level (level)\n);<\/code><\/pre>\n<p>\u5bf9\u4e8e\u8fd9\u79cd\u7ed3\u6784\u7684\u8868\uff0c\u6570\u636e\u91cf\u4e0d\u5927\u7684\u8bdd\u6ca1\u95ee\u9898\uff0c\u6570\u636e\u91cf\u5927\u7684\u8bdd\uff0c\u67e5\u8be2\u6027\u80fd\u548c\u7ef4\u62a4\u90fd\u4f1a\u6210\u4e3a\u95ee\u9898\u3002<\/p>\n<p>\u4eca\u5929\u6211\u4eec\u5c31\u6765\u8ba8\u8bba\u4e0b\u8fd9\u79cd\u8bc4\u8bba\u8868\u5982\u4f55\u8bbe\u8ba1\u4f1a\u597d\u4e00\u4e9b\uff0c\u4e5f\u662f\u677e\u54e5\u6700\u8fd1\u5de5\u4f5c\u4e2d\u7684\u4e00\u70b9\u70b9\u7ecf\u9a8c\uff0c\u6b22\u8fce\u5c0f\u4f19\u4f34\u4eec\u6279\u8bc4\u6307\u6b63\u3002<\/p>\n<h2>\u4e00 \u8868\u8bbe\u8ba1<\/h2>\n<p>\u56e0\u4e3a\u73b0\u5728\u65e0\u8bba\u662f\u6587\u7ae0\u8fd8\u662f\u77ed\u89c6\u9891\uff0c\u8bc4\u8bba\u6570\u52a8\u8f84\u5f88\u5927\uff0c\u6240\u4ee5\u7cfb\u7edf\u5728\u663e\u793a\u7684\u65f6\u5019\uff0c\u5f80\u5f80\u4f1a\u5148\u8fdb\u884c\u8bc4\u8bba\u6298\u53e0\uff0c\u53ea\u663e\u793a\u4e00\u4e2a\u603b\u6570\uff0c\u70b9\u51fb\u5c55\u5f00\u7684\u65f6\u5019\uff0c\u624d\u4f1a\u663e\u793a\u51fa\u6765\uff0c\u4ee5\u5fae\u4fe1\u516c\u4f17\u53f7\u4e3a\u4f8b\uff0c\u4e00\u822c\u662f\u8fd9\u6837\uff1a<\/p>\n<p>\u9996\u5148\u5728\u6587\u7ae0\u4e0b\u65b9\u4f1a\u5148\u5c55\u793a\u4e00\u4e2a\u8bc4\u8bba\u603b\u6570\uff1a<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000045457029\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u70b9\u5f00\u8bc4\u8bba\u533a\u4e4b\u540e\uff0c\u8fd9\u91cc\u4e5f\u6709\u4e24\u4e2a\u503c\u5f97\u5173\u6ce8\u7684\u4fe1\u606f\uff1a<\/p>\n<ol>\n<li>\u8bc4\u8bba\u533a\u4e0a\u65b9\u4f1a\u663e\u793a\u603b\u7684\u8bc4\u8bba\u6570<\/li>\n<li>\u56de\u590d\u7684\u8bc4\u8bba\u4e0d\u4f1a\u4e00\u6b21\u6027\u663e\u793a\u51fa\u6765\uff0c\u4f46\u662f\u4f1a\u663e\u793a\u6709\u591a\u5c11\u6761\u56de\u590d\uff0c\u9700\u8981\u7528\u6237\u70b9\u51fb\u4e4b\u540e\u624d\u53ef\u4ee5\u770b\u5230\u56de\u590d\u5185\u5bb9\u3002<\/li>\n<\/ol>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000045457030\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<blockquote><p>\u53e6\u5916\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u56de\u590d\u6570\u91cf\u7279\u522b\u591a\u7684\u8bdd\uff0c\u4e5f\u4e0d\u4f1a\u4e00\u6b21\u6027\u5168\u90e8\u5c55\u793a\u51fa\u6765\u3002<\/p><\/blockquote>\n<p>\u9996\u5148\u8fd9\u6837\u7684\u8bbe\u8ba1\u662f\u5408\u7406\u7684\uff0c\u8fd9\u4e2a\u76f8\u4fe1\u5927\u5bb6\u5e94\u8be5\u6ca1\u4ec0\u4e48\u5f02\u8bae\uff0c\u8bc4\u8bba\u56de\u590d\u4e4b\u6240\u4ee5\u4e0d\u4e00\u6b21\u6027\u5168\u90e8\u5c55\u793a\uff0c\u4e00\u65b9\u9762\u662f\u6027\u80fd\u8003\u8651\uff0c\u53e6\u4e00\u65b9\u9762\u4e5f\u662f\u7528\u6237\u4f53\u9a8c\u8003\u8651\u3002\u6709\u7684\u8bc4\u8bba\u56de\u590d\u7279\u522b\u591a\uff0c\u4e00\u6b21\u6027\u5168\u90e8\u5c55\u793a\u51fa\u6765\uff0c\u4f1a\u5f71\u54cd\u67e5\u770b\u4e00\u7ea7\u8bc4\u8bba\u3002<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u5c31\u770b\u4e0b\u8fd9\u6837\u7684\u8bc4\u8bba\u529f\u80fd\uff0c\u8868\u8be5\u5982\u4f55\u8bbe\u8ba1\u3002<\/p>\n<p>\u4e3a\u4e86\u6ee1\u8db3\u8fd9\u4e9b\u8981\u6c42\uff0c\u6211\u4eec\u5c06\u8bbe\u8ba1\u4e09\u4e2a\u8868\uff1a<code>Articles<\/code>\uff08\u6587\u7ae0\u8868\uff09\uff0c<code>Comments<\/code>\uff08\u8bc4\u8bba\u7d22\u5f15\u8868\uff09\uff0c\u548c <code>CommentsContent<\/code>\uff08\u8bc4\u8bba\u5185\u5bb9\u8868\uff09\u3002\u6587\u7ae0\u8868\u5c06\u8bb0\u5f55\u6587\u7ae0\u7684\u6839\u8bc4\u8bba\u6570\uff0c\u8bc4\u8bba\u7d22\u5f15\u8868\u5c06\u8bb0\u5f55\u8bc4\u8bba\u7684\u5c42\u7ea7\u5173\u7cfb\u3001\u56de\u590d\u6570\u91cf\u548c\u70b9\u8d5e\u6570\u91cf\uff0c\u8bc4\u8bba\u5185\u5bb9\u8868\u5c06\u5b58\u50a8\u5b9e\u9645\u7684\u8bc4\u8bba\u5185\u5bb9\u3002<\/p>\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u65b9\u5f0f\u901a\u8fc7\u5c06\u8bc4\u8bba\u5185\u5bb9\u548c\u8bc4\u8bba\u7d22\u5f15\u5206\u5f00\u5b58\u50a8\uff0c\u63d0\u9ad8\u4e86\u67e5\u8be2\u6027\u80fd\uff0c\u540c\u65f6\u4e5f\u4fbf\u4e8e\u6570\u636e\u7ef4\u62a4\uff0c\u5e76\u4e14\u901a\u8fc7\u6587\u7ae0\u8868\u8bb0\u5f55\u6587\u7ae0\u7684\u6839\u8bc4\u8bba\u6570\uff0c\u65b9\u4fbf\u5feb\u901f\u7edf\u8ba1\u3002<\/p>\n<blockquote><p>\u4ee5\u4e0b\u8bbe\u8ba1\u4e3b\u8981\u63d0\u4f9b\u601d\u8def\uff0c\u5927\u5bb6\u4e0d\u5fc5\u7ea0\u7ed3\u4e8e\u8868\u540d\u79f0\u3002<\/p><\/blockquote>\n<h4>Articles\uff08\u6587\u7ae0\u8868\uff09<\/h4>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5\u540d<\/th>\n<th>\u6570\u636e\u7c7b\u578b<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>article_id<\/td>\n<td>BIGINT AUTO_INCREMENT<\/td>\n<td>\u4e3b\u952e\uff0c\u81ea\u589e<\/td>\n<\/tr>\n<tr>\n<td>title<\/td>\n<td>VARCHAR(255)<\/td>\n<td>\u6587\u7ae0\u6807\u9898<\/td>\n<\/tr>\n<tr>\n<td>root_comment_count<\/td>\n<td>INT DEFAULT 0<\/td>\n<td>\u6587\u7ae0\u7684\u6839\u8bc4\u8bba\u6570<\/td>\n<\/tr>\n<tr>\n<td>created_at<\/td>\n<td>DATETIME<\/td>\n<td>\u521b\u5efa\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>updated_at<\/td>\n<td>DATETIME<\/td>\n<td>\u66f4\u65b0\u65f6\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Comments\uff08\u8bc4\u8bba\u7d22\u5f15\u8868\uff09<\/h4>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5\u540d<\/th>\n<th>\u6570\u636e\u7c7b\u578b<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>comment_id<\/td>\n<td>BIGINT AUTO_INCREMENT<\/td>\n<td>\u4e3b\u952e\uff0c\u81ea\u589e<\/td>\n<\/tr>\n<tr>\n<td>article_id<\/td>\n<td>BIGINT<\/td>\n<td>\u6587\u7ae0ID<\/td>\n<\/tr>\n<tr>\n<td>parent_id<\/td>\n<td>BIGINT DEFAULT 0<\/td>\n<td>\u7236\u8bc4\u8bbaID\uff0c\u7528\u4e8e\u5b9e\u73b0\u591a\u7ea7\u8bc4\u8bba\uff0c\u9876\u7ea7\u8bc4\u8bba\u6b64\u5b57\u6bb5\u4e3a0<\/td>\n<\/tr>\n<tr>\n<td>user_id<\/td>\n<td>BIGINT<\/td>\n<td>\u53d1\u8868\u8bc4\u8bba\u7684\u7528\u6237ID<\/td>\n<\/tr>\n<tr>\n<td>reply_count<\/td>\n<td>INT DEFAULT 0<\/td>\n<td>\u8fd9\u6761\u8bc4\u8bba\u7684\u56de\u590d\u6570\u91cf<\/td>\n<\/tr>\n<tr>\n<td>like_count<\/td>\n<td>INT DEFAULT 0<\/td>\n<td>\u8fd9\u6761\u8bc4\u8bba\u7684\u70b9\u8d5e\u6570\u91cf<\/td>\n<\/tr>\n<tr>\n<td>created_at<\/td>\n<td>DATETIME<\/td>\n<td>\u521b\u5efa\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>updated_at<\/td>\n<td>DATETIME<\/td>\n<td>\u66f4\u65b0\u65f6\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>CommentsContent\uff08\u8bc4\u8bba\u5185\u5bb9\u8868\uff09<\/h4>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5\u540d<\/th>\n<th>\u6570\u636e\u7c7b\u578b<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>comment_id<\/td>\n<td>BIGINT<\/td>\n<td>\u5916\u952e\uff0c\u5173\u8054\u8bc4\u8bba\u7d22\u5f15\u8868\u7684comment_id<\/td>\n<\/tr>\n<tr>\n<td>comment_text<\/td>\n<td>TEXT<\/td>\n<td>\u8bc4\u8bba\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>comment_time<\/td>\n<td>DATETIME<\/td>\n<td>\u8bc4\u8bba\u65f6\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>SQL \u521b\u5efa\u8868\u7684\u8bed\u53e5<\/h4>\n<pre><code class=\"sql\">-- \u521b\u5efa\u6587\u7ae0\u8868\nCREATE TABLE articles (\n  article_id BIGINT AUTO_INCREMENT PRIMARY KEY,\n  title VARCHAR(255) NOT NULL,\n  root_comment_count INT DEFAULT 0,\n  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n  INDEX idx_root_comment_count (root_comment_count)\n);\n\n-- \u521b\u5efa\u8bc4\u8bba\u7d22\u5f15\u8868\nCREATE TABLE comments (\n  comment_id BIGINT AUTO_INCREMENT PRIMARY KEY,\n  article_id BIGINT NOT NULL,\n  parent_id BIGINT DEFAULT 0,\n  user_id BIGINT NOT NULL,\n  reply_count INT DEFAULT 0,\n  like_count INT DEFAULT 0,\n  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n  INDEX idx_article_id (article_id),\n  INDEX idx_parent_id (parent_id)\n);\n\n-- \u521b\u5efa\u8bc4\u8bba\u5185\u5bb9\u8868\nCREATE TABLE comments_content (\n  comment_id BIGINT PRIMARY KEY,\n  comment_text TEXT NOT NULL,\n  comment_time DATETIME DEFAULT CURRENT_TIMESTAMP,\n  FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n);<\/code><\/pre>\n<h4>\u89e6\u53d1\u5668<\/h4>\n<blockquote><p>\u89e6\u53d1\u5668\u4e3b\u8981\u7528\u4e8e\u66f4\u65b0\u6587\u7ae0\u7684\u6839\u8bc4\u8bba\u6570\u548c\u8bc4\u8bba\u7684\u56de\u590d\u6570\u91cf\u53ca\u70b9\u8d5e\u6570\u91cf\uff0c\u4e0d\u8fc7\u8fd9\u4e2a\u5e76\u975e\u5fc5\u987b\uff0c\u8fd9\u4e2a\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e1a\u52a1\u903b\u8f91\u53bb\u5904\u7406\uff0c\u677e\u54e5\u8fd9\u91cc\u4e3b\u8981\u662f\u7ed9\u5927\u5bb6\u63d0\u4f9b\u4e00\u4e2a\u53c2\u8003\u3002<\/p><\/blockquote>\n<pre><code class=\"sql\">DELIMITER \/\/\nCREATE TRIGGER after_comment_insert\nAFTER INSERT ON comments\nFOR EACH ROW\nBEGIN\n  IF NEW.parent_id = 0 THEN\n    UPDATE articles SET root_comment_count = root_comment_count + 1 WHERE article_id = NEW.article_id;\n  END IF;\nEND; \/\/\nDELIMITER ;\n\nCREATE TRIGGER after_comment_like_insert\nAFTER INSERT ON comments\nFOR EACH ROW\nBEGIN\n  UPDATE comments SET like_count = like_count + 1 WHERE comment_id = NEW.comment_id;\nEND; \/\/\nDELIMITER ;\n\nCREATE TRIGGER after_comment_reply_insert\nAFTER INSERT ON comments\nFOR EACH ROW\nBEGIN\n  UPDATE comments SET reply_count = reply_count + 1 WHERE comment_id = NEW.parent_id;\nEND; \/\/\nDELIMITER ;\n\nCREATE TRIGGER after_comment_delete\nBEFORE DELETE ON comments\nFOR EACH ROW\nBEGIN\n  IF OLD.parent_id = 0 THEN\n    UPDATE articles SET root_comment_count = root_comment_count - 1 WHERE article_id = OLD.article_id;\n  ELSE\n    UPDATE comments SET reply_count = reply_count - 1 WHERE comment_id = OLD.parent_id;\n  END IF;\nEND; \/\/\nDELIMITER ;<\/code><\/pre>\n<p>\u5728 <code>Comments<\/code> \u8868\u7684 <code>article_id<\/code> \u548c <code>parent_id<\/code> \u5b57\u6bb5\u4e0a\u521b\u5efa\u7d22\u5f15\uff0c\u53ef\u4ee5\u63d0\u9ad8\u67e5\u8be2\u7279\u5b9a\u6587\u7ae0\u7684\u8bc4\u8bba\u53ca\u5176\u5b50\u8bc4\u8bba\u7684\u6027\u80fd\u3002<\/p>\n<p>\u6839\u636e\u4e0a\u9762\u7684\u8bbe\u8ba1\uff0c\u5f53\u6211\u4eec\u60f3\u8981\u83b7\u53d6\u8bc4\u8bba\u603b\u6570\u3001\u56de\u590d\u603b\u6570\u7684\u65f6\u5019\uff0c\u76f4\u63a5\u67e5\u8be2\u5c31\u53ef\u4ee5\u4e86\uff0c\u5c31\u4e0d\u9700\u8981\u7edf\u8ba1\u4e86\uff0c\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<h2>\u4e8c \u6dfb\u52a0\u8bc4\u8bba<\/h2>\n<p>\u4e3a\u4e86\u5e94\u5bf9\u9ad8\u5e76\u53d1\uff0c\u6dfb\u52a0\u8bc4\u8bba\u8fd9\u5757\u6211\u4eec\u53ef\u4ee5\u7ed3\u5408 MQ \u53bb\u5b8c\u6210\u3002<\/p>\n<ol>\n<li>\u9996\u5148\u524d\u7aef\u53d1\u9001\u8bc4\u8bba\u5230\u670d\u52a1\u7aef\u3002<\/li>\n<li>\u670d\u52a1\u7aef\u6536\u5230\u8bc4\u8bba\u6d88\u606f\u4e4b\u540e\uff0c\u5c06\u4e4b\u53d1\u7ed9 MQ \u53bb\u5904\u7406\u3002<\/li>\n<li>\u6d88\u8d39\u8005\u4ece MQ \u4e0a\u6d88\u8d39\u6d88\u606f\uff0c\u5411\u6570\u636e\u6dfb\u52a0\u8bc4\u8bba\u3002<\/li>\n<li>\u6dfb\u52a0\u5b8c\u6210\u540e\uff0c\u5c06\u6dfb\u52a0\u6210\u529f\u7684\u6d88\u606f\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\u3002<\/li>\n<\/ol>\n<blockquote><p>\u4ee5\u4e0a\u6b65\u9aa4\u9700\u8981\u786e\u4fdd MQ \u6d88\u606f\u53ef\u9760\u6027\uff0c\u5177\u4f53\u5982\u4f55\u786e\u4fdd\u53ef\u9760\u6027\uff0c\u677e\u54e5\u5728\u4e4b\u524d\u7684\u6587\u7ae0\u4e2d\u548c\u5927\u5bb6\u804a\u8fc7\u4e86\uff08[\u56db\u79cd\u7b56\u7565\u786e\u4fdd RabbitMQ \u6d88\u606f\u53d1\u9001\u53ef\u9760\u6027\uff01\u4f60\u7528\u54ea\u79cd\uff1f<br \/>](<a href=\"https:\/\/link.segmentfault.com\/?enc=yRsZSwMlcav73Xc1r2Ggvg%3D%3D.Mh27IYtGU607h8Zw8HvaHzmQq20E3OhXe%2BNZdA1FM5iU%2BU6o4jhaqACFam30awqMdhIv2D5vRkApyxGgo7fPnQ%3D%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/mp.weixin.qq.com\/s\/hj8iqASSOk2AgdtkuLPCCQ<\/a>)\uff09\uff0c\u8fd9\u91cc\u5c31\u4e0d\u518d\u8d58\u8ff0\u3002<\/p><\/blockquote>\n<p>\u53e6\u5916\u8fd8\u6709\u4e00\u70b9\u5c31\u662f\u5982\u679c\u9700\u8981\u5bf9\u8bc4\u8bba\u5185\u5bb9\u8fdb\u884c\u5206\u6790\uff0c\u90a3\u4e48\u5728\u7b2c 4 \u6b65\u5b8c\u6210\u4e4b\u540e\uff0c\u8fd8\u662f\u901a\u8fc7\u6d88\u8d39 MQ \u6d88\u606f\u5c06\u8bc4\u8bba\u5b58\u5165 ES\uff1b\u6216\u8005\u901a\u8fc7 Canal \u4e4b\u7c7b\u7684\u5de5\u5177\uff0c\u5c06\u8868\u4e2d\u7684\u6570\u636e\u540c\u6b65\u5230 ES\u3002<\/p>\n<h2>\u4e09 \u67e5\u8be2\u8bc4\u8bba<\/h2>\n<p>\u70ed\u95e8\u8bc4\u8bba\u53ef\u4ee5\u5b58\u5165\u7f13\u5b58\u4e2d\uff0c\u907f\u514d\u6bcf\u6b21\u67e5\u8be2\u6570\u636e\u5e93\uff0c\u8fd9\u4e2a\u677e\u54e5\u4e4b\u524d\u6709\u8fc7\u4e13\u95e8\u7684\u6587\u7ae0\uff0c\u5c0f\u4f19\u4f34\u4eec\u53ef\u4ee5\u53c2\u8003\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/link.segmentfault.com\/?enc=Ne44a8s5xpp5Gsx3Yl3i4A%3D%3D.Q%2Fu%2BVqyJpsZWbc%2FmJl0iUhqqFfrWXaVJBhRH3QjeHITyftevWloZRGVDkcJwzrV9SD8DB7z4BIlDTQUH6L%2Ft%2Bg%3D%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">\u70b9\u8d5e\u6536\u85cf\u529f\u80fd\u8be5\u5982\u4f55\u8bbe\u8ba1\uff1f<\/a><\/li>\n<\/ul>\n<p>\u867d\u7136\u5f53\u65f6\u5199\u7684\u662f\u70b9\u8d5e\u6536\u85cf\uff0c\u4f46\u662f\u548c\u8fd9\u91cc\u601d\u8def\u57fa\u672c\u4e00\u81f4\u3002<\/p>\n<p>\u53e6\u4e00\u65b9\u9762\u5c31\u662f\u8bfb\u5199\u5206\u79bb\u3002<\/p>\n<p>\u8bc4\u8bba\u6570\u636e\u662f\u975e\u5e38\u5178\u578b\u7684\u8bfb\u591a\u5199\u5c11\u573a\u666f\uff0c\u56e0\u6b64\u6211\u4eec\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u5c42\u9762\u8fdb\u884c\u8bfb\u5199\u5206\u79bb\uff0c\u4ee5\u63d0\u5347\u6027\u80fd\u3002<\/p>\n<p>\u597d\u5566\uff0c\u76ee\u524d\u7684\u601d\u8def\u5927\u81f4\u4e0a\u5c31\u662f\u8fd9\u6837\uff0c\u5982\u679c\u6709\u4e0d\u540c\u770b\u6cd5\uff0c\u6b22\u8fce\u5c0f\u4f19\u4f34\u4eec\u7559\u8a00\u8ba8\u8bba\u3002<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000045457025\">https:\/\/segmentfault.com\/a\/1190000045457025<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>@[toc]\u65e0\u8bba\u6211\u4eec\u662f\u9605\u8bfb\u516c\u4f17\u53f7\u6587\u7ae0\u8fd8\u662f\u5237\u77ed\u89c6\u9891\uff0c\u73b0\u5728\u90fd\u6709\u8bc4\u8bba\u529f\u80fd\uff0c\u800c\u4e14\u8fd9\u4e9b\u8bc4\u8bba\u57fa\u672c\u4e0a\u4e5f\u90fd\u662f\u652f\u6301\u201c\u697c\u4e2d\u697c\u201d\uff0c\u4e5f [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10020386","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10020386"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020386\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10020386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10020386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10020386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}