我有几个问题如下:
- 我想知道如何将数据从 MySQL 传输到 Cosmos DB 使用 Python 或 Data Azure Factory 或其他任何东西。
- 如果我理解正确的话,表格中的一行将被转换 写入文档,正确吗?
- 有没有办法在复制事件期间为文档多创建一行?
- 如果 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得到一些解决方案.
在 Azure 函数中定义自定义绑定(bind)
如果不是 Azure Functions 端的绑定(bind),则它可以是调用 Azure Functions HTTP 触发器的 SQL 触发器。
关于mysql - 将数据从 MySQL(本地)复制到 Cosmos DB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54878136/