What is the role of service orchestration versus choreography in microservices?
Short answer: workflow engine) coordinates the interactions between different microservices.
Explain a bit more
The orchestrator is responsible for directing the flow of operations and ensuring that services interact in a specific sequence. A payment processing system where a central service coordinates interactions between multiple services like fraud detection, payment gateway, and notification service. Service Choreography: In choreography, microservices interact directly with one nother, with each service knowing how to interact with others. There is no central controller; instead, each service follows a predefined protocol or contract. dvantages: More decentralized and flexible, making it suitable for dynamic and loosely coupled services. Reduced bottlenecks and no single point of failure.
Example code
In an order processing system, services (e.g., inventory, payment, shipping) emit events that other services subscribe to and act upon, without a central orchestrator.
Real-world example (ShopNest)
ShopNest splits Catalog, Cart, Order, and Payment into services so teams can deploy catalog changes without redeploying payments.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png