From Monolithic to Microservices — What Are Microservices?
Tags: microservices, monolithic
Published: 2020-06-05 17:00:00

## What is Monolithic Architecture?

The centralized nature of monolithic applications results in the lack of being able to scale applications independently, inter-application dependencies that hinder independent application development and deployment, reliability issues due to the centralized nature and the constraints on using diverse technologies for application.


![Example of Monolithic Architecture for an online retail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mlpuvv09bezn439tnlk8.png)
_Example of Monolithic Architecture for an online retail_

---

## What are Microservices?

The foundation of the microservices architecture is about developing a single application as a suite of small and independent services that are running in their own processes, developed and deployed independently.

![Example of Microservices Architecture for E-Commerce](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hq1v166ltgbkfrjmpohd.png)
_Example of Microservices Architecture for an online retail_

---

## Microservice Benefits & Liabilities

**Benefits :**
1. Agile and Rapid Development of Business Functionalities
2. Replaceability
3. Failure Isolation and Predictability
4. Agile Deployment and Scalability
5. Align with Organizational Structure

**Liabilities:**
1. Inter-Service Communication
2. Service Governance
3. Heavily Depends on Deployment Methodologies
4. Complexity of Distributed Data and Transaction Management

---

## Microservice Patterns

So what is a pattern? According to Richardson, it’s “a reusable solution to a problem occurring in a particular context.”

It’s the particular context that is important, he explained. “You don’t just blindly apply the same solution over and over again.”

Richardson broke down a pattern into seven characteristics:

- a name, which makes it easy to refer to
- a context also known as the solution
- a problem that you are trying to solve
- forces, which are issues or conflicts to address
- a solution which is described
- a resulting context, when is this pattern applied
- and lastly, related patterns

Related patterns can offer an alternative solution to the defined problem or a separate pattern format that requires you to consider alternatives, he said.

He said that when people look for solutions, they often don't think about the problems, but the pattern language forces you to do so.

> “When you apply this pattern, here are the issues that will come up, and here are the related patterns that will solve those problems.”

He said that this is what makes the structure of the pattern language. In addition to describing the benefits, it forces you to describe the downsides and the problems you have to solve.

![A pattern language for microservices based on Chris Richardson](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjy0liwtukstvepk4v5o.png)
_A pattern language for microservices based on [Chris Richardson](https://microservices.io/patterns/)_

The main goal of a pattern is to make processes easier, which is challenging to do with microservices' distributed architecture. You might need a set of discovery patterns because you need to know where other services are on the network. There are patterns for public interfaces, API gateways, and deployments, all of which help with these processes.

Requests can move from one service to another with the help of observability patterns. Troubleshooting patterns help with distributed tracing and log aggregation. Testing patterns offer testing services that can be used on their own, making testing easy, quick, and reliable.