We come to one of the best patterns for breaking a big problem down into bite-sized pieces. The microservices architecture pattern is a perfect fit. The objective is to farm out work to one or more services that are small and well-defined. This pattern is one that has grown in popularity and is often seen in Cloud solutions.
The Microservices Architecture Pattern Defined
The architecture is another one that has three primary components. There are client requests, an interface layer, and service components. Likewise, the microservices architecture is another distributed pattern that allows the solution to grow as needed.
In general, requests are directed to services via the interface layer. That layer also can bundle or roll up responses so any request becomes a series of microservice requests. For example, we can split up reading from a file into a service that gets data, another that parses the data, another that does validation or computations. Finally, one that formats the results for output. We keep the services as small units of work that are well-defined and have a large number of uses.
Applying The Pattern
As noted, this is another distributed pattern. We take the problem and split it into small units of work. In this case, the small is micro and gives us the name. We gain the benefit of having a worker that is able to solve a general problem. Thus, we can re-use the workers and not only the source code. That can be a huge productivity increase. Likewise, we can create tight and high-quality workers that provide a foundation that rarely changes or needs updates.