We use machine learning technology to do auto-translation. Click "English" on top navigation bar to check Chinese version.
Optimize costs by scheduling provisioned capacity for Amazon DynamoDB
To manage the cost of a DynamoDB provisioned capacity table, you can adjust the provisioned read/write capacity. You can do this through auto scaling or based on a schedule that accounts for peak and off-peak hours of traffic.
Amazon DynamoDB has auto scaling capabilities that use the
In this post, I show you how to optimize the cost of a provisioned capacity table by combining auto scaling and changing the minimum throughput of a provisioned capacity table on a set schedule so that it allows for an increased write capacity at the desired time without any delay.
Problem statement
There are workloads that have predictable changes on a regular cycle. For example, trading platforms in the financial industry. In the financial industry, trading starts on Monday morning and ends on Friday evening. When the markets open on Monday, there is a sudden surge in activity with no time to ramp up. Another example is a retail sale that coincides with significant marketing promotion. When the sale starts, the online store might experience a surge of orders.
On-demand capacity is great for unpredictable workloads, but in use cases like the ones described above, it might throttle and only scale by doubling capacity every 30 minutes, as described in
If you’re using provisioned capacity and have predictable, cyclical high demand that must be adjusted for immediately, such as the financial industry example, you need to set a high minimum read/write provisioned capacity on your DynamoDB table. This means you might be paying for a lot of unused capacity during periods of low traffic, such as over the weekends. You can use Application Auto Scaling to schedule scaling policies that adjust your provisioned throughput to support predictable changes in traffic. You could adjust the capacity manually, but an automated solution is preferred.
Solution overview
When using Application Auto Scaling, you can use a cron
expression to schedule a policy. You can create multiple schedules to change your table’s capacity as needed.
The following resources are created in CloudFormation by the template, as shown in the snippet that follows:
- A DynamoDB table with an initial read/write provisioned capacity.
- An
AWS::ApplicationAutoScaling::ScalableTarget
that usesScheduleAction
to start peak scaling on Monday at 8:00 AM UTC by changing the minimum write capacity to 90 write capacity units (WCUs). It changes the minimum write capacity to 30 WCUs on Friday at 6:00 PM UTC (you can change the schedule to fit your use case).
As an example of the effect of scheduled changes to provisioned write capacity, Figure 1 that follows shows the results of hourly changes to the provisioned write capacity. The change to the provisioned write capacity is immediately reflected in the write usage of the table.

Figure 1: Provisioned write capacity changing hourly
Cleaning up
To avoid incurring future charges, delete the resources created by the template. You can delete all of the resources by deleting the CloudFormation stack by using either the
Savings
A financial industry customer was able to reduce their costs by 25 percent by using scheduling to adjust their provisioned capacity to reflect expected traffic.
Conclusion
In this post, I showed you how to scale Amazon DynamoDB provisioned capacity using a cron-based Application Auto Scaling schedule. You can use this method to optimize costs for workloads that have known and predictable traffic patterns.
For more information about DynamoDB table capacity modes, see
About the Author
Jiten Dedhia is a Sr. Solutions Architect with over 20 years of experience in the software industry. He has worked with global financial services clients, providing them advice on modernizing by using services provided by Amazon Web Services.
The mentioned AWS GenAI Services service names relating to generative AI are only available or previewed in the Global Regions. Amazon Web Services China promotes AWS GenAI Services relating to generative AI solely for China-to-global business purposes and/or advanced technology introduction.