Need to Store Data in SqlAzure and Table Storage in single transaction.?

后端 未结 1 853
温柔的废话
温柔的废话 2021-01-24 11:03

I have an scenario for my application? I need to store the History data in table Storage and Main Data in Sql Azure. i.e If an update happens for the Data ,the History data sh

1条回答
  •  时光说笑
    2021-01-24 11:38

    Simple answer is, you can't. There's no concept of in-built distributed transactions here. Also table storage has limited transaction support.

    Here's what I would suggest: Rely on triggers in SQL Server and copy the old data in your SQL Server table to another table (let's call it backup table) in the same SQL Server using these triggers. Then have a background process poll this backup table and push the data in table storage. Once the data is pushed into table storage, remove the items from the backup table.

    0 讨论(0)
提交回复
热议问题