简体   繁体   English

使用JavaScript从客户端访问DynamoDB?

[英]Accessing DynamoDB from client side using javascript?

I am developing an HTML5 mobile application which I am planning to port to Android also using Phonegap. 我正在开发HTML5移动应用程序,我计划也使用Phonegap移植到Android。 I want to use AWS DynamoDB for storing my users data. 我想使用AWS DynamoDB来存储我的用户数据。 I know that amazon has a http api but it is too complicated. 我知道亚马逊有一个http api,但是太复杂了。 Some of my queries are 我的一些查询是

  1. If I use the HTTP api, wouldn't it expose my credentials? 如果我使用HTTP api,它不会公开我的凭据吗? (Same qquery for dynode ) (对于相同qquery 倍增电极
  2. What are the alternatives? 有哪些选择? I have a EC2 instance so hosting a server is not a problem. 我有一个EC2实例,因此托管服务器不是问题。

I would appreciate your suggestions on this. 感谢您提出的建议。

If you connect directly from your phone application, to dynamodb, you will risk exposing your credentials. 如果直接从电话应用程序连接到dynamodb,则可能会暴露出凭据。

The general way to handle this is to have a json REST api through which the phone application can authenticate and make requests to the datastore. 解决此问题的一般方法是拥有一个JSON REST API,电话应用程序可以通过该API进行身份验证并向数据存储区发出请求。 Your application would communicate with this api. 您的应用程序将与此API通信。

In this case, each user would likely have its own authentication to your server application. 在这种情况下,每个用户都可能会对您的服务器应用程序具有自己的身份验证。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM