简体   繁体   English

使用 PITR 恢复 DynamoDB 表并更新 Cloudformation/CDK/其他服务参考

[英]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:这是痛苦开始的地方:

  1. AWS's documentation after the creation of the new table is INEXISTENT!创建新表后 AWS 的文档是不存在的!
  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非常感谢社区::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 堆栈。

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.使用参数Store来保存你的表的最新名称,你所有的down stream应用程序都会通过查询param store来解析表名。

Lambda Env Variable Lambda 环境变量

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 或允许您设置环境变量的服务。

Inline Anwers for Completeness完整性的内联答案

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.

相关问题 使用 Lambda 更新 DynamoDB 表 - Updating DynamoDB table using a Lambda 使用 CDK 使 DynamoDB 表成为 Kinesis Data Stream 的消费者 - Make DynamoDB table a consumer for Kinesis Data Stream using CDK 如果不存在,则使用 Cloudformation 创建 DynamoDB 全局表 - Create the DynamoDB global Table if doesn't exist using Cloudformation AWS ApiGateway集成S3、SQS、SNS、DynamoDB等服务,如何构建AWS CloudFormation集成URI? - How to construct AWS CloudFormation integration URI for AWS ApiGateway integration with S3, SQS, SNS, DynamoDB and other services? 通过 CDK 将 replicationRegions 添加到导入的 DynamoDB 表? - Add replicationRegions to an imported DynamoDB table via CDK? 使用 CDK 的 AWS DynamoDB 备份 - AWS DynamoDB Backup using CDK AWS CDK 更新现有的 DynamoDB 表 - AWS CDK Update an existing DynamoDB Table AWS DynamoDB Java SDK 如何查看表是否启用了时间点恢复 (PITR)? - AWS DynamoDB Java SDK how to see if Point-in-time recovery (PITR) is enabled on table? 当使用 cloudformation 模板对 dynamodb 表进行任何更改时,如何触发 Function? - How trigger Function when any changes in dynamodb table using cloudformation template? 使用 AWS CDK 解决 AWS Cloudformation 中的资源相互依赖性 - Solving resource interdependencies in AWS Cloudformation, using AWS CDK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM