Amazon DynamoDB Cost Optimization

NoSQL database systems like DynamoDB use alternative models for data management, such as key-value pairs or document storage. In DynamoDB, you design your schema specifically to make the most common and important queries as fast and as inexpensive as possible. Your data structures are tailored to the specific requirements of your business use cases.

Because Amazon DynamoDB is a fully managed database where a user does not provision any machines, the pricing is not as straight forward.

Best Practices

  1. Use cheaper regions if not concerned about data's location. The cheapest regions are us-east-1, us-east-2 and us-west-2 costing $0.25 per GB/month, $0.00065 per WCU/hour and $0.00013 per RCU/hour.
  2. Always aim to make your records as small as possible. If making attribute values is not an option, try making attribute names shorter. This helps you reduce the amount of storage required for your data.
  3. Saving images in DynamoDB can quickly skyrocket costs. It's very inefficient, and you should rather store all images in S3 and save the URL pointing to it in DynamoDB .
  4. Try to use queries over scans when fetching data from DynamoDB. The difference here is that with a Query, you are charged only for items which are returned, with Scans, you're being charged for all the rows scanned, not the total amount of items returned.
  5. DynamoDB supports both eventually consistent and strongly consistent reads data model, avoid strongly consistent reads and transactions where possible as they come with additional costs.
  6. To minimize the storage costs, aim to always purge unnecessary data if you do not have to keep old data.