Recall & Review
beginner
What is the Saga pattern in distributed transactions?
The Saga pattern breaks a large transaction into smaller steps, each with its own local transaction and compensating action. It ensures data consistency across services without locking resources for a long time.
Click to reveal answer
intermediate
How does RabbitMQ help implement the Saga pattern?
RabbitMQ acts as a message broker to send and receive events between services. It helps coordinate the steps of the Saga by passing commands and compensations reliably and asynchronously.
Click to reveal answer
beginner
What is a compensating transaction in the Saga pattern?
A compensating transaction is an action that reverses the effect of a previous step if something fails later. It helps maintain consistency by undoing partial changes.
Click to reveal answer
intermediate
What are the two main types of Saga execution styles?
1. Choreography: Services communicate by emitting and listening to events without a central coordinator.<br>2. Orchestration: A central orchestrator sends commands to services to perform steps and handle compensations.
Click to reveal answer
intermediate
Why is the Saga pattern preferred over distributed two-phase commit in microservices?
Saga avoids locking resources for long periods, improving system availability and scalability. It fits better with asynchronous, loosely coupled microservices architectures.
Click to reveal answer
What role does RabbitMQ play in the Saga pattern?
✗ Incorrect
RabbitMQ is used as a message broker to send and receive messages that coordinate the Saga steps asynchronously.
What happens if a step in a Saga fails?
✗ Incorrect
Compensating transactions are triggered to undo previous successful steps to maintain consistency.
Which Saga execution style uses a central coordinator?
✗ Incorrect
Orchestration uses a central orchestrator to send commands and manage the Saga flow.
Why is Saga pattern better for microservices than two-phase commit?
✗ Incorrect
Saga avoids long locks and blocking, making microservices more available and scalable.
In Saga, what is the purpose of a compensating transaction?
✗ Incorrect
Compensating transactions undo previous steps to keep data consistent if a later step fails.
Explain how the Saga pattern manages distributed transactions using RabbitMQ.
Think about how messages flow between services to keep data consistent.
You got /5 concepts.
Describe the difference between Saga choreography and orchestration styles.
Consider who controls the flow of the Saga in each style.
You got /4 concepts.