In a microservices architecture, what is the "saga pattern" used for, and how does it differ from a traditional distributed transaction?
Correct! Well done.
Incorrect.
The correct answer is A) A saga coordinates a sequence of local transactions across services, using compensating transactions to undo prior steps if a later step fails, rather than relying on a single atomic distributed transaction (e.g., two-phase commit)
Correct Answer
A saga coordinates a sequence of local transactions across services, using compensating transactions to undo prior steps if a later step fails, rather than relying on a single atomic distributed transaction (e.g., two-phase commit)
Distributed transactions (2PC) are often impractical at scale due to blocking and coordinator failure risks; sagas instead break a business process into a series of local transactions with compensating actions to maintain eventual consistency if something fails partway through.