Wednesday, September 29, 2021

Microservices

WHAT ARE MICROSERVICES:

A buzz world these days called Microservices are small, autonomous services that work together. Microservices are working on a principle which is called Single Responsibility Principle. 

Single Responsibility Principle

According to Rober C. Martin - "Gather together those things that change for the same reason, and separate those things that change for different reasons


Lets go back when Microservices architecture evolved. 

Many successful companies, such as Netflix, Spotify, Twitter, Amazon, or Linkedin started their business based on a monolith. This approach is known as Monolith first. Monolith is user base is small but as the system grows it starts becoming a pain in various ways. However,  all legacy applications to date were written as Monoliths first and were well written, tested code, regularly maintained and used over years effectively. 

Later, as these companies grew, began to offer more services, and focused on rapid development, they switched to a microservice architecture that better served these tasks.

Here is an example of a system which is created as a monolith. If you see, all the components are all together dependent on each other and forms a big block of software called Monolith architecture of a typical online retain application. 


 Business domain

All components are tightly coupled and dependent on each other. 


(Monolithic architecture)


Good stuff about Monolith (Advantages):


Bad stuff about Monoliths:


Evolution of SOA:


Good stuff about SOA


Bad stuff about SOA:


Evolution of Enterprise Service Bus (ESB):


Good stuff about ESB:


Problems with ESB:



Characteristics of Microservices:

Small, and Focused on Doing One Thing Well


 Benefits of Microservices:

  • Scalability
  • Availability
  • Resiliency
  • Flexibility
  • Autonomous: Develop, Deploy, and Scale Independently
  • Decentralized governance
  • Failure isolation
  • Auto-Provisioning
  • Continuous delivery through DevOps