node.js - 如何在特定阶段将数据从 azure cosmos db 备份到 azure blob?

标签 node.js azure azure-cosmosdb azure-blob-storage azure-data-factory

我有 Azure cosmos DB 帐户,我想要做的是使用我的 Node 应用程序将一个月前的数据从 azure cosmos DB 备份到 Azure blob 存储。我已经创建了管道,并通过使用 Nodejs 的创建运行管道 API(使用 Azure 数据工厂)触发了它。但我无法弄清楚如何使管道选择性地选择距离当前日期一个月前的数据。有什么建议吗?

编辑:实际上我想每天运行API,以便它备份一个月前的数据。例如,假设我今天在 cosmos DB 中收到 100 个条目,因此管道应选择当前日期 - 30 天的数据并进行备份,以便在任何时候我的 Azure cosmos DB 仅包含最近 30 天的数据,其余数据备份到 Azure blob。

最佳答案

只是对@David的回答的补充。如果您指的是Cosmos DB SQL API,它具有基于此链接的自动备份机制:Automatic and online backups .

With Azure Cosmos DB, not only your data, but also the backups of your data are highly redundant and resilient to regional disasters. The automated backups are currently taken every four hours and at any point of time, the latest two backups are stored. If you have accidentally deleted or corrupted your data, you should contact Azure support within eight hours so that the Azure Cosmos DB team can help you restore the data from the backups.

但是,您无法直接访问此备份。仅当启动备份还原时,Azure Cosmos DB 才会使用此备份。

但是文档提供了两个options管理您自己的备份。

  • 1.使用 Azure 数据工厂定期将数据移动到您选择的存储。
  • 2.使用 Azure Cosmos DB 更改源定期读取数据以进行完整备份以及增量更改,并将其存储在您自己的数据库中 存储。

您可以使用触发ADF中的复制事件来传输计划中的数据。如果您想按日期过滤数据,您可以了解_ts在cosmos db中代表数据的最新修改时间。

关于node.js - 如何在特定阶段将数据从 azure cosmos db 备份到 azure blob?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56938829/

相关文章:

javascript - 如何让socket.io只监听一个特定的路由?

Azure 存储模拟器返回 500 内部服务器错误

azure-cosmosdb - 与 (documentdb)SQL API 相比,在 Cosmos DB 中使用 Graph API 非常慢

azure - 如何使用 MongoDB API 将 Azure Databricks 连接到 Cosmos DB?

azure - 如何以编程方式创建 Windows Azure 租户和用户

c# - Azure DocumentDB .JSON 反序列化为实体时有多个级别

javascript - 在 NodeJs 中呈现 jquery POST 请求的响应

node.js - 合并不使用 Object.assign() 的 Apollo Server 的 GraphQL 解析器

node.js - 如何通过 browserify 使用 Node.js 的 net 模块?

javascript - Outlook WEB 加载项执行 getAccessToken 返回状态代码 302