Microservices Design Patterns - Overview



Microservice is a service-based application development methodology. In this methodology, big applications will be divided into smallest independent service units. Microservice is the process of implementing Service-oriented Architecture (SOA) by dividing the entire application as a collection of interconnected services, where each service will serve only one business need.

The Concept of Going Micro

In a service-oriented architecture, entire software packages will be sub-divided into small, interconnected business units. Each of these small business units will communicate to each other using different protocols to deliver successful business to the client. Now the question is, how Microservice Architecture (MSA) differs from SOA? In one word, SOA is a designing pattern and Microservice is an implementation methodology to implement SOA or we can say Microservice is a type of SOA.

Following are some rules that we need to keep in mind while developing a Microservice-oriented application.

  • Independent − Each microservice should be independently deployable.

  • Coupling − All microservices should be loosely coupled with one another such that changes in one will not affect the other.

  • Business Goal − Each service unit of the entire application should be the smallest and capable of delivering one specific business goal.

To apply these principles, there are certain challenges and issues which must be handled. Microservices Design Patterns discusses those common problems and provides solutions to them. In coming sections, we'll discuss the problems and the solution using the applicable design pattern.

Design Patterns relevant for Microservices are grouped into five major categories.

  • Decomposition Design Patterns − A application is to be decomposed in smaller microservices. Decomposition design patterns provides insight on how to do it logically.

  • Integration Design Patterns − Integration design patterns handles the application behavior in entirety. For example, how to get result of multiple services result in single call etc.

  • Database Design Patterns − Database design patterns deals with how to define database architecture for microservices like each service should have a seperate database per service or use a shared database and so.

  • Observability Design Patterns − Observability design patterns considers tracking of logging, performance metrices and so.

  • Cross Cutting Concern Design Patterns − Cross Cutting Concern Design Patterns deals with service discovery, external configurations, deployment scenarios etc.

Advertisements