0

Firstly, let me know if I should place this in a different Community. It is programming related but less than I would prefer.

I am creating a mobile app based which I intend to base on AWS App Sync unless I can determine it is a poor fit.

I want to store a fairly large set of data, say a half million records.

From these records, I need to be able to grab all entries based on a tag and page them from the larger set.

An example of this data would be:

{
   "name":"Product123",
   "tags":[
      {
         "name":"1880",
         "type":"year",
         "value":7092
      },
      {
         "name":"f",
         "type":"gender",
         "value":4120692
      }
   ]
}

Various objects may or may not have a specific tag but may have up to 500 tags or more (the seed of initial data has 130 tags). My filter would ignore them if they did not match but return them if they did.

In reading about Query vs Scan on DyanmoDB, I feel like my current data structure would require mostly scanning and be in-efficient. Efficiency is only a real restriction due to cost.

With cost in mind, I will focus on the cost per user to access this data in filtered sets. Say 100,000 users for now each filtering and paging data many times a day.

4

1 回答 1

0

您的标签概念听起来与使用 AppSync (docs)的 Cognito 用户池组的概念没有太大区别- 基于组的身份验证将仅返回允许发出请求的用户所在组的项目。Cognito 的默认组限制是每个用户池 25 个,因此虽然开箱即用很方便,但它本身对您没有多大帮助。相反,它之所以有趣只是因为它在概念上很相似,并且可以通过查看它的内部工作原理来让您深入了解。

如果您进入 AppSync 控制台并为组身份验证设置请求映射模板,您将看到它使用扫描和包含操作。如果您真的想使用 Dynamo,那么在这里做类似的事情可能是您最好的选择。如果您发现成本过高,您可以使用 Lambda 数据源,它允许您使用任何数据存储,如果您认为这种操作更灵活一点。

于 2018-05-21T20:04:53.123 回答