2

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.
  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? 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.

0

1 Answer 1

2

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

Yes, you could transfer data from mysql to cosmos db by using Azure Data Factory Copy Activity.

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(e.g. Python code) in the Azure Function Http Trigger.

If data in MySQL are changed, will the copied data in Cosmos DB be automatically changed too? 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. 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.

  1. Defining Custom Binding in Azure functions

  2. If not the binding on Azure Functions side, then it can be a SQL trigger invoking an Azure Functions HTTP trigger.

3
  • I'm currently working on this based on your answers. I will let you know if there's any progress. Thank you for your suggestions. Commented Mar 4, 2019 at 1:29
  • @MrGEAR Hi,any updates now?If you think my answer helps you,could you mark it for answer?Thanks a lot.
    – Jay Gong
    Commented Mar 7, 2019 at 3:24
  • Hi, your answer is helpful indeed. I'm now getting some ideas and directions. Thank you. Commented Mar 11, 2019 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.