Coordinating microservices
1. Coordinating microservices
One challenging aspect of using a microservices architecture is coordinating the communication between microservices. When you use a microservices architecture, you benefit from scalability, reusability, and ease of change. Each microservice is smaller and simpler to design than a monolithic application, but some complexity is shifted from the service to inter-service communications. Multiple microservices are often combined to form business processes. The coordination of the communication becomes a key aspect of the design of your application. There are two basic approaches to coordination in an event-driven architecture: service choreography and service orchestration. Service choreography has similarities to the choreography of a dance performance. When a dance is choreographed, the dancers are instructed how to perform the dance, but dancers are fully responsible for performing their parts during the performance. With service choreography, each service works independently. Each service is responsible for receiving and sending events asynchronously, typically following defined rules of interaction between services. The event structures that are exchanged between services are specified, and each service must generate and expect services in the correct formats. With choreography, services are loosely coupled, and can be created, changed, and scaled separately. One choreography challenge is that the business logic is distributed. A distributed application can be harder to understand because there's no central source of truth. Service orchestration is similar to an orchestra performance. Each musician in the orchestra knows how to play their instrument, but the conductor takes an active role during the performance to ensure that the musicians are synchronized. With service orchestration, each service performs its own tasks, but the central orchestrator controls all interactions between the services. Services do not need to know about or communicate with other services in the orchestration. As with service choreography, the services are loosely coupled, and can be created, changed, and scaled separately. Another benefit of orchestration is that it provides a high-level view of business processes which helps with understanding the application, tracking execution, and troubleshooting issues. Unlike the fully distributed services in the service choreography pattern, service orchestration has a single point of failure. If the orchestrator is not operable, the orchestrated processes cannot run.2. Let's practice!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.