Monthly DynamoDB procedure - best practices help

0

We run a system that collects data monthly, so we have several central tables, then more of a YYYY_MM structure. So days before the new month we are creating a table, setting capacity, PITR, etc. Then around the 6th, we will lower the capacity from the previous month, lower capacity, etc. and I want to automate this. The only thought I had was using an admin server with AWS keys, and writing a script using CLI tools. Naturally that user would need credentials, etc. but is there any other way that would be easier?

Also regarding the backup, if I am using AWS Backup, once the previous month is done, I am trying to find out how I am charged, if the data doesn't change and I leave the daily flag on, do I pay for more storage (the same data over and over) or is it just the one time as the data is the same as that will affect that part.

Thank you in advance.

asked 2 years ago284 views
2 Answers
1
Accepted Answer

My suggestion here would be to use Amazon EventBridge which invokes a Lambda function on monthly basis. The logic in your Lambda can be used to change the tables capacity settings etc.. I would also suggest looking into DynamoDB Standard-IA table class which may suit your use-case.

For Auth, you can attach an IAM role with the necessary permission to your Lambda function so it can make the desired updates. More here

For DynamoDB Backups, you are only charged for the data stored, so if the data does not change then your monthly bill will remain the same.

profile pictureAWS
EXPERT
answered 2 years ago
  • Leeroy - regarding the data stored pricing. How does it work if I make a tag called daily and after 30 days, that table stops getting written to, so in the aws backup I say to move to cold storage after 45 days? The data doesn't change, but does the backup script run, look and see no warm backup and make a new one, or is it smart enough to say I have a backup there, its in cold storage, no data change and do nothing and I keep the cold storage savings?

0

Thanks Leeroy, have never used EventBridge due to I am a bash/linux guy and Lambda doesn't support, but I keep saying I need to get on to Python so here is yet another reason!

Thanks much

answered 2 years ago
  • Honestly, you wont regret it. Its super powerful and easy to implement. If you need some examples to get you up in running with Python and DynamoDB, check out our repo here

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions