Scale DynamoDB Capacity using CloudWatch Metrics on Java

In this post i’ll show how to autoscale dynamodb using aws java sdk.

First of all we need to open our client and sessions and select our dynamodb table using aws java sdk.

Now we should get cloudwatch metrics. So that we have to create our request using last 10 minutes metrics and getting cloudwatch json response.

After the request done and getting the response we taking last cumulative sum for write throttle

After that its just our logic. So i set this to if cumulative sum is bigger than 100 i increase by %20.

Thats it if you want to check this every 10minutes you should add your loop or use your thread.

This entry was posted in AWS, Java and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *