1 min read

Microservice Choreography vs. Orchestration

Microservice Choreography and Orchestration are two different approaches to designing and managing interactions between microservices in a distributed system.

Choreography

Microservice Choreography is an architectural approach where microservices communicate directly with each other without a central orchestrator. It promotes loose coupling, decentralizes control, distributes complexity, relies on asynchronous communication, and is event-driven. It's commonly used in scenarios like order processing, inventory management, and event sourcing, where services react to events or messages, making it well-suited for event-driven systems.

sequenceDiagram participant ServiceA participant ServiceB participant ServiceC ServiceA->>ServiceB: Event 1 ServiceB->>ServiceC: Event 2 ServiceC->>ServiceA: Event 3 ServiceB->>ServiceA: Event 4 ServiceC->>ServiceB: Event 5

Orchestration

Microservice Orchestration is an architectural approach where a central orchestrator or workflow engine coordinates interactions between microservices. It introduces tight coupling between services and centralizes the complexity of interaction logic within the orchestrator. Orchestration can involve synchronous and asynchronous communication/both event-based and non-event-based interaction, and workflows are explicitly defined. It's commonly used for long-running business processes like order fulfilment and approval workflows, which require centralized control and management of the workflow's sequence and conditions.

sequenceDiagram participant Orchestrator participant ServiceA participant ServiceB Orchestrator->>ServiceA: Step 1 activate ServiceA ServiceA->>Orchestrator: Step 1 Completed deactivate ServiceA Orchestrator->>ServiceB: Step 2 activate ServiceB ServiceB->>Orchestrator: Step 2 Completed deactivate ServiceB Orchestrator->>ServiceA: Step 3 activate ServiceA ServiceA->>Orchestrator: Step 3 Completed deactivate ServiceA Orchestrator->>ServiceB: Step 4 activate ServiceB ServiceB->>Orchestrator: Step 4 Completed deactivate ServiceB