You are on page 1of 8

MICROSERVICES Architecture:

Traditional Approach:

 It consists of single application. [3 tier architecture or Monolithic architecture]


 For scaling single application is cloned on multiple servers.
 Single deployment

Micro-services:

 It consists of multiple application


 Split/decompose applications into multiple services
 Then, deploy those services with multiple instances across multiple machines.

Advantages:

 Better density of hardware.


 Independently scale out one part of the application or the other.
 Can have different development team, that can work on one or the other Micro-services, or
can work parallel without impacting their deployment
 If required, only one Micro-service can be deployed rather then rest

MICROSERVICES Introduction:
Microservice Approach:

1. Each Micro-service must have its own data, could be any database: SQL, NOSQL, Mongo DB
etc.

Traditional Approach:

1. They can have different services running, but all services share the same data source/data
base. [Monolithic Architecture] unlike Microservice approach.

E-Shopping Application Example:


Key Patterns for Microservice:

- Will discuss details about what you need to build Microservice based application.

Explanation of points:

1. You have many micros services, and then how you are going to consume/communicate
them from client applications.
 Direct - consume directly from their web apps to your services
 API Gateway – put something in between web app and services like security/API
2. Health Check
 Checks health of API, Healthy means whether the data source or DB associated with
the Microservice is working or not (like: SQLserver is in working condition or not)
 Health Check acts as a Watch Dog for all Microservice.
 If Unhealthy don’t redirect them
3. Resilient Application
 There can be chances of transaction failure due to network issue. Our database may
fail to respond to the request.
 To avoid this, Use RETRY with exponential backoffs. This will ensure, will multiple
retries we may get the response from the data source.
 We need to set the limit for the RETRY. Once the RETRY goes more than limit, RETRY
is stopped and exception message is sent that Microservice is not ready. This is
known as CIRCUIT BREAK.

You might also like