The first step in understanding Microservice Architecture

Spandan Pyakurel
3 min readApr 27, 2021

I am writing this blog to introduce you all to the concept of microservice architecture. Let's begin by understanding monolithic architecture first.

In a monolithic architecture, the app has a single code base with multiple modules that are dependent upon each other and a common database.

Monolithic Architecture

According to Martin Fowler, “Microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.”

Microservice architecture

We can understand from the definition as well the diagram that microservice architecture divides the application into loosely coupled, independently developable, and deployable services. Each service has its private data, business logic that is loosely coupled with other services, service protocols, and network boundary. The interaction between services is essential as the services altogether give the picture of the application itself. Communication between services can occur through either synchronous or asynchronous protocols. Synchronous communication like HTTP allows the real-time communication necessary between services. Whereas, asynchronous communication like message broker, webhooks allow the service to communicate with other services through events asynchronously. These communication protocols ensure flexibility to the services as they can be implemented in any language.

There are several advantages associated with the implementation of microservice architecture. Some of them are described as:

  1. Isolation

Services are isolated in terms of business logic, data, presentation layer, network layer, security. Hence, the failure of any of the services doesn’t affect the application as a whole as it would if the application wasn't divided into microservices.

2. Independent Scalability

Each service can be scaled according to the requirement of scalability. In the figure above, service 4 has the highest demand of being scaled, and hence its 4 instances are running. Whereas, service 3 has the least demand of being scaled, and therefore only one instance of the service is running. This has been possible due to the implementation of microservice architecture.

3. Flexibility

The separation of the application into independent service has led to flexibility, where each service can be developed in whatever language and framework are convenient and required.

4. Independent team collaboration

Each service in the microservices can have a different team required for development, testing, deployment, and support purposes. This is helpful, where the application is big and a huge team is unable to collaborate and work together.

Having introduced to the definition and advantages of the architecture, there is more to microservice architecture. This is just the beginning. I hope it gave you a basic understanding of what it is and what it can offer.

--

--