DynamoDB storage cost calculation with TTL

0

Hi, I'm trying to understand how does dynamoDB caculate the cost of storage. From the pricing calculator it seems to be a function of data size:

1,000 GB x 0.1132 USD = 113.20 USD (Data storage cost) DynamoDB data storage cost (monthly): 113.20 USD

Now in this case if I have 1000GB of data written to the database with 1 hour of TTL how much will be the cost for my storage? Is it still the 113$ or it will be sum of amount of data written?

  • please accept the answer if it was helpful

sh
asked 15 days ago185 views
2 Answers
1

I'd suggest being careful about making significant assumptions about costs without testing them in practice. Documentation explains that deletion based on TTL is implemented as a background process and may take days to complete deleting an item after its expiration time. It further explains that to ensure your queries don't return items with expiration times in the past, you should apply explicit filters in your queries and scans to exclude them, further emphasising that the TTL-based deletions aren't immediate. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html

Therefore, I wouldn't expect the 1-hour TTL to be anywhere near one hour for either functional or pricing purposes but probably somewhere around 24-48 hours. If you're calling DeleteItem to delete your items explicitly, rather than relying on the TTL mechanism, the explicit deletions should be expected to be reflected within seconds.

EXPERT
Leo K
answered 15 days ago
profile pictureAWS
EXPERT
reviewed 15 days ago
0

If the data is deleted exactly after 1 hour, you only pay for the storage used during that time. DynamoDB charges are calculated for storage on an hourly basis.

You will also pay for Write requests

profile picture
EXPERT
answered 15 days ago
profile picture
EXPERT
reviewed 15 days ago
  • Thanks, to clarify does this mean that if the storage constantly contains 1000GB of data that is written and expired every hour then the cost will be 1,000 GB x 0.1132 USD?

  • if you remove old data every 1 hour and add new data every 1 hour, and in the result, you still have 1000Gb of data in the DynamoDB, you will pay for 1,000 GB x 0.1132 USD and charges for write requests according to your capacity mode (on-demand or provisioned)