saga pattern

  • Choreography-based Saga Pattern: In this approach, each service in the transaction communicates directly with other services to coordinate their actions. There is no central coordinator or controller managing the transaction. Instead, each service publishes events to notify other services of its actions and subscribes to events to receive notifications from other services. This decentralized approach allows services to act independently, enhancing the system's scalability1.
  • Orchestration-based Saga Pattern: This approach employs a central coordinator or controller service that manages the transaction. The coordinator sends messages to each service, instructing it on what actions to take and in what order. The coordinator is responsible for managing the flow of the transaction and coordinating the execution of each step in the saga. This centralized approach provides better control and visibility over the transaction flow but may introduce a single point of failure and reduce system scalability compared to the choreography-based approach

AI generated

personally i prefer choreography for the customer flows(order life cycle) and orchestration for the internal flows(product onboarding and store onboarding).

    All notes