Choose the best explanation for why the Saga pattern is used in distributed transactions.
Think about how distributed systems handle failures without locking resources.
The Saga pattern breaks a distributed transaction into a series of local transactions with compensating actions to undo changes if a step fails, avoiding the need for distributed locks.
Identify the key component responsible for managing the sequence of transactions and compensations in an orchestration-based Saga.
Consider which part controls the flow of the Saga steps explicitly.
In orchestration-based Saga, a central orchestrator directs each service when to perform its transaction or compensation, managing the Saga flow.
Choose the best explanation of how Saga supports scalability in distributed systems.
Think about how locking affects system throughput and concurrency.
Saga allows each service to commit its local transaction independently without waiting for others, avoiding distributed locks and improving scalability.
Identify the main downside of using Saga compared to traditional atomic transactions.
Consider how Saga handles failures and data visibility during the process.
Saga provides eventual consistency by using compensating transactions, so data may be temporarily inconsistent until all steps complete or compensate.
A Saga consists of 5 sequential local transactions. If the transaction fails at step 4, how many compensating transactions must be executed to rollback?
Think about which steps have already committed before failure and need compensation.
If failure occurs at step 4, steps 1, 2, and 3 have committed and require compensation. Step 4 did not commit, so no compensation needed for it.
