Transactions in microservices

后端 未结 6 1573
孤街浪徒
孤街浪徒 2021-02-07 00:52

I have read some articles about microservices architecture, but no one takes the topic of transaction. All that they says that this is hard to do it. Maybe someone can describe

6条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 01:36

    The best design is having isolated services: each service just do its work within its own transaction and your workflow expects failures on the single service.

    If you really need to commit only if all the services are called without errors you should create an higher level service that perform those calls inside an external transaction.

提交回复
热议问题