“A microservice architectural style is an approach to developing a single application as a suite of small services.” — Martin Fowler.

First, we will find out what is Monolithic Architecture. Therefore, I will show you how to modify its domain to be ready for Microservice Architecture. In the end, I will briefly tell you the basics of Microservice Architecture and judge its pros and cons.

Monolithic Architecture

Monolithic Architecture is every non-vertically divided architecture. Vertical division in software design means splitting the application into more deployable units. This does not mean that monolith can’t be horizontally divided into layers.The adjective monolithic refers that the architecture of software consists of one backend unit. I am saying backend because I believe that monolith can have more than one UI like web and mobile and still stay monolithic.

Image for post

Monolithic Architecture

Communication between components is happening mostly by the method invocation. If your frontend and backend are physically divided into, for example, API and web client, then it is still a monolith.Until you divide the backend into more deployment units, you are still using Monolithic Architecture in my eyes.

Single Domain Model

“A domain is the targeted subject area of a computer program. Formally it represents the target subject of a specific programming project.” — Wikipedia

In my words, the domain is the thing why software exists and is about. I wrote ore about the domain in 3 Domain-Centric Architectures Every Software Developer should Know article.This is a visualization of part ripped from the online shop’s domain.

Image for post

Single-Domain Model

Sales and Catalog subdomains contain the single Product entity. This leads to more concerns in one place, which is always not good. It is a violation of the Separation of Concerns principle.Forcing one entity for more concerns does not feel right. The entity contains unused properties in both contexts. Sales don’t need to know the product’s category, and the Catalog doesn’t have any usage for information on how the product was delivered to the customer.To avoid this problem, we need to find Sales and Catalog contexts’ boundaries to split them apart. This leads us to a Bounded Context.

#microservices #monolith #developer

From Monolith to Microservices in 5 Minutes
12.50 GEEK