Home > OS >  Restoring a DynamoDB table using PITR and updating Cloudformation/CDK/other services references
Restoring a DynamoDB table using PITR and updating Cloudformation/CDK/other services references

Time:01-28

I have an environment where my DynamoDB table is central to a few services (a couple of lambdas, kinesis and firehoses). All of that is managed by AWS's CloudFormation/Typescript CDK.

This table has PITR enabled and, as far as I know, it's only possible to do a PITR by dumping the recovered data into a new table. Here is where the pain begins:

  1. AWS's documentation after the creation of the new table is INEXISTENT!
  2. How can I update the references for the new table on all other services?
  3. Should I just 'erase' my old table and import the recovered ones?
  4. Wouldn't this means that I would need to take my service down to recover it?
  5. What is the "standard" or "best practice" here?

Thanks a lot community! :D

CodePudding user response:

You must restore to a new table yes. There are some ways to overcome the issues you describe. Firstly, when you restore to a new table you will need to import that resource to your CDK stack.

Parameter Store

Use the parameter Store to hold the latest name of your table, all of your down stream applications will resolve the table name by querying the param store.

Lambda Env Variable

Set your table name dynamically as environment variables for your lambda, this will reduce latency as opposed to the other approach, but it's only applicable to Lambda or services which allow you to set env variables.

Inline Anwers for Completeness

AWS's documentation after the creation of the new table is INEXISTENT!

Please share feedback directly on the docs page if you believe relevant information is missing.

How can I update the references for the new table on all other services?

2 options mentioned above is the most common approach.

Should I just 'erase' my old table and import the recovered ones?

This would cause application downtime, if you can afford that then it would be an easy approach. If not, follow the above suggestions.

Wouldn't this means that I would need to take my service down to recover it? What is the "standard" or "best practice" here?

Yes, as mentioned above.

  • Related