In this section, we are going to do hands on lap, which is the saga pattern for orchestrate distributed
transactions using a step functions.
So let's start with fundamentals of this section.
Topic with remembering microservices and communications is enough that microservices are organized around
business capabilities with a separate database per microservices.
Microservices are loosely coupled and they use asynchronous messaging to communicate with each other.
Microservices are independently deployable.
So let's think microservices on ecommerce domain, you can see the image on the slide.
Basically, this is the order fulfillment process and we will implement these order fulfillment process
with orchestration using a list step functions.
Let me explain the steps.
One by one, the customer is placed an order using frontend channels and API gateway invoke to order
microservices and the order fulfillment process is started.
So order is going to check if the item is available in the inventory or not.
If the inventory is available, it is basically the dock item in the inventory database and it calls
the payment microservices.
If the payment is successfully done with third party integration, it starts with the delivery microservices.
And when the delivery is done, the order status will be completed.
If one of these steps are not successful, it should be rolled back the steps and return back to the
previous status.
For example, we should return back to the inventory database table and we should return back to the
payment microservices and order microservices and so on.
And we will set the status as a fail status.
So all these rollback statements should be handled by the orchestrator.
So how we can set up these workflow in microservice architectures of course with using saga pattern.
So now it is good to understand what is a pattern.