Search code examples
amazon-web-servicesamazon-dynamodbaws-sdk

How to increase aws dynamodb index limit from 5


Is it possible to increase the index from 5 to 15?

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

Secondary Indexes Per Table You can define a maximum of 5 local secondary indexes and 5 global secondary indexes per table.

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

The Query operation finds items based on primary key values. You can query any table or secondary index that has a composite primary key (a partition key and a sort key).

If I understood this correct, you can set 1 main hashkey, 5 secondary keys and another 5 global... and you can only query against an index.

We are thinking about using DynamoDB for a NoSQL database but we are completely stumbed by this. In Mongo or Elastic or Solr.. you can query by pretty much any doc attr you want.

In this app we already have 15 attributes we know we will want to query against, but DynamoDB only offers the ability to index 5.. unless i am mistaken... is there another way to query aside from against a preset index?


Solution

  • You can define a maximum of 5 local secondary indexes.

    There is an initial quota of 20 global secondary indexes per table. To request a service quota increase, see https://aws.amazon.com/support.

    Source: Secondary Indexes @ Developer Guide

    Unfortunately, 5 local secondary indexes(LSI) service quota could not be extended.

    When you have more (>20) 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.