{"id":6369,"date":"2024-07-18T20:26:45","date_gmt":"2024-07-18T12:26:45","guid":{"rendered":"https:\/\/t.n-years.com\/?p=6369"},"modified":"2024-07-18T20:26:45","modified_gmt":"2024-07-18T12:26:45","slug":"%e5%90%8e%e7%ab%af%e5%b7%a5%e7%a8%8b%e5%b8%88%e5%bf%85%e5%a4%87%e6%95%b0%e6%8d%ae%e5%ba%93%e6%8a%80%e8%83%bd","status":"publish","type":"post","link":"https:\/\/t.n-years.com\/?p=6369","title":{"rendered":"\u540e\u7aef\u5de5\u7a0b\u5e08\u5fc5\u5907\u6570\u636e\u5e93\u6280\u80fd"},"content":{"rendered":"<p>\u4f5c\u4e3a\u4e00\u540d\u540e\u7aef\u5de5\u7a0b\u5e08\uff0c\u638c\u63e1\u6570\u636e\u5e93\u6280\u80fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002\u8fd9\u4e9b\u6280\u80fd\u4e0d\u4ec5\u6db5\u76d6\u4e86\u57fa\u672c\u7684\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u8fd8\u5305\u62ec\u8bbe\u8ba1\u3001\u4f18\u5316\u3001\u5b89\u5168\u6027\u7b49\u65b9\u9762\u3002\u4ee5\u4e0b\u662f\u540e\u7aef\u5de5\u7a0b\u5e08\u5e94\u8be5\u638c\u63e1\u7684\u5173\u952e\u6570\u636e\u5e93\u6280\u80fd\uff1a<\/p>\n<h3>1. \u6570\u636e\u5e93\u57fa\u7840\u77e5\u8bc6<\/h3>\n<p><strong>\u5173\u7cfb\u578b\u6570\u636e\u5e93<\/strong>\uff1a<\/p>\n<ul>\n<li>\u719f\u6089\u5e38\u89c1\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08RDBMS\uff09\uff0c\u5982 MySQL\u3001PostgreSQL\u3001Oracle \u548c SQL Server\u3002<\/li>\n<li>\u638c\u63e1\u57fa\u672c\u7684 SQL \u8bed\u6cd5\uff0c\u5305\u62ec <code>SELECT<\/code>\u3001<code>INSERT<\/code>\u3001<code>UPDATE<\/code> \u548c <code>DELETE<\/code> \u7b49\u64cd\u4f5c\u3002<\/li>\n<li>\u7406\u89e3\u6570\u636e\u5e93\u8868\u3001\u884c\u3001\u5217\u3001\u4e3b\u952e\u3001\u5916\u952e\u7b49\u57fa\u672c\u6982\u5ff5\u3002<\/li>\n<\/ul>\n<p><strong>\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4e86\u89e3\u5e38\u89c1\u7684 NoSQL \u6570\u636e\u5e93\uff0c\u5982 MongoDB\u3001Redis\u3001Cassandra \u548c DynamoDB\u3002<\/li>\n<li>\u7406\u89e3\u4e0d\u540c\u7c7b\u578b\u7684 NoSQL \u6570\u636e\u5e93\uff08\u6587\u6863\u5b58\u50a8\u3001\u952e\u503c\u5b58\u50a8\u3001\u5217\u65cf\u5b58\u50a8\u3001\u56fe\u6570\u636e\u5e93\uff09\u7684\u4f7f\u7528\u573a\u666f\u3002<\/li>\n<\/ul>\n<h3>2. \u6570\u636e\u5e93\u8bbe\u8ba1<\/h3>\n<p><strong>\u8303\u5f0f\u548c\u89c4\u8303\u5316<\/strong>\uff1a<\/p>\n<ul>\n<li>\u638c\u63e1\u6570\u636e\u5e93\u8303\u5f0f\uff081NF\u30012NF\u30013NF\u3001BCNF\uff09\u7684\u6982\u5ff5\uff0c\u7406\u89e3\u89c4\u8303\u5316\u7684\u76ee\u7684\u548c\u65b9\u6cd5\u3002<\/li>\n<li>\u4e86\u89e3\u53cd\u89c4\u8303\u5316\u7684\u60c5\u51b5\u548c\u5e94\u7528\u573a\u666f\u3002<\/li>\n<\/ul>\n<p><strong>ER \u56fe\u548c\u6570\u636e\u5efa\u6a21<\/strong>\uff1a<\/p>\n<ul>\n<li>\u80fd\u591f\u4f7f\u7528\u5b9e\u4f53\u5173\u7cfb\u56fe\uff08ER \u56fe\uff09\u8fdb\u884c\u6570\u636e\u5e93\u5efa\u6a21\uff0c\u8bc6\u522b\u5b9e\u4f53\u3001\u5c5e\u6027\u548c\u5173\u7cfb\u3002<\/li>\n<li>\u719f\u7ec3\u4f7f\u7528\u6570\u636e\u5efa\u6a21\u5de5\u5177\uff0c\u5982 MySQL Workbench\u3001ER\/Studio \u6216 Draw.io\u3002<\/li>\n<\/ul>\n<h3>3. \u9ad8\u7ea7 SQL \u6280\u80fd<\/h3>\n<p><strong>\u590d\u6742\u67e5\u8be2<\/strong>\uff1a<\/p>\n<ul>\n<li>\u80fd\u591f\u7f16\u5199\u590d\u6742\u7684 SQL \u67e5\u8be2\uff0c\u5305\u62ec\u8054\u63a5\uff08JOIN\uff09\u3001\u5b50\u67e5\u8be2\u3001\u805a\u5408\u51fd\u6570\uff08SUM\u3001COUNT\u3001AVG \u7b49\uff09\u548c\u7a97\u53e3\u51fd\u6570\u3002<\/li>\n<\/ul>\n<p><strong>\u7d22\u5f15<\/strong>\uff1a<\/p>\n<ul>\n<li>\u7406\u89e3\u7d22\u5f15\u7684\u6982\u5ff5\u3001\u7c7b\u578b\uff08\u5982 B-tree \u7d22\u5f15\u3001\u54c8\u5e0c\u7d22\u5f15\uff09\u53ca\u5176\u4f7f\u7528\u573a\u666f\u3002<\/li>\n<li>\u77e5\u9053\u5982\u4f55\u521b\u5efa\u548c\u4f18\u5316\u7d22\u5f15\uff0c\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\u3002<\/li>\n<\/ul>\n<p><strong>\u4e8b\u52a1\u548c\u9501\u673a\u5236<\/strong>\uff1a<\/p>\n<ul>\n<li>\u7406\u89e3\u4e8b\u52a1\u7684\u7279\u6027\uff08ACID \u539f\u5219\uff09\u53ca\u5176\u5728\u6570\u636e\u5e93\u4e2d\u7684\u5e94\u7528\u3002<\/li>\n<li>\u719f\u6089\u6570\u636e\u5e93\u7684\u9501\u673a\u5236\uff08\u884c\u9501\u3001\u8868\u9501\u3001\u5171\u4eab\u9501\u3001\u6392\u4ed6\u9501\uff09\u53ca\u5176\u5b9e\u73b0\u539f\u7406\u3002<\/li>\n<\/ul>\n<h3>4. \u6570\u636e\u5e93\u4f18\u5316<\/h3>\n<p><strong>\u67e5\u8be2\u4f18\u5316<\/strong>\uff1a<\/p>\n<ul>\n<li>\u80fd\u591f\u5206\u6790\u548c\u4f18\u5316 SQL \u67e5\u8be2\uff0c\u4f7f\u7528 <code>EXPLAIN<\/code> \u7b49\u5de5\u5177\u4e86\u89e3\u67e5\u8be2\u6267\u884c\u8ba1\u5212\u3002<\/li>\n<li>\u719f\u6089\u6570\u636e\u5e93\u8c03\u4f18\u5de5\u5177\u548c\u6280\u672f\uff0c\u5982\u6162\u67e5\u8be2\u65e5\u5fd7\u5206\u6790\u3001\u7d22\u5f15\u4f18\u5316\u3001\u5206\u533a\u7b49\u3002<\/li>\n<\/ul>\n<p><strong>\u6027\u80fd\u76d1\u63a7\u548c\u8c03\u4f18<\/strong>\uff1a<\/p>\n<ul>\n<li>\u80fd\u591f\u76d1\u63a7\u6570\u636e\u5e93\u6027\u80fd\uff0c\u8bc6\u522b\u6027\u80fd\u74f6\u9888\u3002<\/li>\n<li>\u719f\u6089\u6570\u636e\u5e93\u6027\u80fd\u4f18\u5316\u7b56\u7565\uff0c\u5305\u62ec\u786c\u4ef6\u4f18\u5316\u3001\u914d\u7f6e\u4f18\u5316\u548c\u67b6\u6784\u4f18\u5316\u3002<\/li>\n<\/ul>\n<h3>5. \u6570\u636e\u5e93\u7ba1\u7406<\/h3>\n<p><strong>\u5907\u4efd\u548c\u6062\u590d<\/strong>\uff1a<\/p>\n<ul>\n<li>\u719f\u6089\u6570\u636e\u5e93\u7684\u5907\u4efd\u548c\u6062\u590d\u7b56\u7565\uff0c\u80fd\u591f\u4f7f\u7528\u5de5\u5177\u8fdb\u884c\u6570\u636e\u5e93\u7684\u5907\u4efd\u548c\u6062\u590d\u64cd\u4f5c\u3002<\/li>\n<li>\u4e86\u89e3\u5168\u91cf\u5907\u4efd\u3001\u589e\u91cf\u5907\u4efd\u548c\u5dee\u5f02\u5907\u4efd\u7684\u533a\u522b\u548c\u5e94\u7528\u573a\u666f\u3002<\/li>\n<\/ul>\n<p><strong>\u6570\u636e\u5e93\u8fc1\u79fb<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4e86\u89e3\u6570\u636e\u5e93\u8fc1\u79fb\u7684\u57fa\u672c\u65b9\u6cd5\u548c\u5de5\u5177\uff0c\u5982 mysqldump\u3001pg_dump\u3001Flyway \u548c Liquibase\u3002<\/li>\n<li>\u80fd\u591f\u6267\u884c\u6570\u636e\u5e93\u8fc1\u79fb\u64cd\u4f5c\uff0c\u786e\u4fdd\u6570\u636e\u7684\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\u3002<\/li>\n<\/ul>\n<h3>6. \u6570\u636e\u5e93\u5b89\u5168<\/h3>\n<p><strong>\u7528\u6237\u6743\u9650\u7ba1\u7406<\/strong>\uff1a<\/p>\n<ul>\n<li>\u638c\u63e1\u6570\u636e\u5e93\u7528\u6237\u548c\u6743\u9650\u7ba1\u7406\uff0c\u4e86\u89e3\u5982\u4f55\u521b\u5efa\u7528\u6237\u3001\u5206\u914d\u6743\u9650\u3001\u64a4\u9500\u6743\u9650\u3002<\/li>\n<li>\u786e\u4fdd\u6570\u636e\u5e93\u8bbf\u95ee\u7684\u5b89\u5168\u6027\uff0c\u9632\u6b62\u672a\u7ecf\u6388\u6743\u7684\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n<p><strong>SQL \u6ce8\u5165\u9632\u62a4<\/strong>\uff1a<\/p>\n<ul>\n<li>\u7406\u89e3 SQL \u6ce8\u5165\u653b\u51fb\u7684\u539f\u7406\u53ca\u5176\u9632\u62a4\u63aa\u65bd\u3002<\/li>\n<li>\u638c\u63e1\u53c2\u6570\u5316\u67e5\u8be2\u548c\u9884\u7f16\u8bd1\u8bed\u53e5\uff0c\u9632\u6b62 SQL \u6ce8\u5165\u653b\u51fb\u3002<\/li>\n<\/ul>\n<h3>7. \u5206\u5e03\u5f0f\u6570\u636e\u5e93\u548c\u96c6\u7fa4\u7ba1\u7406<\/h3>\n<p><strong>\u5206\u5e03\u5f0f\u6570\u636e\u5e93<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4e86\u89e3\u5206\u5e03\u5f0f\u6570\u636e\u5e93\u7684\u57fa\u672c\u6982\u5ff5\u548c\u5e38\u89c1\u5b9e\u73b0\uff0c\u5982 Amazon Aurora\u3001Google Spanner\u3001CockroachDB\u3002<\/li>\n<li>\u7406\u89e3\u5206\u7247\u3001\u590d\u5236\u548c\u4e00\u81f4\u6027\u6a21\u578b\uff08\u5982 CAP \u7406\u8bba\u3001BASE \u7406\u8bba\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u6570\u636e\u5e93\u96c6\u7fa4<\/strong>\uff1a<\/p>\n<ul>\n<li>\u719f\u6089\u6570\u636e\u5e93\u96c6\u7fa4\u7684\u914d\u7f6e\u548c\u7ba1\u7406\uff0c\u5982 MySQL \u4e3b\u4ece\u590d\u5236\u3001PostgreSQL Streaming Replication\u3001MongoDB Replica Set\u3002<\/li>\n<li>\u638c\u63e1\u6570\u636e\u5e93\u9ad8\u53ef\u7528\u6027\u548c\u6545\u969c\u6062\u590d\u6280\u672f\u3002<\/li>\n<\/ul>\n<h3>8. \u5b9e\u65f6\u6570\u636e\u5e93\u548c\u7f13\u5b58<\/h3>\n<p><strong>\u5b9e\u65f6\u6570\u636e\u5e93<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4e86\u89e3\u5b9e\u65f6\u6570\u636e\u5e93\u7684\u5e94\u7528\u573a\u666f\u548c\u5e38\u89c1\u5b9e\u73b0\uff0c\u5982 Amazon DynamoDB\u3001Firebase Realtime Database\u3002<\/li>\n<li>\u638c\u63e1\u5b9e\u65f6\u6570\u636e\u5904\u7406\u548c\u6d41\u5f0f\u5904\u7406\u6280\u672f\u3002<\/li>\n<\/ul>\n<p><strong>\u7f13\u5b58<\/strong>\uff1a<\/p>\n<ul>\n<li>\u719f\u6089\u7f13\u5b58\u7684\u6982\u5ff5\u548c\u4f7f\u7528\u573a\u666f\uff0c\u4e86\u89e3\u5e38\u89c1\u7684\u7f13\u5b58\u7cfb\u7edf\uff0c\u5982 Redis\u3001Memcached\u3002<\/li>\n<li>\u638c\u63e1\u7f13\u5b58\u7b56\u7565\uff0c\u5982\u7f13\u5b58\u7a7f\u900f\u3001\u7f13\u5b58\u96ea\u5d29\u3001\u7f13\u5b58\u9884\u70ed\u548c\u7f13\u5b58\u5931\u6548\u3002<\/li>\n<\/ul>\n<h3>9. \u6570\u636e\u5e93\u5de5\u5177\u548c\u6846\u67b6<\/h3>\n<p><strong>\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177<\/strong>\uff1a<\/p>\n<ul>\n<li>\u719f\u7ec3\u4f7f\u7528\u5e38\u89c1\u7684\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177\uff0c\u5982 MySQL Workbench\u3001pgAdmin\u3001DBeaver\u3001Navicat\u3002<\/li>\n<li>\u638c\u63e1\u6570\u636e\u5e93\u547d\u4ee4\u884c\u5de5\u5177\u7684\u4f7f\u7528\uff0c\u5982 MySQL CLI\u3001psql\u3002<\/li>\n<\/ul>\n<p><strong>\u6570\u636e\u5e93 ORM \u6846\u67b6<\/strong>\uff1a<\/p>\n<ul>\n<li>\u719f\u6089\u5e38\u89c1\u7684 ORM \u6846\u67b6\uff0c\u5982 Hibernate\u3001Entity Framework\u3001Django ORM\u3001SQLAlchemy\u3002<\/li>\n<li>\u638c\u63e1 ORM \u7684\u57fa\u672c\u539f\u7406\u53ca\u5176\u5728\u9879\u76ee\u4e2d\u7684\u5e94\u7528\u3002<\/li>\n<\/ul>\n<h3>10. \u6301\u7eed\u96c6\u6210\u548c\u6301\u7eed\u90e8\u7f72\uff08CI\/CD\uff09<\/h3>\n<p><strong>\u6570\u636e\u5e93\u6301\u7eed\u96c6\u6210<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4e86\u89e3\u5982\u4f55\u5728\u6301\u7eed\u96c6\u6210\u73af\u5883\u4e2d\u7ba1\u7406\u6570\u636e\u5e93\u53d8\u66f4\u3002<\/li>\n<li>\u719f\u6089\u6570\u636e\u5e93\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u5982 Flyway\u3001Liquibase\u3002<\/li>\n<\/ul>\n<p><strong>\u6570\u636e\u5e93\u6301\u7eed\u90e8\u7f72<\/strong>\uff1a<\/p>\n<ul>\n<li>\u80fd\u591f\u5728\u6301\u7eed\u90e8\u7f72\u8fc7\u7a0b\u4e2d\u6267\u884c\u6570\u636e\u5e93\u8fc1\u79fb\u548c\u53d8\u66f4\u7ba1\u7406\u3002<\/li>\n<li>\u4e86\u89e3\u5982\u4f55\u81ea\u52a8\u5316\u6570\u636e\u5e93\u90e8\u7f72\uff0c\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u548c\u6570\u636e\u5e93\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u638c\u63e1\u8fd9\u4e9b\u6570\u636e\u5e93\u6280\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u540e\u7aef\u5de5\u7a0b\u5e08\u9ad8\u6548\u5730\u8fdb\u884c\u6570\u636e\u5e93\u8bbe\u8ba1\u3001\u64cd\u4f5c\u548c\u7ba1\u7406\uff0c\u786e\u4fdd\u7cfb\u7edf\u7684\u6027\u80fd\u3001\u53ef\u9760\u6027\u548c\u5b89\u5168\u6027\u3002\u968f\u7740\u7ecf\u9a8c\u7684\u79ef\u7d2f\uff0c\u540e\u7aef\u5de5\u7a0b\u5e08\u8fd8\u53ef\u4ee5\u6df1\u5165\u7814\u7a76\u6570\u636e\u5e93\u7684\u5185\u90e8\u673a\u5236\u3001\u6027\u80fd\u8c03\u4f18\u548c\u9ad8\u53ef\u7528\u6027\u67b6\u6784\u8bbe\u8ba1\uff0c\u4e0d\u65ad\u63d0\u5347\u6570\u636e\u5e93\u76f8\u5173\u7684\u4e13\u4e1a\u80fd\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u4e3a\u4e00\u540d\u540e\u7aef\u5de5\u7a0b\u5e08\uff0c\u638c\u63e1\u6570\u636e\u5e93\u6280\u80fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002\u8fd9\u4e9b\u6280\u80fd\u4e0d\u4ec5\u6db5\u76d6\u4e86\u57fa\u672c\u7684\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u8fd8\u5305\u62ec\u8bbe\u8ba1\u3001\u4f18\u5316\u3001\u5b89\u5168\u6027\u7b49&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/t.n-years.com\/?p=6369\">\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":[108],"class_list":["post-6369","post","type-post","status-publish","format-standard","hentry","category-123","tag-108"],"_links":{"self":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6369","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=6369"}],"version-history":[{"count":1,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6369\/revisions"}],"predecessor-version":[{"id":6370,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6369\/revisions\/6370"}],"wp:attachment":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}