Microservices: Orchestration vs. Choreography

Sachin Gupta
2 min readJul 9, 2021

--

Choreography Pattern

Applying a choreography pattern means that one service doesn’t talk to another service in order to instruct an action. Instead each service is observing its environment and acts on events autonomous.

Choreography

In real live this implements pub/sub model. Services are connected to a message bus say Kafka and subscribe channels they are interested in. Once an event series occurs that matters of the service, the service performs the appropriate action. This way system is loosely coupled, and it is easy to add new services to the architecture.

The cons are that you must make sure that services emit the events that new service requires & adding additional events or extending payload of existing event won’t break existing logic. Also, it is very difficult to trace which service failed and why?

Choreography offers asynchronous architectures that offer more resilience at scale, but they are also harder to debug.

Orchestration Pattern

Orchestration design pattern on the other hand provide more declarative approach focusing on centralized application workflow. For long-term scalability, Orchestration is just one of many architectural patterns for distributed systems.

Orchestration

In an orchestration driven architecture, transactions are translated directly into workflows, which are identified and managed by an orchestrator system. microservices trigger the orchestrator to execute the steps of workflows. The orchestrator manages payload construction, transformation and protocol interoperability.

Orchestration focuses on synchronous architecture that offers more flexibility around builds and changes but does so at the expense of high concurrency and throughput. Orchestration supports self-healing and regulation of load, better support of Observability.

To ensure that orchestration design fits well in a distributed architecture, the orchestrator must have characteristics like stateless for linear scaling, persisted data store for workflow payloads, sharding for high throughput, archival policy to prevent data loss.

--

--

Sachin Gupta
Sachin Gupta

Written by Sachin Gupta

20+ years of software design and development experience in .Net Core, AWS, GCP, Docker, K8S, NodeJS in multi-million-dollar products in Europe, USA & India.

No responses yet