Most common micro-service services for Production Environment

Most common micro-service services for Production Environment post thumbnail image

This Article is only about the basic components that we can use for the Micro-service architecture and not about it’s benefits or the design pasterns, technologies that can used.

Most common micro-service architecture related components for production environment and how it works.

Many students having lots of doubt about components and the workflow while using the micro service architecture. Through out this article, I am trying to explain how these components are works interactively and what the basic services required to run a live system.

Monolithic to Micro services

Micro service is not just a simple architecture that we can explain in a simple way. Its a combinations of several technologies, methodologies which can bring lots of benefits towards your organizations such as

  • Cost Reduction
  • Speedup the releases (CI/CD)
  • Scalability
  • Availability
  • Visibility
  • Load balancing
  • Resiliency
  • ….

To make above possible, need to work with different type of Controls, Design patterns. MS is a system which is loosely coupled with each services and you can maintain each service differently without impact to others. According to the basic concept, that each service contain a single responsibility principle. Services and its behaviors may vary based on your system requirements, infrastructure and the scalability plan you have.

Basic Example: Lets say your company decided to provide your system As a service to your customers. While you designing the system, you can decide whether you treat all your customer requirement through a single service or, Separate service for each customer to cater their business logic.

We have the flexibility to design our very own system architecture based on the requirement by using the MS. Based on the system architecture, your system complexity may increases and it can impact to your system management process. To avoid these management issues, we can brings the different types of design patterns and the implementation mechanisms.

But the purpose of this article is understand the basic services that we have to use for a enterprise level solution.

When i am studying about micro services, i am always curious about; how these services are working towards the system and what services really necessary while implementing for a production system.

First of all I need to tell you that, this is not the only way that we can implement a micro-service based system and there are many more techniques can use for. But this is a very basic solution which includes only the necessary parts for the beginners.

How the System works with the Client

Gateway Service:

Clients make their request via the spring cloud gateway.
Request going through the following stages as:

  1. Gateway Handler mapping
  2. Gateway web handler (At this stage, request will going through a filter process. it can be before or after the Proxy service)
  3. Proxy request
There are several usages with Gateway:
  • Routing
  • Circuit Breakers
  • CORS (Cross Origin Resource Sharing)
  • proxy (Zuul)
  • ….
Annotations:
  • @EnableZuulProxy
Some Dependencies used by:
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
    <version>2.0.1.RELEASE</version>
</dependency>

<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-actuator</artifactId>
     <version>2.0.5.RELEASE</version>
</dependency>

Discovery Service (Spring cloud EUREKA)

One of the most impotent service among the micro service architecture. All the services register under this service and help to find the correct path among the requested service.

Two main methods:

  • Client Side (Chatty)
    • Client Request the URI
    • Discovery return the URI
    • Client call the server through the URI
  • Server Side
    • Client Request the URI
    • Discovery find and call the API and return the data

Spring Cloud uses the Client side discovery mechanism for the communication purpose.

Annotations:
  • @EnableEurekaServer
Some Dependencies used by:
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    <version>2.0.1.RELEASE</version>
</dependency>
<dependency>
    <groupId>net.logstash.logback</groupId>
    <artifactId>logstash-logback-encoder</artifactId>
    <version>5.3</version>
</dependency>


Configure Service

All the configurations related to each services and the common configurations which relevant to all the services are manage under this service. This service need to be up and running after the discovery service.
Each service calls it configurations through this service.

Example:
  • Database connections
  • Mail configurations
  • Login paths
Some Dependencies used by:
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-config-server</artifactId>
    <version>2.0.0.RELEASE</version>
</dependency>
<dependency>
     <groupId>org.springframework.cloud</groupId>
     <artifactId>spring-cloud-starter-config</artifactId>
     <version>2.0.1.RELEASE</version>
</dependency>
<dependency>
     <groupId>net.logstash.logback</groupId>
     <artifactId>logstash-logback-encoder</artifactId>
     <version>5.3</version>
</dependency>

System Service

Main purpose of the System service is to manage the user roles and the authentication process for the system. Once user request for a task, system service check for the user roles, passwords, Auth tokens related to the users.

Integration Service

Service help us to communicate with the 3rd part environment.

Example:
  • 3rd Party API’s
  • 3rd Party DB’s

Master service + Other services

All the other service including master data services are the services which used for the business logic.

Leave a Reply

Your email address will not be published. Required fields are marked *

6 + 1 =