Skip to main content

Micro Services, A Quick Introduction.

What is Micro Services.

By the name it is clear that we are talking about mini services which are able to perform their task independently. Micro Services follows micro service architecture instead of monolithic architecture. Whenever we say that application build on microservices architecture that means that this application is not dependent on one services but rather it is dependent on several many services. 

Whenever a request is made through application UI by the user then that application is calling different other services for fulfillment of the
single request. Lets us take small fictitious example of E-comm system that take the order from the customer, verifies its inventory and ships the order to the customer.

Fictitious E-Commerce System.

This system will perform several task such as.
  1.   Placing the order by customer.
  2.   Checking the inventory.
  3.   Shipping the order to the customer.
  4.   And and user interface to access this application.
Now, in normal monolithic architecture above all steps will be performed under single service but in Microservice above all operation will be decomposed into several small services which will perform independently. This decomposition can be done on basis of domain of business or services that business is performing or it may be other different use case. we will talk about decomposition in detail in our later posts. For our application we will be doing the decomposition on the basis of services its providing. Lets see the below picture to get clear picture.

Credit : microservices.io

Above picture clearly depict that 

  • Client can make access our application through Mobile or Browser.
  • Request coming from mobile will go to API Gateway and request from mobile will go to Webapp.
  • Request coming from mobile and web app will go required services like Account Service, Inventory Service and Shipping Service.
  • And each service will hit their independent databases.
From the above discussion we came to conclusion that MicroService Architecture can be defined as the architecture in which entire web application is decomposed to several loosely coupled and collaborating services with related functionality and independent databases.  

Here all component(Account Service, Inventory Service,Shipping Service and there respective databases) will interact together to process user request. All services may interact with each other using api calls.

Benefits of MicroService Architecture

  • Ease in Testing:  As services cover small independent function so it can be tested easily in less time.
  • Small Team : Each services can maintained and developed by PIZZA SIZE TEAM  means team with size 4-6 members. 
  • Ease in Training: New team member can be easily trained as he has to cover only small portion of the application.
  • Cross Functional Team: Team can learn other services easily and that will help in creating cross functional team.
  • Easy and Continuous Deployment:  As each services are independent therefore each service can be deployed easily without bringing entire application down. And that will help in continuous deployment.
  • More Productivity: As application is small then IDE used will be fast and will make developer more productive.
  • Easy Technology Upgrade: Services can be easily upgraded to new technology stack as only small portion of the entire application is to be upgraded. I.e only one service at a time is needed to be upgraded with newer technology without affecting the other services.
  • Improved fault Tolerance: If any service failed then it will not bring down entire application. Only that specific services will be impacted.
  • Easy Maintainability:  Maintaining entire application in one time is more harder than maintaining in small chunks.

Drawbacks of Microservices Architecture

Microservice architecture is not full prove but also comes with several drawbacks.
  • Extra Unit Testing Efforts: As services need to contact with other services to perform operation therefore developers have to develop a method to talk with other services.
  • Tough Implementation: Use cases of one service may include other services which will create development difficult.
  • Dependency Between Team: As services are dependent on other services therefore coordination between other teams needed to be made while developing the service.
  • Increased Memory consumption: As one monolithic application is decomposed into N services therefore N services instances are needed to keep the entire application up and running.


Comments

Popular posts from this blog

Routing in Angular 7

What you will learn after reading this post.What is Routing in Angular 7.Basic routing of component in Angular 7.Active link in routing in Angular 7.Wild card routing in Angular 7.Child routing in Angular 7.1. What is Routing in Angular 7? Whenever in normal HTML web page we click on a link we are navigated to specific page given in that link. When we are navigated then entire view of the application is reloaded again which cost resources and this type of application is not single page application. 

Creating Simple Hello World Application with SPRING BOOT

For creating a simple running web application with spring boot we do not have to do much. We just require to follow some simple steps and we are good to go. Unlike SpringMVC framework we do not. have to take care of all heck of configuration or XML file in one go we are all set with working mvc based web application.

Now we have to follow these steps.

Generate spring boot project from this url "https://start.spring.io/" You can do the same using STS setting to.Importing the project in STS.

Adding Spring-Security to Spring-Boot App

In the previous post we have created a simple spring boot application. This application was very simple application just getting request and showing page for requested URL. Currently all urls are open to all user that is we do not have any kind of authentication on the URL. Our spring boot application is like the open pool in which any one can come and start fishing. Now we want to secure our application so that only authenticated user will be able to visit secure part of the application. For this purpose we will be using the Spring Security. 
Scope of this tutorial. In this we will learn basic integration of spring security with spring boot.
NOTE: This tutorial will just contain only basic integration of spring security. If you haven’t gone through previous tutorial and you are the newbies to this spring boot then I will request you to go through previous post to get understanding of spring boot. 
Now lets get started with the configuration.If you do not have the previous code you can …

About Me

I am a self motivated full stack  developer. I have worked in many projects under several companies.
Java is one of my favourite language. Currently i am working with Tata Consultancy Services, Hyderabad. Tata Consultancy is my first company where i started my career on 24th Oct 2016.

Currently i am working on spring mvc in TCS but i also have a knowledge of Spring Boot, Angular, MongoDB. reqularly i am trying to add extra beauty to my profile. For this i believe in learn and unlearn strategy.

Reason for developing this blog is to show case my work and keep me busy during the weekends. Yahh! its true i have lot of free time on weekends as i don't have any girlfriend to waste my time with. And so i created this blog to show case my learning and work. Now, this blog gives me a goal to pursue and the way to keep me busy.

Through this blog i will try to share to all readers that i will be learning in course of time. I will try to keep this blog updated with latest evolution in develo…

Feature Modules in Angular 7

Feature Module Whenever we  create angular application we go on adding components to angular application. But as our application goes on increasing it become to much problematic to maintain such application. Every feature of our application is binded under single module which we call as app module. Which is root module of our Angular 7 application. While developing angular application without modularizing its features creates several problems  Application is not easily scalable.Application is tough to maintain.Application complexity makes it hard to understand. Solution Here feature modules comes for our rescue. Feature modules help angular applications to get modularised on basis of features present in our application. As our application grows we can divide our entire application in small feature using feature module. Feature modules helps in creating boundary that separates our specific functionality or say features. Feature modules communicates with other module or root module usin…

Decompose Monolithic Application To Microservices

How To Decompose Application into Microservices. After reading the previous two posts you all must be excited to implement microservice architecture to your application and that's good you should be ready to implement something new that might boost the application performance,  maintenance, scalability and will make your application future proof. But have you ever thought how will you be breaking your application into micro application i.e microservices. Think about it for some minute exercise your brain for some time before reading the below tutorial.

Now i am sure that you all might  have come through excellent ideas for breaking up your application in microservices. Please feel free to mention your valuable ideas in comment so that other or even me can be benefited by your ideas.

Now before breaking your application into micro-services you should consider following points.
Points to be considered before creating microservices.Your each services should be easily testable.Your a…