DynamoDB GSI 数据复制
DynamoDB GSI data duplication
我有一个关于在 dynamoDB 中使用 GSI 的问题,我在一个 table 中使用 2 个 GSI 获得了 10 个属性,我想使用不同的访问模式为两个 GSI 检索相同的数据
例如:
主要table
userId, productId, productName, price, GSI1,GS2, 更多属性。
GSI:所有投影属性
通过产品名称获取产品
PK:产品名称,sk:价格
GSI:所有投影属性
按价格和名称获取产品
PK:价格,sk:产品名称
两个 GSI 都投射相同的 10 个 table 属性,但我的问题是两个 GSI 在存储方面彼此独立,因为我可能知道每个 GSI 都有自己的 WUC、RUC 但在存储方面是相同的,因为他们正在预测相同的值?
仅使用 Keys, ALL, include 与 GSI 的最佳做法是什么?任何示例或指南
非常感谢。
存储空间按 GSI 计算。 GSI 实际上是一个自动同步的隐藏 table。
General Guidelines for Secondary Indexes in DynamoDB.
上有关于 GSI 的有用信息
Because secondary indexes consume storage and provisioned throughput, you should keep the size of the index as small as possible. Also, the smaller the index, the greater the performance advantage compared to querying the full table. If your queries usually return only a small subset of attributes, and the total size of those attributes is much smaller than the whole item, project only the attributes that you regularly request.
我有一个关于在 dynamoDB 中使用 GSI 的问题,我在一个 table 中使用 2 个 GSI 获得了 10 个属性,我想使用不同的访问模式为两个 GSI 检索相同的数据
例如:
主要table
userId, productId, productName, price, GSI1,GS2, 更多属性。
GSI:所有投影属性 通过产品名称获取产品 PK:产品名称,sk:价格
GSI:所有投影属性 按价格和名称获取产品 PK:价格,sk:产品名称
两个 GSI 都投射相同的 10 个 table 属性,但我的问题是两个 GSI 在存储方面彼此独立,因为我可能知道每个 GSI 都有自己的 WUC、RUC 但在存储方面是相同的,因为他们正在预测相同的值?
仅使用 Keys, ALL, include 与 GSI 的最佳做法是什么?任何示例或指南
非常感谢。
存储空间按 GSI 计算。 GSI 实际上是一个自动同步的隐藏 table。
General Guidelines for Secondary Indexes in DynamoDB.
上有关于 GSI 的有用信息Because secondary indexes consume storage and provisioned throughput, you should keep the size of the index as small as possible. Also, the smaller the index, the greater the performance advantage compared to querying the full table. If your queries usually return only a small subset of attributes, and the total size of those attributes is much smaller than the whole item, project only the attributes that you regularly request.