mysql - 将数据从 MySQL(本地)复制到 Cosmos DB

标签 mysql azure azure-cosmosdb azure-data-factory

我有几个问题如下:

  1. 我想知道如何将数据从 MySQL 传输到 Cosmos DB 使用 Python 或 Data Azure Factory 或其他任何东西。
  2. 如果我理解正确的话,表格中的一行将被转换 写入文档,正确吗?
  3. 有没有办法在复制事件期间为文档多创建一行?
  4. 如果 MySQL 中的数据发生更改,Cosmos DB 中复制的数据也会自动更改吗?如果没有,如何触发此类事件?

我确实明白有些问题可以简单地做;不过,我对此很陌生。请耐心等待。

最佳答案

1.I was wondering how I could transfer data from MySQL to Cosmos DB using either Python or Data Azure Factory, or anything else.

是的,您可以使用 Azure 数据工厂复制事件将数据从 mysql 传输到 cosmos db。

If I understand correctly, a row from the table will be transformed into a document, is it correct?

是的。

Is there any way to create one more row for a doc during the copy activity?

如果您想合并一个文档的多行,则复制事件可能无法直接使用。您可以在Azure Function Http Trigger中编写自己的逻辑代码(例如Python代码) 。

If data in MySQL are changed, will the copied data in Cosmos DB be automatically changed too? If not, how to do such triggers?

因此,您可以容忍延迟同步,您可以在计划中使用 sql 和 cosmos db 之间的复制事件来同步数据。如果你需要及时同步,据我所知,azure函数确实支持sql server触发器。但是你可以从这个document得到一些解决方案.

  1. 在 Azure 函数中定义自定义绑定(bind)

  2. 如果不是 Azure Functions 端的绑定(bind),则它可以是调用 Azure Functions HTTP 触发器的 SQL 触发器。

关于mysql - 将数据从 MySQL(本地)复制到 Cosmos DB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54878136/

相关文章:

java - 通信链路故障 最后发送到服务器的数据包是在 4 毫秒前

azure - 如何在 Azure 门户中为高级存储帐户的 Azure Blob 服务设置 CORS?

azure - 自动扩大/缩小 Cosmos DB RU

azure-cosmosdb - 如何更新 Gremlin 中的边缘标签?

hadoop - 在Hadoop作业中如何从DocumentDB获取数据

php - MySQLi输入数据到数据库

java - 极度减速 Cloud vs VPS(亚马逊,Jelastic)

php - 检查用户以html形式输入的数据是否已存在于php的数据库中

Azure 云辅助角色没有获得足够的 CPU 使用率

c# - Azure Functions EventGrid 触发器