【Microservices】Orchestration and Choreography

Posted by 西维蜀黍 on 2019-01-06, Last Modified on 2024-05-02

Orchestration

Advantage

  • Easy to monitor the execution of workflows and handle task failures during workflow execution.

Disadvantage

  • May suffers from performance bottlenecks
    • all the data is indirectly passed between the services of the workflow resulting in unnecessary data-flows, consuming more bandwidth and hence weakening the performance of the workflow execution
  • Poor scalability
    • The overall performance of workflows reduces as the number of services and the volume of the data to be orchestrated in the workflow becomes larger.

Choreography

  • Does not depend on the central coordinator.
  • Achieves the composition by peer-to-peer communication between the services of the workflow
  • Transfer data directly between them without going through any central coordinator.
    • This direct data transfer between services consumes less bandwidth and thus provides performance benefits when data is intensive.

Advantage

  • More scalable than orchestration approach

Disadvantage

  • Difficult to handle provenance of data, monitor and handle components failures

Comparison

Factors Method
Orchestration Choreography
Composition Centralized Decentralized
Data movement Indirect/Centralized Direct/Peer-to-Peer
Monitoring Easy Difficult
Provenance Easy Difficult
Failure-handling Relatively easy Difficult
Scalability Not scalable Scalable
Single point of failure Possible Not possible
Implementation Simple and straight-forward Complex

Reference