简体   繁体   English

单击HTML按钮时如何将数据从一个DynamoDB表移动到同一区域中的另一DynamoDB表

[英]How to move the data from one DynamoDB table to other DynamoDB table in the same region on click of HTML button

I am very new to AWS. 我对AWS非常陌生。 As the first step I am creating an eCommerce application on my personal interest to give the demo of this application to my colleagues. 第一步,我是根据我的个人兴趣创建一个电子商务应用程序,以将该应用程序演示提供给我的同事。

I am implementing 'Order' part. 我正在执行“订单”部分。 For this, I am thinking of moving the data from one table to other. 为此,我正在考虑将数据从一个表移动到另一个表。 Ie Once the user add the product to cart , it will saved in Cart table in dynamo-db and in cart screen when the user clicks on 'Order'button/Link, the same data as it is in cart table should be moved to Order table and the cart should be empty So, the order can be confirmed. 即,一旦用户将产品添加到购物车,当用户单击“订单”按钮/链接时,该产品将保存在dynamo-db的购物车表中,并保存在购物车屏幕中,应将与购物车表中相同的数据移至订单中桌子和购物车应该是空的,所以可以确认订单。

How could I implement it? 我该如何实施? Not sure the method I am thinking is right if there any other method to accomplish Order functionality. 如果有其他方法可以完成Order功能,则不确定我在想的方法是否正确。

The answer to this is really going to depend on your architecture and stack - and even within that you have lots of options. 答案实际上取决于您的体系结构和堆栈-甚至在其中您也有很多选择。

In a serverless way, ie from a static html page with no server-side backend, you could create a lambda function in the supported language of your choice and with the proper IAM role, to move the data from one table to the other - your html page could call it via an API call, and I would suggest you use AWS API Gateway to expose an api endpoint that then calls the lambda function. 通过无服务器方式,即从没有服务器端后端的静态html页面中,您可以使用所选的受支持语言并具有适当的IAM角色创建lambda函数,以将数据从一个表移动到另一个表- html页面可以通过API调用来调用它,我建议您使用AWS API Gateway公开一个api终结点,然后再调用lambda函数。

If on (one of the other many) other-hands, say you were using ASP.net or PHP on the server side, you could use the AWSSDK to talk to the dynamodb directly and accomplish the same thing. 如果使用其他方法之一(例如,在服务器端使用ASP.net或PHP),则可以使用AWSSDK直接与dynamodb通讯并完成相同的操作。

Besides these two options there are many, many alternatives and variations - and with all of the options you are also going to need to deal with authentication/security to make sure no one can make calls to your database/service that they aren't permitted to - perhaps not important for your demo application, but will definitely be an issue if/when you go live. 除了这两个选项外,还有许多其他选择和变体-并且使用所有这些选项时,您还需要处理身份验证/安全性,以确保没有人可以对您的数据库/服务进行调用,不允许他们进行调用对-可能对您的演示应用程序而言并不重要,但如果/当您上线时绝对会成为问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将选择性数据从一个 dynamodb 表导出到同一区域中的另一个表的选项 - Options to export selective data from one dynamodb table to another table in same region 如何在另一个区域中创建具有相同定义的Dynamodb表? - How can I create a Dynamodb table with same definition in another region? 如何将数据从一个表传输到另一个表(AWS 上的 DynamoDB) - How to transfer data from one table to another (DynamoDB on AWS) 从dynamoDb提取数据并将其移动到另一个表的最佳方法 - Best method to extract data from dynamoDb and move it to another table 如何在DynamoDB中查看表数据 - How to view table data in DynamoDB 将不同的 dynamodb 项(来自同一个 dynamodb 表)解组到多个 POJO - Unmarshalling different dynamodb items (from the same dynamodb table) to multiple POJOs 从另一个区域的另一个帐户访问DynamoDB表? - Access a DynamoDB table from another account in another region? 从 CloudFormation 模板中的次要区域引用全局 dynamodb 表 - Referencing global dynamodb table from the secondary region in CloudFormation template 如何重命名DynamoDB表 - How to rename a DynamoDB table 如何从Hadoop作业的Reducer中将数据加载到dynamodb表中 - How to load data into dynamodb table from the reducer of a hadoop job
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM