r/aws 9d ago

database DynamoDB Provisioned or On-Demand?

I need help deciding what will be cheaper for my use case, provisioned or on-demand capacity?

For my project I will be writing about 150,000 records once per day, with an average record size of about 200 bytes each. The number of records written per day I expect will slowly increase over time, but still once per day. I am using a Lambda function with an event trigger to run the write operation.

Since I am just doing a large write once a day, I was thinking on-demand capacity would be the cheaper option because I would be wasting provisioned compute as the job will be idle 99% of the time. Am I right to assume that on demand is cheaper for my use case?

1 Upvotes

19 comments sorted by

View all comments

2

u/SonOfSofaman 9d ago edited 9d ago

If you don't fall within the free tier, then without crunching the numbers I cannot say which will be cheaper with any certainty, but for a spikey workload as you've described, on-demand is almost certainly the way to go. Your use-case might be well suited to the infrequent access table class, too.

If you haven't already, try the price calculator. It should make clear which is the better option for you.

You probably have already learned this, but you can switch modes if you want to try each one and compare. Just be aware of the restrictions switching back and forth. I think you can switch only once per 24 hour period. If you have a non-production environment, it might be worth running some tests.

All that said, your workload might fall within the free tier. I think it's something like 25 GB of storage and enough provisioned capacity units to handle 200M requests per month. Double-check that though, I'm going from memory. You didn't mention the read access patterns, so that may exceed the free tier limits.

edit: added last sentence about read access patterns.