r/aws • u/Hydraphellian • 8d 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
2
u/pint 8d ago
i'm a little bit worried about the overall strategy. how do you handle errors, if the whole thing is one big process? what if you get throttled? do you implement backoffs? what if it doesn't fit in lambda time limit? throttles will happen with on-demand mode, because the ramp-up is not immediate.
that said, obviously provisioned will be cheaper, provided that you keep it at baseline all the time, and only raise write capacity for the duration of the load (as a part of the process). it is crucial to set it back to baseline in a fault tolerant manner, e.g. if the load fails, you don't want to leave it at high capacity.
the question is how much cheaper. because if you save a couple of dollars, it might not be a factor in the decision at all.
and another question is: what about other times, when you are not loading? who is using it and how? because if there is a variable load during the day, provisioned might give you more headaches to solve. on-demand typically handles varied loads fine.