1
votes

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?

4
After a few projects now with DynamoDB with a hand on my heart I truthful state i will try my absolute hardest to never use dynamodb ever again... utter waste of money. Just use mongodb and maintain the databases backups manually. DynamoDB as a service is about the only thing good about it, it is setup within seconds and we all blindly trust AWS won't go bang. Asside from that, speed is not that much faster than mongo, functionality is severely limited in comparison to mongo.John

4 Answers

5
votes

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

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.

2
votes

The limit for number of global secondary index per table has been increased to 20. You can cut a support case incase you need to create more than 20 global secondary index for a DynamoDB table. 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/

1
votes

It turns out that the answer was to wait. Now dynamodb supports 20 global secondary indexes. According to: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html

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

0
votes