Microservice Patterns | Design Patterns | Microservice Compositor


Microservice and Containerization Patterns > Interchange Patterns > Microservice Compositor
Home > Design Patterns > Microservice Compositor

Microservice Compositor (Erl, Naserpour)

How can a microservice encapsulate composition logic while still retaining a fine-grained functional scope?

Microservice Compositor

Problem

Due to its micro task functional scope, a microservice may not be able to encapsulate the composition logic required to complete an entire business task, even though performance requirements may dictate that such logic be carried out by a microservice.

Solution

A microservice compositor is utilized to compose microservices at runtime to collectively complete a greater task. The microservice compositor can be comprised of a set of specialized microservices, allowing each to preserve its micro task functional scope.

Application

The specialized microservices that comprise a microservice compositor contain the logic necessary to compose other microservices and aggregate and return the collective result to the service consumer.

A microservice compositor comprised of one or more fine-grained microservices is utilized to carry out the composition logic. Composition-related tasks are delegated to the compositor microservices, each of which can also have its own dedicated database and scale independently.

Microservice Compositor: The microservice compositor composes Microservices A, B and C to complete a business task. In this scenario, the service compositor resides in its own container. 

The microservice compositor composes Microservices A, B and C to complete a business task. In this scenario, the service compositor resides in its own container.

This pattern can be applied by custom-designing the compositor microservices, as explained in the complete pattern description.


Module 10: Advanced Microservice Architecture & Containerization.

This pattern is covered in Module 10: Advanced Microservice Architecture & Containerization..

For more information regarding microservice and containerization courses and accreditation,
visit the Microservice Architect Certification program page..