Orchestration:- decision logic should be centralized.

Orchestration is the process where multiple services which are taking part in transaction should be managed by a central authority.

Orchestration way is good for complex workflows which includes lots of steps. But this makes single point-of-failure with centralized controller microservices and need implementation of complex steps.

Central Service takes care of calling different services in the right order and if failure then it would know how to do compensation action between services that are already called.

The process is mainly used for the Synchronous operation.

In the Orchestration Saga design pattern, all decision is centralized.

Process

  1. A customer places an order.
  2. The next step is we need to take payment from the customer
  3. Deduct ordered products from the Inventory
  4. Shipping product to customer.

In this process, other services such as payment, Inventory, and shipping cannot make their own decision to process it here is the work of Orchestrator “Order Services” which will tell what step next to be taken.

As the Customer places an order, the order is created next step is calling the payment gateway API to make the payment as payment is done next step is calling the Inventory API to Deduct the order from the Inventory as we get a successful response, next we going to call shipping API for shipping product to customer.

In this process, if the shipping process fails then we need to call the 1st compensation service to add the item back to the inventory and the 2nd compensation service to revert payment to the customer.

By Saineshwar

Microsoft MVP for Developer Technologies | C# Corner MVP | Code project MVP | Senior Technical Lead | Author | Speaker | Love .Net | Full Stack developer | Open source contributor.