Global secondary indexes have capacity provisioned separately from the tables where they are applied. If insufficient write capacity is allocated for the GSI, then writes to the table are throttled. Therefore, if autoscaling for writes to the table is triggered, then one should expect that the write capacity of the GSI would need to be managed in response.
Autoscaling for table reads/writes can be configured through the AWS Management Console, via the CLI or using CloudFormation. The documentation posts sample JSON/YAML to accomplish this for table provisioning. However, when I attempt to create a new GSI on an autoscaled table, I see no options to mirror the table's settings. Nor can I find CLI or CloudFormation examples in the documentation on how to explicitly deal with indexes and auto-scaling.
So how do you manage write capacity for a GSI? Is my understanding of how things should work correct? Or does AWS "do the right thing" (in their opinion, anyway) and autoscale the GSI in parallel with the underlying table?
You can apply the same autoscaling settings for you global secondary indexes. According to AWS docs:
If you enable DynamoDB auto scaling for a table that has one or more global secondary indexes, we highly recommend that you also apply auto scaling uniformly to those indexes. You can do this by choosing Apply same settings to global secondary indexes in the AWS Management Console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With