[英]Restoring a DynamoDB table using PITR and updating Cloudformation/CDK/other services references
I have an environment where my DynamoDB table is central to a few services (a couple of lambdas, kinesis and firehoses).我有一个环境,在这个环境中,我的 DynamoDB 表是一些服务(几个 lambdas、kinesis 和 firehoses)的中心。 All of that is managed by AWS's CloudFormation/Typescript CDK.
所有这些都由 AWS 的 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.该表启用了 PITR,据我所知,只有将恢复的数据转储到新表中才能执行 PITR。 Here is where the pain begins:
这是痛苦开始的地方:
Thanks a lot community: :D非常感谢社区::D
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.
首先,当您恢复到一个新表时,您需要将该资源导入您的 CDK 堆栈。
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.使用参数Store来保存你的表的最新名称,你所有的down stream应用程序都会通过查询param store来解析表名。
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.将表名动态设置为 lambda 的环境变量,与其他方法相比,这将减少延迟,但它仅适用于 Lambda 或允许您设置环境变量的服务。
AWS's documentation after the creation of the new table is INEXISTENT!
创建新表后 AWS 的文档是不存在的!
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.上面提到的2个选项是最常见的方法。
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.是的,如上所述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.