What is the difference between a saga, a process manager and a document-based approach?

前端 未结 5 1668
野趣味
野趣味 2020-12-22 19:05

What I understand is that all three concepts are related to long-running transactions.

A process manager is, to my understanding, a finite state machine which simply

5条回答
  •  自闭症患者
    2020-12-22 19:18

    Saga and Process Manager are two integration patterns. They are very alike, but not in total.

    • Saga is a pattern that helps you to implement each business transaction that spans multiple services as a saga. In fact, you will create a sequence of local transactions where each local transactions updates the database and publishes a message or an event to trigger the next local transaction in the saga. There are two possible ways to implement a saga: Orchestration (an orchestrator tells the participants what local transactions to execute) and Choreography (each local transaction publishes domain events that trigger local transactions in other services). Is very common that using Saga will determine the usage of CQRS and EventSourcing.
    • Process Manager is a processing unit that it's existing in order to mantain the state of the sequence and determine the next processing step based on intermediate results. It's a routing pattern. It's more like an Orchestrator Saga.

提交回复
热议问题