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.

已提問 2 年前檢視次數 293 次
2 個答案
1
已接受的答案

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
專家
已回答 2 年前
  • 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

已回答 2 年前
  • 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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南