Microservices architecture (MSA)

The MSA aims to solve the problems that were present in the monolith design. A microservice is an efficient and flexible approach to building an application. This splits the application being developed into small services that can exist independently, and each service has its own life cycle. Each microservice is responsible for a single functionality only. Consequently, the service's focus is only on doing this and doing it well.

A typical MSA looks like the following:

As shown in the preceding diagram, the application is composed of small services, each responsible for one functionality and each having its own store. Building, deploying, or upgrading services will have its own life cycle and these services exist independently of each other in the application, interacting with each other over the REST.

Here is a typical deployment model:

As shown in the preceding diagram, microservices each have their own database deployed and exposed as REST services. The number of service instances may vary from one service to another based on usage patterns. For example, we can deploy three instances of authentication service as it may be used more frequently, and two instances of each identity and notification service. The Load Balancer will be brought in to route the requests properly to these service instances as appropriate. An API Gatewayservice level agreement (SLA), is also provided, which uniformly receives external requests, performs load balancing to invoke the backend service, and returns the results to the clients. It also performs some basic validation to prevent attacks and to decouple the exposed microservices from the consuming client. Any client (such as a mobile or web app) can use the APIs exposed over the API Gateway. This is a typical deployment model that may vary based on business needs and available infrastructure.

This is how the microservice architecture makes the application development more efficient and more manageable.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset