liveBook · Manning

Orchestration service

As explained in Microservices Patterns, Second Edition

An orchestration service is a service that executes saga orchestration by persisting saga state, making participant requests, and retrying failed executions.

A separate orchestration service acts as the system command’s entry point and invokes saga participants synchronously or asynchronously. It can implement sagas for a domain. section 10.2.3

Choose between a separate service and embedding the orchestrator in a participant:

  • Separate the orchestrator to simplify participants and reduce their design-time coupling, accepting another service and greater runtime coupling. section 10.2.3
  • Embed it to reduce service count and sometimes runtime coupling, accepting extra responsibility and possible design-time coupling in the entry-point participant. section 10.2.3

With HTTP request/response, the orchestrator persists saga state and retries after communication failures. Participant endpoints can use idempotency keys to detect duplicate requests and resend the original response. section 10.2.5

Figure 10.11 There are two possible locations for a saga orchestrator. The first option is to have a separate orchestration service. The second option is to embed the orchestrator in one of the participants. Each option makes different trade-offs that affect design-time coupling, runtime coupling, and architectural complexity.
orchestrator location options

Compare the separate-service and embedded-participant placements and their coupling and complexity trade-offs. section 10.2.3

How Microservices Patterns, Second Edition covers it

How deep it goes
Details placement trade-offs, messaging components, HTTP state transitions, persistence, and retry handling.
Examples
Uses the Create Order Saga, including an Order Service orchestrator and HTTP calls to participants.
What it assumes
Assumes a saga with participants and a system command entry point; does not establish these concepts from zero.
What you can do after
Evaluate whether to separate the orchestrator or embed it by weighing service complexity and coupling.
How it connects
Connects saga orchestration with saga participants, asynchronous messaging, synchronous request/response, and REST endpoints.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.