Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

SAGA Pattern — Choreography-based/Orchestration-based SAGA

Pragya Keshap answered on March 1, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • saga design pattern sample code
  • The Saga Pattern
  • Implementing an orchestration-based saga
  • orchestration-saga-pattern-with-spring-boot
  • How do you implement a Saga pattern?
  • Saga Pattern for Distributed Transactions - Choreography and Orchestration
  • Choreography-based SAGA Implementation
  • Order Fullfilment with Choreography-based SAGA Implementation
  • Benefits of Choreography-based SAGA
  • Drawbacks of Choreography-based SAGA
  • In a choreography-based saga, who is responsible for coordinating the updates to the databases ?
  • In an orchestration-based saga, who is responsible for coordinating the updates to the databases ?
  • What is the main drawback of using a choreography-based saga implementation ?
  • saga pattern aws
  • Orchestration Saga Pattern:
  • Which one is true about SAGA pattern?
  • AGA Pattern — Choreography-based/Orchestration-based SAGA

  • SAGA Pattern — Choreography-based/Orchestration-based SAGA

    0

    A distributed Saga is a collection of requests and compensating requests that represent a single business level action.

    Saga pattern allows us to use 2 approaches for implementation :

    Orchestration: As the name suggests, there is a central coordinator/orchestrator that handles all the microservice interactions. It transmits the events and responds to it. It calls the microservice-based on a workflow for a particular API action, and it invokes those microservice sequentially in order, wait for the response from one microservice before calling the other. Here microservices are tightly coupled as they are associated with the orchestrator. Removing any microservice in between is quite challenging as it impacts the overall workflow.

    No alt text provided for this image

    Choreography: This is another way in which the microservices interact with each other, the difference is to handle this interaction there is no separate coordinator or instructor who is needed to manage. Each microservice performs its action independently and decisions, logics, and interactions are decentralized managed by events. It provides low coupling of services and we can easily manage the addition/removal of services within a workflow without impacting other services in the workflow. This is also known as reactive architecture.

    choreography pattern image

    Use cases: When to react (chorography) v/s When to coordinate (orchestration)?

    Choreography is preferred over Orchestration when we need :

    lower coupling between the microservices. The orchestration pattern of communication is a Point-to-Point connection between the services and it increases complexity and any modification needs more work so that coordinator would be in synch to handle any new microservice in the existing workflow.

    fast processing and easy modifications for any add/update feature.

    An easy replay of events by using event sourcing/event store. At any point, it's possible for applications to read the history of events, and use it to materialize the current state of an entity by playing back and consuming all the events related to that entit 

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Tags: saga whatever
    Link to this answer
    Share Copy Link
    Contributed on Mar 01 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.