简体   繁体   English

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

[英]Copy Data from MySQL (on-premises) to Cosmos DB

I have several questions as follows:我有几个问题如下:

  1. I was wondering how I could transfer data from MySQL to Cosmos DB using either Python or Data Azure Factory, or anything else.我想知道如何使用 Python 或 Data Azure Factory 或其他任何方法将数据从 MySQL 传输到 Cosmos DB。
  2. If I understand correctly, a row from the table will be transformed into a document, is it correct?如果我理解正确,表中的一行将转换为文档,对吗?
  3. Is there any way to create one more row for a doc during the copy activity?有没有办法在复制活动期间为文档再创建一行?
  4. If data in MySQL are changed, will the copied data in Cosmos DB be automatically changed too?如果 MySQL 中的数据发生变化,Cosmos DB 中复制的数据是否也会自动发生变化? If not, how to do such triggers?如果没有,如何做这样的触发器?

I do understand that some questions can be simply done;我确实明白有些问题可以简单地完成; however, I'm new to this.但是,我对此很陌生。 Please bear with me.请多多包涵。

1.I was wondering how I could transfer data from MySQL to Cosmos DB using either Python or Data Azure Factory, or anything else. 1.我想知道如何使用 Python 或 Data Azure Factory 或其他任何东西将数据从 MySQL 传输到 Cosmos DB。

Yes, you could transfer data from mysql to cosmos db by using Azure Data Factory Copy Activity.是的,您可以使用 Azure 数据工厂复制活动将数据从 mysql 传输到 cosmos db。

If I understand correctly, a row from the table will be transformed into a document, is it correct?如果我理解正确,表中的一行将转换为文档,对吗?

Yes.是的。

Is there any way to create one more row for a doc during the copy activity?有没有办法在复制活动期间为文档再创建一行?

If you want to merge multiple rows for one document,then the copy activity maybe can't be used directly.如果您想为一个文档合并多行,则可能无法直接使用复制活动。 You could make your own logical code(eg Python code) in the Azure Function Http Trigger .您可以在Azure Function Http Trigger 中制作自己的逻辑代码(例如 Python 代码)。

If data in MySQL are changed, will the copied data in Cosmos DB be automatically changed too?如果 MySQL 中的数据发生变化,Cosmos DB 中复制的数据是否也会自动发生变化? If not, how to do such triggers?如果没有,如何做这样的触发器?

So,you could tolerate delay sync,you could sync the data using Copy Activity between sql and cosmos db in the schedule.因此,您可以容忍延迟同步,您可以在计划中使用 sql 和 cosmos db 之间的复制活动来同步数据。 If you need to timely sync,as i know, azure function does support sql server trigger.But you could get some solutions from this document .如果你需要及时同步,据我所知,azure 函数确实支持 sql server trigger。但是你可以从这个文档中得到一些解决方案。

  1. Defining Custom Binding in Azure functions在 Azure 函数中定义自定义绑定

  2. If not the binding on Azure Functions side, then it can be a SQL trigger invoking an Azure Functions HTTP trigger.如果不是 Azure Functions 端的绑定,则它可以是调用 Azure Functions HTTP 触发器的 SQL 触发器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将增量数据从本地 MySql 复制到 Azure MySql 当本地 Z9DF306F03DAEDCCF82ZF5E2 使用 AEDCCF82ZF5E2 参考时的日期字段 - how to copy incremental data from on-premises MySql to Azure MySql when on-premises MySql has no date field for reference using ADF 数据从本地MySQL迁移到RDS for MySQL - Data migration from on-premises MySQL to RDS for MySQL 在本地MySQL与Azure MySQL数据库之间进行镜像? - Mirroring between on-premises MySQL to azure MySQL database? 我们可以在本地 MySQL 服务器到 Azure 数据库之间设置数据库同步,用于 MySQL - can we setup a sync of databases between on-premises MySQL server to Azure Database for MySQL MySQL查询将新数据从一个数据库复制到另一个数据库 - Mysql query to copy new data from one DB to another mysql转储将新的和更改的数据复制到数据库 - mysql dump copy new and changed data to DB 每5分钟将MSSQL数据复制到MySQL DB吗? - Copy MSSQL data to MySQL DB every 5 mins? 将数据从1个DB复制到另一个DB - Copy data from 1 DB to another DB 将MySql DB从一台服务器复制到另一台服务器 - copy MySql DB from one server to another 从一个mysql数据库复制到另一个,并将表数据分成不同的表 - copy from one mysql DB to another and separate table data into different tables
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM