In any software application we generally require talking to multiple microservices to achieve a single business outcome. An example of this outcome can be performing a checkout on an e-commerce application which might require charging the customer’s payment method, reserving an inventory & adding an order record. In a typical monolithic systems these operations can be done in a transactional manner as we are generally dealing with a single database. But as we move to the world of microservices this becomes a big challenge. In this post I will try to explain the challenges involved in performing transactions around microservices & how the Saga pattern can help us in resolving those challenges. Lets dive in. Understanding the challenges with distributed transactions So lets set the stage. You have an e-commerce application where you are trying to perform the checkout by calling an API for order-service. A successful checkout requires following tasks to be done successfully: A record…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.