Member-only story
What is the SAGA Pattern in Microservice Architecture? Which Problem does it solve?
SAGA is an essential Microservice Pattern that solves the problem of maintaining data consistency in distributed system
My article is free for everyone, click this link to read for FREE
Hello friends, if you are working in a Java Microservice or preparing for a Java developer interview where Microservice skills are needed then you must prepare about the SAGA Pattern.
SAGA is an essential Microservice pattern that aims to solve the problem of long-lived transactions in Microservice architecture. It’s also one of the popular Microservice Interview Questions which is often asked to experienced developers.
Since Microservice architecture breaks your application into multiple small applications, a single request is also broken down into multiple requests and there is a chance that some parts of requests succeed and some parts fail, in that case, maintaining data consistency is hard.
If are you dealing with real data like placing an order on Amazon then you must handle this scenario gracefully so that if payment fails then inventory reverts to its original state as well as order is not shipped.

