MicrosoftTeams-image
MicrosoftTeams-image

MICROSERVICES

Microservice Architecture is a special design pattern where small services work together in service-oriented architecture. It focuses on decomposing an application into separate functional modules and interfaces. Each module can function independently and will get deployed on its own service. 

In this method, the large application is divided into smaller independent units. By combining all the microservices together, it constructs a big service. The most important feature of the microservice-based architecture is that it performs continuous delivery of a large and complex applications. 

If one microservice is changed, other services are not affected. These services will communicate with each other by using lightweight protocols such as HTTP or REST or messaging protocols. 

MONOLITHIC ARCHITECTURE: 

In Monolithic Architecture, all the components coalesce into a single module. Monolithic architecture is like a big container in which all the software components of an application are put together into a single package. 

Fig 1: MONOLITHIC ARCHITECTURE

MICROSERVICES ARCHITECTURE: 

Fig 2: Microservices Architecture

Microservice architecture contains fine-grained services and lightweight protocols. 

DIFFRENCE BETWEEN MONOLITHIC AND MICROSERVICES: 

Fig 3 : Difference between Monolithic and Microservices

FEATURES OF MICROSERVICES:  

1.Small focused. 

2.Loosely Coupled 

3.Bounded Context 

4.Neutral Language 

Microservices Tools: 

1. Wiremock 

2.Docker 

3.Hystrix 

ADVANTAGES OF MICROSERVICE ARCHITECTURE: 

1.Independent development 

2.Independent deployment 

3.Fault Isolation 

4.Granular Scaling 

5.Mixed Technology Stack 

6.Bug fixes and feature releases are more manageable and less risky. 

COMPANIES USING MICROSERVICES: 

1.Amazon 

2.Twitter 

3.ebay 

4.Netflix 

5.Paypal 

6.Uber 

BEST PRACTICES: 

1.Use Single responsibility principle .

2.Use asynchronous communication to achieve loose coupling .

3.To have a separate data store(s) for your microservice .

4.Separate build for each Micro service.

5. Proxy your microservice requests through an API Gateway .

6.Always treat- sever as stateless. 

EXAMPLE FOR MICROSERVICES FRAMEWORK FOR JAVA: 

1.Spring Boot 

2.Jersey 

3.Swagger 

DISADVANTAGES OF MICROSERVICES:

 1.Difficultly in managing large number of services. 

2.Complex testing over distributed environment and chances of failure during communication   between services. 

3.Network latency and load balancing are the two problems to be solved by the developers. 

4.Effective management and teamwork required to prevent cascading issues. 

5.Microservice is costly, because you need to maintain different server space for different business tasks. 

Scroll to Top