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

The idea of Saga is simple:

Sumit Rawal answered on May 21, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


The idea of Saga is simple:

0

All operations are ordered in a sequence. Each operation is an independent transaction on its own database.

Operations are executed from the first to the last. When one operation has finished, the next operation is triggered.

When an operation has failed, the entire process starts to roll back from the current operation to the first operation in reverse order, using compensating transactions. So if a distributed transaction has n operations, we need to prepare 2n operations: n for the normal case and another n for the compensating transaction during rollback.

It is easier to understand this by using an example. Figure 13 shows the Saga workflow to transfer $1 from account A to account C. The top horizontal line shows the normal order of execution. The two vertical lines show what the system should do when there is an error. When it encounters an error, the transfer operations are rolled back and the client receives an error message. As we mentioned in the “Valid operation orders” section, we have to put the deduction operation before the addition operation.

Popularity 1/10 Helpfulness 1/10 Language whatever
Source: Grepper
Tags: saga whatever
Link to this answer
Share Copy Link
Contributed on May 21 2023
Sumit Rawal
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.