Search code examples
javaamazon-dynamodbaws-sdk

Retrieveing Maximum capacity units for a Provisioned table in DynamoDB via AWS SDK


Is it possible to query the maximum via DynamoDB AWS SDK, preferably with the AWS SDK for Java 2.x ?

To be more specific, the value you input in the Maximum capacity units when you create or edit a DDB table with capacity mode set to provisioned.

DDB table capacity


Solution

  • When in on-demand capacity mode, DynamoDB does not use autoscaling so there is no min and max as you'd imagine when comparing it to provisioned. While there is a maximum, you can always scale to double your previous peak instantly. In its current form, the previous peak does not come down.

    If you are using on-demand mode and require a throughput of more than 4k WCU or 12k RCU then you can consider pre-warming your on-demand table where you set the previous peak manually.

    Currently you are unable to use the SDK to understand the maximum directly via a single lookup call.


    Update based on change of ask:

    For provisioned capacity you need to use DescribeScalableTarget as the autoscaling is handled by Application Autoscaling:

    https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/applicationautoscaling/ApplicationAutoScalingClient.html#describeScalableTargets(software.amazon.awssdk.services.applicationautoscaling.model.DescribeScalableTargetsRequest)