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

The Saga coordinator coordinates the execution as shown in Figure 29:

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

Contents


More Related Answers


The Saga coordinator coordinates the execution as shown in Figure 29:

0

User A sends a distributed transaction to the Saga coordinator. It contains two operations: A-

11andC+1.

Saga coordinator creates a record in the phase status table to trace the status of a transaction.

Saga coordinator examines the order of operations and determines that it needs to handle A-


1first.ThecoordinatorsendsA−1 as a command to Partition 1, which contains account A’s information.

Partition 1’s Raft leader receives the A-

1


1commandandstoresitinthecommandlist.Itthenvalidatesthecommand.Ifitisvalid,itisconvertedintoanevent.TheRaftconsensusalgorithmisusedtosynchronizedataacrossdifferentnodes.Theevent(deducting1 from A’s account balance) is executed after synchronization is complete.

After the event is synchronized, the event sourcing framework of Partition 1 synchronizes the data to the read path using CQRS. The read path reconstructs the state and the status of execution.

The read path of Partition 1 pushes the status back to the caller of the event sourcing framework, which is the Saga coordinator.

Saga coordinator receives the success status from Partition 1.

The Saga coordinator creates a record, indicating the operation in Partition 1 is successful, in the phase status table.

Because the first operation succeeds, the Saga coordinator executes the second operation, which is C+


1.ThecoordinatorsendsC+1 as a command to Partition 2 which contains account C’s information.

Partition 2’s Raft leader receives the C+


1commandandsavesittothecommandlist.Ifitisvalid,itisconvertedintoanevent.TheRaftconsensusalgorithmisusedtosynchronizedataacrossdifferentnodes.Theevent(add1 to C’s account ) is executed after synchronization is complete.

After the event is synchronized, the event sourcing framework of Partition 2 synchronizes the data to the read path using CQRS. The read path reconstructs the state and the status of execution.

The read path of Partition 2 pushes the status back to the caller of the event sourcing framework, which is the Saga coordinator.

The Saga coordinator receives the success status from Partition 2.

The Saga coordinator creates a record, indicating the operation in Partition 2 is successful in the phase status table.

At this time, all operations succeed and the distributed transaction is completed. The Saga coordinator responds to its caller with the result. 

Popularity 1/10 Helpfulness 1/10 Language whatever
Source: Grepper
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.