{"id":6961,"date":"2025-12-29T10:22:17","date_gmt":"2025-12-29T02:22:17","guid":{"rendered":"https:\/\/t.n-years.com\/?p=6961"},"modified":"2025-12-29T10:22:17","modified_gmt":"2025-12-29T02:22:17","slug":"%e7%8b%ac%e7%ab%8b%e7%9a%84%e8%bf%9e%e6%8e%a5%e6%b1%a0-%e5%92%8c-%e7%8b%ac%e7%ab%8b%e6%95%b0%e6%8d%ae%e5%ba%93%e5%ae%9e%e4%be%8b%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/t.n-years.com\/?p=6961","title":{"rendered":"\u72ec\u7acb\u7684\u8fde\u63a5\u6c60 \u548c \u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b\u7684\u533a\u522b"},"content":{"rendered":"<p>\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u5173\u952e\u7684\u7cfb\u7edf\u67b6\u6784\u95ee\u9898\uff0c\u5c24\u5176\u5728<strong>\u591a\u79df\u6237\uff08Multi-tenancy\uff09\u5e73\u53f0\u8bbe\u8ba1<\/strong>\u4e2d\u7ecf\u5e38\u88ab\u95ee\u5230\u3002<br \/>\n\u201c\u72ec\u7acb\u7684\u8fde\u63a5\u6c60\u201d\u548c\u201c\u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b\u201d\u867d\u7136\u90fd\u7528\u4e8e<strong>\u8d44\u6e90\u9694\u79bb<\/strong>\uff0c\u4f46\u5b83\u4eec\u4f5c\u7528\u7684<strong>\u5c42\u7ea7\u3001\u9694\u79bb\u5f3a\u5ea6\u3001\u6210\u672c\u548c\u9002\u7528\u573a\u666f<\/strong>\u5b8c\u5168\u4e0d\u540c\u3002<\/p>\n<p>\u4e0b\u9762\u4ece\u591a\u4e2a\u7ef4\u5ea6\u6e05\u6670\u5bf9\u6bd4\uff1a<\/p>\n<hr \/>\n<h3>\u2705 \u4e00\u3001\u6838\u5fc3\u5b9a\u4e49<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6982\u5ff5<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u72ec\u7acb\u7684\u8fde\u63a5\u6c60\uff08Independent Connection Pool\uff09<\/strong><\/td>\n<td>\u5728<strong>\u540c\u4e00\u4e2a\u6570\u636e\u5e93\u5b9e\u4f8b<\/strong>\u4e2d\uff0c\u4e3a\u4e0d\u540c\u79df\u6237\uff08\u6216\u670d\u52a1\uff09\u914d\u7f6e<strong>\u5404\u81ea\u72ec\u7acb\u7684\u6570\u636e\u5e93\u8fde\u63a5\u6c60<\/strong>\uff08\u5982 HikariCP \u5b9e\u4f8b\uff09\uff0c\u9650\u5236\u5176\u6700\u5927\u8fde\u63a5\u6570\u3001\u8d85\u65f6\u7b49\u53c2\u6570\u3002<\/td>\n<\/tr>\n<tr>\n<td><strong>\u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b\uff08Dedicated Database Instance\uff09<\/strong><\/td>\n<td>\u4e3a\u6bcf\u4e2a\u79df\u6237\u5206\u914d<strong>\u5b8c\u5168\u72ec\u7acb\u7684\u6570\u636e\u5e93\u8fdb\u7a0b\/\u670d\u52a1\u5668<\/strong>\uff08\u5982\u5355\u72ec\u7684 MySQL RDS \u5b9e\u4f8b\u3001\u72ec\u7acb\u7684 Docker \u5bb9\u5668\u6216\u7269\u7406\u673a\uff09\uff0c\u6570\u636e\u3001\u8ba1\u7b97\u3001\u7f51\u7edc\u8d44\u6e90\u5b8c\u5168\u9694\u79bb\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u2705 \u4e8c\u3001\u5bf9\u6bd4\u7ef4\u5ea6\u8be6\u89e3<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u7ef4\u5ea6<\/th>\n<th>\u72ec\u7acb\u7684\u8fde\u63a5\u6c60<\/th>\n<th>\u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u9694\u79bb\u5c42\u7ea7<\/strong><\/td>\n<td><strong>\u5e94\u7528\u5c42 \/ \u8fde\u63a5\u5c42<\/strong> \u9694\u79bb<\/td>\n<td><strong>\u57fa\u7840\u8bbe\u65bd\u5c42<\/strong> \u9694\u79bb\uff08OS + DB \u8fdb\u7a0b + \u7f51\u7edc\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u6570\u636e\u5b58\u50a8<\/strong><\/td>\n<td>\u6240\u6709\u79df\u6237\u5171\u4eab\u540c\u4e00\u5957\u7269\u7406\u6570\u636e\u5e93\uff08\u53ef\u80fd\u540c\u5e93\u540c\u8868\uff0c\u9760 <code>tenant_id<\/code>\uff1b\u6216\u540c\u5b9e\u4f8b\u4e0d\u540c\u5e93\uff09<\/td>\n<td>\u6bcf\u4e2a\u79df\u6237\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u6570\u636e\u5e93\u6587\u4ef6\/\u5b58\u50a8\u5377<\/td>\n<\/tr>\n<tr>\n<td><strong>CPU \/ \u5185\u5b58\u9694\u79bb<\/strong><\/td>\n<td>\u274c \u65e0\u9694\u79bb<br \/>\uff08\u4e00\u4e2a\u79df\u6237\u7684\u6162\u67e5\u8be2\u4ecd\u4f1a\u5403\u6ee1 DB CPU\uff09<\/td>\n<td>\u2705 \u5f3a\u9694\u79bb<br \/>\uff08\u8d44\u6e90\u7531\u4e91\u5382\u5546\u6216 K8s \u9650\u5236\uff0c\u4e92\u4e0d\u5f71\u54cd\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8fde\u63a5\u6570\u63a7\u5236<\/strong><\/td>\n<td>\u2705 \u53ef\u9650\u5236\u6bcf\u4e2a\u79df\u6237\u6700\u591a\u7528 20 \u4e2a\u8fde\u63a5\uff0c\u9632\u6b62\u5355\u79df\u6237\u8017\u5c3d\u8fde\u63a5\u6c60<\/td>\n<td>\u2705 \u5929\u7136\u9694\u79bb\uff0c\u6bcf\u4e2a\u5b9e\u4f8b\u6709\u72ec\u7acb\u8fde\u63a5\u4e0a\u9650<\/td>\n<\/tr>\n<tr>\n<td><strong>\u6545\u969c\u5f71\u54cd\u8303\u56f4<\/strong><\/td>\n<td>\u26a0\ufe0f \u5355\u79df\u6237\u5f02\u5e38\uff08\u5982\u6b7b\u9501\u3001\u5927\u4e8b\u52a1\uff09\u53ef\u80fd\u62d6\u57ae\u6574\u4e2a DB \u5b9e\u4f8b\uff0c\u5f71\u54cd\u6240\u6709\u79df\u6237<\/td>\n<td>\u2705 \u6545\u969c\u4ec5\u9650\u672c\u79df\u6237\uff0c\u5176\u4ed6\u79df\u6237\u5b8c\u5168\u4e0d\u53d7\u5f71\u54cd<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8fd0\u7ef4\u590d\u6742\u5ea6<\/strong><\/td>\n<td>\u4f4e\uff08\u53ea\u9700\u7ba1\u7406\u4e00\u4e2a DB \u5b9e\u4f8b\uff09<\/td>\n<td>\u9ad8\uff08\u9700\u7ba1\u7406 N \u4e2a\u5b9e\u4f8b\uff1a\u5907\u4efd\u3001\u5347\u7ea7\u3001\u76d1\u63a7\u3001\u6269\u7f29\u5bb9\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u6210\u672c<\/strong><\/td>\n<td>\u4f4e\uff08\u5171\u4eab\u8d44\u6e90\uff09<\/td>\n<td>\u9ad8\uff08\u6bcf\u4e2a\u5b9e\u4f8b\u6709\u6700\u4f4e\u8ba1\u8d39\u5355\u4f4d\uff0c\u8d44\u6e90\u5229\u7528\u7387\u53ef\u80fd\u4f4e\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5408\u89c4\u6027<\/strong><\/td>\n<td>\u4e00\u822c\uff08\u903b\u8f91\u9694\u79bb\uff0c\u5ba1\u8ba1\u96be\uff09<\/td>\n<td>\u5f3a\uff08\u6ee1\u8db3\u91d1\u878d\u3001\u653f\u52a1\u7b49\u5bf9\u201c\u7269\u7406\u9694\u79bb\u201d\u7684\u8981\u6c42\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5178\u578b\u4f7f\u7528\u573a\u666f<\/strong><\/td>\n<td>\u4e2d\u5c0f SaaS\u3001\u5185\u90e8\u5e73\u53f0\u3001\u6d41\u91cf\u5747\u8861\u7684\u79df\u6237<\/td>\n<td>\u5927\u5ba2\u6237\u3001\u9ad8 SLA \u8981\u6c42\u3001\u5f3a\u76d1\u7ba1\u884c\u4e1a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u2705 \u4e09\u3001\u4e3e\u4e2a\u5b9e\u9645\u4f8b\u5b50<\/h3>\n<p>\u5047\u8bbe\u4f60\u6709\u4e00\u4e2a\u77ed\u5267\u5e73\u53f0\uff0c\u670d\u52a1 100 \u4e2a\u5c0f\u7a0b\u5e8f\uff08\u79df\u6237\uff09\uff1a<\/p>\n<ul>\n<li>\n<p><strong>\u65b9\u6848 A\uff1a\u72ec\u7acb\u8fde\u63a5\u6c60\uff08\u5171\u4eab RDS \u5b9e\u4f8b\uff09<\/strong><\/p>\n<ul>\n<li>\u6240\u6709\u79df\u6237\u5171\u7528\u4e00\u4e2a MySQL RDS\uff08\u5982 4C8G\uff09\uff1b<\/li>\n<li>\u4e3a\u6bcf\u4e2a\u79df\u6237\u914d\u7f6e max=10 \u7684\u8fde\u63a5\u6c60\uff1b<\/li>\n<li>\u5982\u679c\u79df\u6237 A \u6267\u884c\u4e86\u4e00\u4e2a\u5168\u8868\u626b\u63cf\uff0cMySQL CPU \u6253\u6ee1 \u2192 <strong>\u6240\u6709\u79df\u6237\u53d8\u6162<\/strong>\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u65b9\u6848 B\uff1a\u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b<\/strong><\/p>\n<ul>\n<li>\u79df\u6237 A \u4f7f\u7528 RDS-A\uff082C4G\uff09\uff0c\u79df\u6237 B \u4f7f\u7528 RDS-B\uff082C4G\uff09\uff1b<\/li>\n<li>\u79df\u6237 A \u7684\u6162\u67e5\u8be2\u53ea\u5f71\u54cd\u81ea\u5df1\uff1b<\/li>\n<li>\u6210\u672c\u53ef\u80fd\u662f\u65b9\u6848 A \u7684 5\u201310 \u500d\uff0c\u4f46\u7a33\u5b9a\u6027\u6781\u9ad8\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\ud83d\udca1 \u5f88\u591a\u5e73\u53f0\u91c7\u7528 <strong>\u6df7\u5408\u7b56\u7565<\/strong>\uff1a  <\/p>\n<ul>\n<li>\u4e2d\u5c0f\u79df\u6237 \u2192 \u5171\u4eab\u5b9e\u4f8b + \u72ec\u7acb\u8fde\u63a5\u6c60 + \u5206\u5e93  <\/li>\n<li>\u5934\u90e8\u79df\u6237 \u2192 \u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b<\/li>\n<\/ul>\n<\/blockquote>\n<hr \/>\n<h3>\u2705 \u56db\u3001\u6280\u672f\u5b9e\u73b0\u5dee\u5f02<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6280\u672f\u70b9<\/th>\n<th>\u72ec\u7acb\u8fde\u63a5\u6c60<\/th>\n<th>\u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u6570\u636e\u6e90\u914d\u7f6e<\/strong><\/td>\n<td>\u5e94\u7528\u5185\u7ef4\u62a4\u591a\u4e2a <code>DataSource<\/code> Bean\uff08\u5982 Spring\uff09<\/td>\n<td>\u6bcf\u4e2a\u79df\u6237\u8fde\u63a5\u5b57\u7b26\u4e32\u6307\u5411\u4e0d\u540c host:port<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8def\u7531\u65b9\u5f0f<\/strong><\/td>\n<td>\u901a\u8fc7 <code>tenant_id<\/code> \u52a8\u6001\u9009\u62e9\u8fde\u63a5\u6c60\uff08\u5982 ShardingSphere Hint\uff09<\/td>\n<td>\u901a\u8fc7\u914d\u7f6e\u4e2d\u5fc3\u6216 DNS \u76f4\u63a5\u83b7\u53d6\u4e13\u5c5e DB \u5730\u5740<\/td>\n<\/tr>\n<tr>\n<td><strong>\u76d1\u63a7\u7c92\u5ea6<\/strong><\/td>\n<td>\u9700\u5728\u5e94\u7528\u5c42\u6253\u6807\uff0c\u624d\u80fd\u533a\u5206\u79df\u6237 DB \u6307\u6807<\/td>\n<td>\u4e91\u5382\u5546\u5929\u7136\u6309\u5b9e\u4f8b\u63d0\u4f9b\u76d1\u63a7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u2705 \u4e94\u3001\u4e00\u53e5\u8bdd\u603b\u7ed3<\/h3>\n<blockquote>\n<p><strong>\u72ec\u7acb\u8fde\u63a5\u6c60 = \u201c\u5408\u79df\u516c\u5bd3\u91cc\u6bcf\u4eba\u4e00\u95f4\u623f\u201d<\/strong>\uff08\u5171\u7528\u53a8\u623f\u6c34\u7535\uff0c\u4e00\u4eba\u505a\u996d\u7cca\u4e86\u5168\u5c4b\u5192\u70df\uff09<br \/>\n<strong>\u72ec\u7acb\u6570\u636e\u5e93\u5b9e\u4f8b = \u201c\u6bcf\u4eba\u4e00\u5957\u72ec\u680b\u522b\u5885\u201d<\/strong>\uff08\u5b8c\u5168\u81ea\u4e3b\uff0c\u4e92\u4e0d\u5e72\u6270\uff0c\u4f46\u8d35\uff09<\/p>\n<\/blockquote>\n<hr \/>\n<h3>\ud83d\udd0d \u9762\u8bd5\u52a0\u5206\u56de\u7b54\u5efa\u8bae<\/h3>\n<blockquote>\n<p>\u201c\u6211\u4eec\u5728\u77ed\u5267\u5e73\u53f0\u4e2d\uff0c\u5bf9 90% \u7684\u4e2d\u5c0f\u79df\u6237\u91c7\u7528 <strong>\u5171\u4eab RDS + \u6309\u79df\u6237\u5206\u5e93 + \u72ec\u7acb\u8fde\u63a5\u6c60<\/strong>\uff0c\u63a7\u5236\u8d44\u6e90\u4e89\u62a2\uff1b\u5bf9 Top 5 \u7684\u9ad8\u6d41\u91cf\u79df\u6237\uff0c\u76f4\u63a5\u5206\u914d <strong>\u72ec\u7acb RDS \u5b9e\u4f8b<\/strong>\uff0c\u786e\u4fdd SLA\u3002\u540c\u65f6\u901a\u8fc7\u7edf\u4e00\u7684 DB Proxy \u5c42\u5c4f\u853d\u5e95\u5c42\u5dee\u5f02\uff0c\u4e0a\u5c42\u4e1a\u52a1\u65e0\u611f\u77e5\u3002\u201d<\/p>\n<\/blockquote>\n<p>\u8fd9\u6837\u7684\u56de\u7b54\u65e2\u4f53\u73b0<strong>\u6210\u672c\u610f\u8bc6<\/strong>\uff0c\u53c8\u5c55\u793a<strong>\u5206\u7ea7\u9694\u79bb\u7b56\u7565<\/strong>\uff0c\u975e\u5e38\u9002\u5408\u5e73\u53f0\u578b\u540e\u7aef\u5c97\u4f4d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u5173\u952e\u7684\u7cfb\u7edf\u67b6\u6784\u95ee\u9898\uff0c\u5c24\u5176\u5728\u591a\u79df\u6237\uff08Multi-tenancy\uff09\u5e73\u53f0\u8bbe\u8ba1\u4e2d\u7ecf\u5e38\u88ab\u95ee\u5230\u3002 \u201c\u72ec\u7acb\u7684\u8fde\u63a5&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/t.n-years.com\/?p=6961\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[123],"tags":[],"class_list":["post-6961","post","type-post","status-publish","format-standard","hentry","category-123"],"_links":{"self":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6961"}],"version-history":[{"count":1,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6961\/revisions"}],"predecessor-version":[{"id":6962,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6961\/revisions\/6962"}],"wp:attachment":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}