Identify your unused resources to optimize costs in Amazon Keyspaces
This section provides an overview of how to evaluate your unused resources regularly. As your application requirements evolve, you should ensure no resources are unused and contributing to unnecessary Amazon Keyspaces costs. The procedures described below use Amazon CloudWatch metrics to identify unused resources and take action to reduce costs.
You can monitor Amazon Keyspaces using CloudWatch, which collects and processes raw data from Amazon Keyspaces into readable, near real-time metrics. These statistics are retained for a period of time, so that you can access historical information to better understand your utilization. By default, Amazon Keyspaces metric data is sent to CloudWatch automatically. For more information, see What is Amazon CloudWatch? and Metrics retention in the Amazon CloudWatch User Guide.
Topics
How to identify unused resources
To identify unused tables you can take a look at the following CloudWatch metrics over a period of 30 days to understand if there are any active reads or writes on a specific table:
ConsumedReadCapacityUnits
The number of read capacity units consumed over the specified time period, so you can track how much consumed capacity you have used. You can retrieve the total consumed read capacity for a table.
ConsumedWriteCapacityUnits
The number of write capacity units consumed over the specified time period, so you can track how much consumed capacity you have used. You can retrieve the total consumed write capacity for a table.
Identifying unused table resources
Amazon CloudWatch is a monitoring and observability service which provides the Amazon Keyspaces table metrics you can use to identify unused resources. CloudWatch metrics can be viewed through the Amazon Web Services Management Console as well as through the Amazon Command Line Interface.
Cleaning up unused table resources
If you have identified unused table resources, you can reduce their ongoing costs in the following ways.
Note
If you have identified an unused table but would still like to keep it available in case it needs to be accessed in the future, consider switching it to on-demand mode. Otherwise, you can consider deleting the table.
Capacity modes
Amazon Keyspaces charges for reading, writing, and storing data in your Amazon Keyspaces tables.
Amazon Keyspaces has two capacity modes, which come with specific billing options for processing reads and writes on your tables: on-demand and provisioned. The read/write capacity mode controls how you are charged for read and write throughput and how you manage capacity.
For on-demand mode tables, you don't need to specify how much read and write throughput you expect your application to perform. Amazon Keyspaces charges you for the reads and writes that your application performs on your tables in terms of read request units and write request units. If there is no activity on your table, you do not pay for throughput but you still incur a storage charge.
Deleting tables
If you’ve discovered an unused table and would like to delete it, consider to make a backup or export the data first.
Backups taken through Amazon Backup can leverage cold storage tiering, further reducing cost. Refer to the Managing backup plans documentation for information on how to use a lifecycle to move your backup to cold storage.
After your table has been backed up, you may choose to delete it either through the Amazon Web Services Management Console or through the Amazon Command Line Interface.
Cleaning up unused point-in-time recovery (PITR) backups
Amazon Keyspaces offers Point-in-time recovery, which provides continuous backups for 35 days to help you protect against accidental writes or deletes. PITR backups have costs associated with them.
Refer to the documentation at Backup and restore data with point-in-time recovery for Amazon Keyspaces to determine if your tables have backups enabled that may no longer be needed.