{"id":427952,"date":"2021-04-17T22:08:27","date_gmt":"2021-04-17T14:08:27","guid":{"rendered":"http:\/\/4563.org\/?p=427952"},"modified":"2021-04-17T22:08:27","modified_gmt":"2021-04-17T14:08:27","slug":"dynamodb-%e5%ba%94%e8%af%a5%e6%80%8e%e4%b9%88%e5%a4%8d%e6%9d%82%e6%9f%a5%e8%af%a2%e5%91%a2%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=427952","title":{"rendered":"Dynamodb \u5e94\u8be5\u600e\u4e48\u590d\u6742\u67e5\u8be2\u5462\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Dynamodb \u5e94\u8be5\u600e\u4e48\u590d\u6742\u67e5\u8be2\u5462\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : john990 <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5047\u5982\u73b0\u5728\u6709\u4e00\u5f20\u6b4c\u66f2\u8868<\/p>\n<table>\n<thead>\n<tr>\n<th>id<\/th>\n<th>title<\/th>\n<th>artist<\/th>\n<th>duration<\/th>\n<th>cover<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>hash1<\/td>\n<td>\u9752\u82b1\u74f7<\/td>\n<td>\u5468\u6770\u4f26,\u6797\u4fca\u6770<\/td>\n<td>320000<\/td>\n<td>http:\/\/a.bbb.com\/a.jpg<\/td>\n<\/tr>\n<tr>\n<td>hash2<\/td>\n<td>\u9752\u82b1\u74f7<\/td>\n<td>\u5468\u6770\u4f26<\/td>\n<td>310000<\/td>\n<td>http:\/\/a.bbb.com\/b.jpg<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u56e0\u4e3a\u4e00\u9996\u6b4c\u53ef\u80fd\u6709\u591a\u4e2a\u7248\u672c\uff0c\u591a\u4e2a\u6b4c\u624b\u6f14\u5531\u3002<\/p>\n<p>\u90a3\u4e48\u8fd9\u4e2a\u8868\u5e94\u8be5\u600e\u4e48\u8bbe\u8ba1\u624d\u80fd\u6700\u5feb\u6377\u7684\u6839\u636e \u6b4c\u624b+\u6b4c\u540d \u67e5\u8be2\u5230\u5bf9\u5e94\u7684\u6570\u636e\u5462\uff1f<\/p>\n<p>Dynamodb \u7684 getItem \u548c query \u5fc5\u987b\u8981\u786e\u5b9a\u5206\u533a\u4e3b\u952e\u624d\u80fd\u67e5\u8be2\uff0c\u53ef\u662f\u6211\u8981\u67e5\u8be2\u540e\u624d\u80fd\u77e5\u9053\u4e3b\u952e\u554a\uff0c\u76f4\u63a5\u61f5\u4e86\u3002<\/p>\n<p>\u5ba2\u6237\u7aef\u521d\u6b21\u641e\u540e\u7aef\u5f88\u591a\u8981\u5b66\u4e60\u554a\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>12<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5660300\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RangerWolf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             DynamoDB \u5f88\u4fbf\u5b9c\uff0c\u901f\u5ea6\u4e5f\u5f88\u5feb\uff0c\u5efa\u8bae\u4ee5\u6b4c\u540d\u4e3a\u4e3b\u952e\u5199\u8fdb\u53bb\uff0c\u6839\u636e\u4e0d\u540c\u7684\u9700\u6c42\u53bb\u4e0d\u540c\u7684\u8868\u67e5\u8be2<\/p>\n<p>\u8bdd\u8bf4\uff0c\u4e3a\u4ec0\u4e48\u7528\u8fd9\u4e2a\uff1f\u76f4\u63a5 MySQL \u3001PSQL \u625b\u4e0d\u4f4f\u4e48\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660301\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : john990 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @RangerWolf lambda \u53ea\u652f\u6301 dynamodb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660302\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : john990 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @RangerWolf \u6b4c\u66f2\u540c\u540d\u7684\u5f88\u591a\u554a\uff0c\u91cd\u590d\u7684\u4e0d\u80fd\u505a\u4e3b\u952e\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660303\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binux <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             composite primary key                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660304\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Rocketer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             DynamoDB \u662f\u9760 GSI \u5b9e\u73b0\u590d\u6742\u67e5\u8be2\u7684\u3002<\/p>\n<p>\u6bd4\u5982\u4f60\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u5efa\u4e00\u4e2a Partition Key \u4e3a\u6b4c\u624b\uff0cSort Key \u4e3a\u6b4c\u540d\u7684 GSI \uff08\u5176\u5b9e\u53cd\u8fc7\u6765\u4e5f\u884c\uff0c\u5177\u4f53\u770b\u4f60\u8fd8\u6709\u6ca1\u6709\u522b\u7684\u9700\u6c42\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a GSI \uff09\uff0c\u7136\u540e query \u8fd9\u4e2a GSI \u5c31\u884c\u4e86\u3002<\/p>\n<p>GSI \u7528\u8d77\u6765\u8ddf\u8868\u4e00\u6a21\u4e00\u6837\uff0c\u53ea\u662f\u8868\u91cc\u7684\u952e\u662f\u552f\u4e00\u7684\uff0c\u800c GSI \u5141\u8bb8\u91cd\u590d\u3002\u4f60\u7528\u201d\u6b4c\u624b=xxx AND \u6b4c\u540d=xxx\u201c\u4e3a\u6761\u4ef6\u53ef\u80fd\u641c\u5230\u591a\u4e2a item\uff0c\u6240\u4ee5\u4f60\u53ea\u80fd query \u800c\u4e0d\u80fd getItem\uff0c\u7136\u540e\u518d\u6839\u636e\u641c\u5230\u591a\u5c11\u6761\u6765\u51b3\u5b9a\u4e0b\u4e00\u6b65\u600e\u4e48\u5904\u7406\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6b4c\u624b\u5982\u679c\u662f\u4e2a\u68c0\u7d22\u6761\u4ef6\uff0c\u90a3\u5c31\u4e0d\u5e94\u8be5\u653e\u5230\u540c\u4e00\u4e2a item \u91cc\uff0c\u800c\u662f\u4e3a\u6bcf\u4e2a\u6b4c\u624b\u521b\u5efa\u4e00\u4e2a item \u3002\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7 GSI \u641c\u7d22\u201d\u6b4c\u624b=xxx\u201d\u6765\u5f97\u5230\u8be5\u6b4c\u624b\u6240\u6709\u7684\u6b4c\u66f2\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660305\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : john990 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Rocketer \u8c22\u8c22\uff01\u6211\u53bb\u627e\u4e0b\u76f8\u5173\u8d44\u6599<br \/>\u4e0d\u8fc7\u8fd8\u6709\u4e2a\u95ee\u9898\uff0c\u6b4c\u66f2\u8868\u7684\u4e3b\u952e\u968f\u673a\u751f\u6210\u5417\uff0c\u56e0\u4e3a\u6b4c\u624b\u548c\u6b4c\u540d\u6ca1\u6709\u552f\u4e00\u786e\u5b9a\u503c\u7684\u5b57\u6bb5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660306\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Rocketer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @john990 \u672c\u6765\u90fd\u5199\u4e86 500 \u5b57\u4e86\uff0c\u53c8\u5220\u4e86\uff0c\u56e0\u4e3a\u4e0d\u77e5\u9053\u8fd8\u8981\u5199\u591a\u5c11\u3002\u4f60\u8fd9\u662f\u4e2a\u591a\u5bf9\u591a\u7684\u5173\u7cfb\uff0c\u662f\u6700\u590d\u6742\u7684\u573a\u666f\uff0c\u6211\u6015\u662f\u5f88\u96be\u7528\u51e0\u53e5\u8bdd\u7ed9\u4f60\u8bb2\u6e05\u695a\u3002<\/p>\n<p>\u4f60\u8fd8\u662f\u8bfb\u4e00\u4e0b\u5b98\u65b9\u7684\u6700\u4f73\u5b9e\u8df5\u5427\uff0c\u6839\u636e\u5b98\u65b9\u63a8\u8350\u7684\u505a\u6cd5\uff0c\u4f60\u5e94\u8be5\u628a\u6240\u6709\u6570\u636e\u90fd\u653e\u5728\u4e00\u5f20\u8868\u91cc\uff0c\u6240\u4ee5\u4e0d\u4f1a\u6709\u6b4c\u624b\u8868\u8fd9\u79cd\u4e1c\u897f\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u7528 DynamoDB \u4e0d\u80fd\u4e00\u70b9\u4e00\u70b9\u7684\u6324\u7259\u818f\uff0c\u4f60\u5f97\u5148\u628a\u6240\u6709\u8bfb\u53d6\u7684\u573a\u666f\u90fd\u5217\u51fa\u6765\u518d\u8bbe\u8ba1\u8868\uff0c\u5426\u5219\u540e\u671f\u5f88\u96be\u4fee\u6539\u3002\u6240\u4ee5\u6700\u597d\u4ee5\u5fae\u670d\u52a1\u7684\u601d\u60f3\u53bb\u8bbe\u8ba1\u4f60\u7684\u7cfb\u7edf\uff0c\u6bcf\u4e2a\u670d\u52a1\u5404\u81ea\u7528\u4e00\u4e2a\u8868\uff0c\u4ee5\u964d\u4f4e\u8026\u5408\uff0c\u5728\u5145\u5206\u5229\u7528 DynamoDB \u4f18\u52bf\u7684\u540c\u65f6\u4e3a\u540e\u671f\u6269\u5c55\u4fdd\u7559\u7075\u6d3b\u6027\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660307\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : buddie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Rocketer \u8bf4\u5f97\u592a\u597d\u4e86\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660308\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : phy25 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @john990 #2 \u5e94\u8be5\u4e0d\u4f1a\u5427 https:\/\/docs.amazonaws.cn\/lambda\/latest\/dg\/services-rds-tutorial.html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660309\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cassyfar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @phy25 \u80fd nosql \u8fd8\u662f nosql                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660310\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : john990 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Rocketer \u975e\u5e38\u8c22\u8c22\u4f60\u7684\u56de\u590d\uff0c\u6211\u61c2\u6211\u8be5\u505a\u4ec0\u4e48\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660311\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : john990 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @phy25 \u679c\u7136\uff0c\u662f\u6211\u6ca1\u770b\u5230\uff0c\u8c22\u8c22\u63d0\u9192                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Dynamodb \u5e94\u8be5\u600e\u4e48\u590d\u6742\u67e5\u8be2&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\/427952"}],"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=427952"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/427952\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427952"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}