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.

Challenges

We can overdo this pattern.  It is like many where we want to use bricks for our solution, not sand.  There are problems that do not need to be reduced to smaller parts.  Once we hit that level, create the service and declare victory.  However, we need to be cognizant of the resources required for our services and ensure they do not rise above the level of “micro.”  We want a solution of small steps, but not too small.

Rob Broadhead

Rob is a founder of, and frequent contributor to, Develpreneur. This includes the Building Better Developers podcast. He is also a lifetime learner as a developer, designer, and manager of software solutions. Rob is the founder of RB Consulting and has managed to author a book about his family experiences and a few about becoming a better developer. In his free time, he stays busy raising five children (although they have grown into adults). When he has a chance to breathe, he is on the ice playing hockey to relax or working on his ballroom dance skills.

Leave a Reply