[Fireside chat] orchestration and choreography with Laila Bougria & Udi Dahan
Aug 1, 2023
auto_awesome
Event-driven architecture experts Udi Dahan and Laila Bougria discuss the challenges of coordinating work in event-driven architectures. They explore the differences between orchestration and choreography, the types of events and their contexts, evolving contracts in a message system, observability tools, and the role of SLAs. They emphasize evaluating the entire workflow and the necessity of each step in complex workflows.
Orchestration involves a central component responsible for coordinating workflows, while choreography is decentralized and relies on events in systems with looser coupling.
When choosing between orchestration and choreography, it is crucial to consider the specific workflow, failure conditions, and the complexity of compensation process.
Decoupling and defining proper bounded contexts are crucial in choreography to avoid entanglement and simplify understanding of system behavior.
Deep dives
Understanding Orchestration and Choreography
Orchestration involves a central component that takes responsibility for the entire workflow, ensuring that the right services are called based on prerequisites. In orchestration, commands are used to instruct services, and events are used to publish that an event has occurred. On the other hand, choreography does not have a central orchestrator. Services in a choreography style react to events and work in a more decentralized manner, with each service playing off and reacting to each other. Choreography relies more on events and is typically seen in systems with looser coupling, while orchestration is used in more tightly coupled systems.
Considerations for Complex Workflows
When dealing with complex workflows that involve compensating failure recovery paths, the choice between orchestration and choreography depends on several factors. It is important to distinguish between technical and business workflows, as well as partitioning and layering the workflow to avoid monolithic designs. In cases where the workflow involves transferring money between accounts, for example, orchestration with compensation steps may be appropriate. However, real-world scenarios often have additional complexities and exceptions that complicate the compensation process. Therefore, a holistic approach that considers the specific workflow and its failure conditions is necessary.
Managing Decoupling in Choreography
Decoupling is a significant advantage of choreography, but it can become challenging to manage when there are numerous microservices involved without clear boundaries. To avoid the entanglement of choreography, it is crucial to define proper bounded contexts, ensuring that microservices are within logical domains and have high autonomy. A well-defined bounded context allows for cleaner choreography-based interactions and simplifies understanding the system's behavior. Observability tools like Service Insight and OpenTelemetry can aid in visualizing the flow of events and interactions, allowing teams to navigate complex choreographed systems and prevent the anti-pattern of an umbilical cord coupling.
Evolving Events and Payloads
When developing applications, new concepts and features may emerge over time, impacting existing payloads within events. To mitigate the challenges associated with evolving messages, it is recommended to limit the amount of data contained in events. Micro front-end UI composition, view model composition, and vertical slice architecture can help in managing data within bounded contexts and minimizing the need for versioning events.
Orchestration vs. Choreography
When dealing with complex workflows, the choice between orchestration and choreography depends on various factors. Orchestration is more suitable when adding steps to the workflow is easy, as it serves as a central point of control. Message-based orchestration, where requests are stored in a message queue, improves robustness. However, choreography may be preferred when alternative flows need to be invoked separately from the main workflow. Considering SLAs is essential, as choreography may make it harder to track and enforce time constraints in complex business transactions.
When building event-driven architectures, one of the challenges we face is coordinating work across many services. How do we implement complex data flows or complex business transactions that consist of multiple asynchronously executed steps? Luckily, there are patterns that can help us manage this complexity: orchestration and choreography. Join us in this fireside chat with Udi Dahan and Laila Bougria as we discuss how each pattern works, the pros and cons of each, and the trade-offs involved when choosing one over the other in specific contexts. See you there!
Get the Snipd podcast app
Unlock the knowledge in podcasts with the podcast player of the future.
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode
Save any moment
Hear something you like? Tap your headphones to save it with AI-generated key takeaways
Share & Export
Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode