Microservice and Containerization Patterns > Fundamental Microservice and Container Patterns > Micro Task Segregation
Home > Design Patterns > Micro Task Segregation
Micro Task Segregation (Erl, Naserpour)
How can data access functions be organized into micro tasks in order to preserve the granular functional scope of a microservice?
A range of required data access functions may be collectively too coarse-grained for encapsulation by a single microservice, thereby compromising its micro focus. Additionally, services that do not have permission may be able to update or change the data, which can result in data corruption or inconsistent data.
Related data access functions are categorized into micro tasks that are segregated and assigned to different microservices, depending on the type of function they perform.
A design approach is followed whereby a set of microservices is created to host the segregated micro tasks, each solving a distinct set of consumer requirements.
A design approach is carried out whereby the data access functions are separated into micro tasks that are then allocated to multiple microservices. This supports the application of the Micro Focus principle by preserving the single purpose scope of each microservice.
Commands and queries are sent to the database through the two fine-grained microservices.
This pattern is applied by focusing on the design of the microservice API, as explained in the complete pattern description.