In a microservices architecture, a single business operation often involves multiple services. Consider an e-commerce application where a customer places an order. The system needs to create the order, reserve inventory, process payment, and send a confirmation notification. Each responsibility belongs to a different microservice.
But who decides which service should execute next? And what happens if one of the services fails halfway through the process? These questions lead to two important approaches for coordinating business workflows across microservices: Choreography and Orchestration.
Both approaches allow multiple services to participate in a business process, but they differ in how the workflow is coordinated. Let's understand how they work, their trade-offs, and when to choose each approach.