如何从5增加aws dynamodb索引限制

时间:2018-02-26 17:14:36

标签: amazon-web-services amazon-dynamodb aws-sdk

是否可以将索引从5增加到15?

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html

  

每个表的辅助索引您最多可以定义5个本地索引   每个表的二级索引和5个全局二级索引。

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html

  

Query操作根据主键值查找项目。您可以   查询具有复合主键的任何表或辅助索引(a   分区键和排序键。

如果我理解这是正确的,你可以设置1个主要的hashkey,5个辅助密钥和另外5个全局...并且你只能查询索引。

我们正在考虑将DynamoDB用于NoSQL数据库,但我们完全被这个困扰了。在Mongo或Elastic或Solr ..你几乎可以查询任何你想要的doc attr。

在这个应用程序中,我们已经有15个属性,我们知道我们想要查询,但DynamoDB只提供索引5的能力..除非我错了...是否有另一种方法来查询预设索引?

4 个答案:

答案 0 :(得分:3)

Unfortunately, 5 local secondary indexes and 5 global secondary indexes are hard limits which are not possible to extend.

When you have more (>5) attributes to query from DynamoDB, it is not efficiently possible. You have to use Scan which evaluates all the items in the table, which is not efficient. You have to either move to a different database or use AWS ElasticSearch to index the attributes for searching.

答案 1 :(得分:0)

每个表的全局二级索引的数量限制已增加到 20 。 如果您需要为DynamoDB表创建超过 20个全局二级索引,则可以减少支持案例。 https://aws.amazon.com/about-aws/whats-new/2018/12/amazon-dynamodb-increases-the-number-of-global-secondary-indexes-and-projected-index-attributes-you-can-create-per-table/

答案 2 :(得分:0)

原来,答案是等待。现在,dynamodb支持20个全局二级索引。根据: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html

  

每个表的初始限制为20个全局二级索引。至   请求增加服务限制,请参见https://aws.amazon.com/support

答案 3 :(得分:0)

Docker映像仍然具有5 GSI限制:(

https://hub.docker.com/r/amazon/dynamodb-local