如何将 SQL 数据库迁移到 Cosmos DB。

huangapple go评论93阅读模式
英文:

How to Migrate sql database to cosmosdb

问题

我需要将SQL数据库迁移到Cosmos DB。我想了解迁移的策略、最佳实践和工具,或者我是否应该编写自己的迁移逻辑。

我已经了解到Azure Cosmos DB迁移工具和Azure Data Factory。我不确定应该使用哪一个。

此外,应该如何进行迁移呢?可能会有很多情况。例如:

  1. 可能只有少量记录被迁移,然后网络断开。
  2. 另一种情况可能是数据已经迁移,然后有人再次运行迁移等等。
英文:

I need to migrate sql database into the cosmosdb. I want to know about the strategies, best practices and tools to use for migration or should I write my own migration logic.

I have read about a Azure Cosmos db migration tool and Azure datafactory. I am not sure which one to use.

also how should one proceed in migration. There can be many scenarios. For e.g.

  1. There may be case only few records are migrated and network disconnects.
  2. Another case can be suppose data is migrated and somebody again runs the migrations etc.

答案1

得分: 1

我们的团队最近从SQL迁移到了Cosmos DB。
虽然Azure数据工厂是一个有效的选择,但我们最终选择了使用服务总线触发器构建我们自己的函数。(我们在本地运行,因此几乎没有成本)

这样,我们得以了解SDK,而无需学习如何使用Azure数据工厂。

在我们的实验中,还清楚地表明,在自定义实现中,复杂的数据转换更容易。特别是对于(深度)嵌套对象。

英文:

Our team has done a migration recently from SQL to Cosmos DB.
Although Azure Data Factory is a valid option, we ended up building our own function with a service bus trigger. (Which we ran locally, resulting in barely any costs)

This way we got to know the SDK instead of having to learn to work with Azure Data Factory.

In our experiments it also became clear that complex data transformations were easier in a custom implementation. Especially with (deeply) nested objects.

答案2

得分: 0

首先确定要进行数据加载的 Azure Cosmos DB API。

尝试使用 Azure Data Factory 使用 Copy Data 活动加载数据。

如果需要应用自定义逻辑,请使用 Mapping Data Flow 活动并使用不同的转换。

参考链接:https://learn.microsoft.com/en-us/azure/data-factory/how-to-sqldb-to-cosmosdb

英文:

First identify the Azure Cosmos DB API to which Data load has to happen.

Try to use Azure Data Factory to load data using Copy Data Activity.

If need to apply customized logic, use Mapping Data Flow Activity with different transformations.

Reference Link: https://learn.microsoft.com/en-us/azure/data-factory/how-to-sqldb-to-cosmosdb

huangapple
  • 本文由 发表于 2023年5月25日 15:48:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76329996.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定