Transactions in Azure Functions with multiple outputs

半城伤御伤魂 提交于 2019-12-24 06:30:56

问题


How are we supposed to handle transactions when having multiple output bindings in an Azure function and i have to guarantee that writing to all of the outputs has succeeded? Does the runtime provide some sort of distributed transaction handling or do i have to build everything myself?

For example i have a binding to DocumentDb and to Blob Storage. For some reason writing to Blob Storage fails. Is there a possiblity to rollback the whole operation?


回答1:


Runtime does not provide any transactional guarantees between multiple outputs. If first output succeeds, and then second one fails, you might end up in inconsistent state.

One workaround is to use trigger type with retries (e.g. Service Bus), and make all outputs idempotent.



来源:https://stackoverflow.com/questions/49598746/transactions-in-azure-functions-with-multiple-outputs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!