Abstract

The microservices architectural style is an evolution of the Monolith SOA (Services Oriented Architecture) architectural style. The difference between the SOA and microservice approach is how these are being developed and operationalized. With the addition of every new technology, our responsibility also increases to be abreast of pros-and-cons the new member has and the pain points it is designed to solve.

Monolith

Think of any MVC pattern-based API code base, where all your controllers and POJOs (Plain Old Java Objects) or POCOs (Plain Old C# Objects) were developed, built and deployed as a single unit, and for almost all the times a single data store was used for the enterprise. I.e. One database is housing all the tables for various responsibilities, for example, Customer, Payment, Order, Inventory, Shipping, Billing, etc. as shown in the logical architecture diagram below; i.e. all the various responsibilities are together.

Microservice Architecture ​ Microservice Architecture ​

Monolith Pros

Monolith Cons

Microservice

Gartner defines a Microservice as a "small autonomous, tightly scoped, loosely coupled, strongly encapsulated, independently deployable, and independently scalable application component."​ Microservice has a key role to play in distributed system architecture, and it has brought a fresh perspective.

Unlike monolith, a microservice strictly follows the Single Responsibility Principle (SRP) due to being tightly scoped around the business capability/domain for example Payment. Think of an MVC pattern-based API code base where a controller and POJOs (Plain Old Java Objects) or POCOs (Plain Old C# Objects) were developed, build and deployed for just one single responsibility i.e. business capability. This microservice architecture will then lead to having many such projects and each business capability having its own database.

Microservice Architecture ​ Microservice Architecture ​

Microservice Pros

Microservice Cons

Summary

Microservice and monolith architecture both have their pros and cons. Microservice architecture is not a silver bullet, but for teams that aspire to be digitally transformed and writing services with a product mindset, microservice architecture is certainly worth consideration.