DEV Community

Heru Hermawan
Heru Hermawan

Posted on • Edited on • Originally published at Medium

From Monolithic to Microservices — What Are Microservices?

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
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
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
A pattern language for microservices based on Chris Richardson

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.

Top comments (0)