Part 1 – Microservices Introduction

Microservices Introduction

Microservices

Introduction to Microservices

Monolithic Architecture

Before microservices evolved, all the web-based applications were built with monolithic architectural style. In a monolithic architecture, an application is developed and deployed as a single deployable war(Web ARchive) file. All the user interface, business layer and database are packaged together into a single war file and deployed to an application server. Please refer below diagram.

 
Untitled



While an application might be a deployed as a single unit of work, most of the time there will be multiple development teams working on the application. Each development team will have their own discrete pieces of the application they’re responsible for and oftentimes specific customers they’re serving with their functional piece.

Drawbacks of Monolithic Architecture

1. Whole Application Fails if single functionality fails
If any single application function or component fails, then the entire application goes down. Imagine a web application with separate functions including payment, login, and history. If a particular function starts consuming more processing power, the entire application’s performance will be compromised.
2. Scaling
Scaling monolithic applications such as the one described in the example can only be accomplished by deploying the same EAR/WAR packages in additional servers, known as horizontal scaling. Each copy of the application in additIonal servers will utilise the same amount of underlying resources, which is inefficient in its design.
3. Deployment
Every time an individual team needed to make a change, the entire application had to be rebuilt, retested and redeployed.

Microservices

a microservice is a small, loosely coupled, distributed service. Microservices allow you to take a large application and decompose it into easy-to–manage components with narrowly defined responsibilities. Microservices help combat the traditional problems of complexity in a large code base by decomposing the large code base down into small, well-defined pieces.

A microservice architecture has the following characteristics:

1. Application logic is broken down into small-grained components with well-defined boundaries of responsibility that coordinate to deliver a solution.

2. Each component has a small domain of responsibility and is deployed completely independently of one another. Microservices should have responsibility for a single part of a business domain. Also, a microservice should be reusable across multiple applications.
3. Microservices communicate based on a few basic principles (notice I said principles, not standards) and employ lightweight communication protocols such as HTTP and JSON (JavaScript Object Notation) for exchanging data between the service consumer and service provider.
4. The underlying technical implementation of the service is irrelevant because the applications always communicate with a technology-neutral protocol (JSON is the most common). This means an application built using a microservice application could be built with multiple languages and technologies.
5. Microservices—by their small, independent, and distributed nature—allow organizations to have small development teams with well-defined areas of responsibility. These teams might work toward a single goal such as delivering an application, but each team is responsible only for the services on which they’re working.

Source Code
Download source code of microservice with spring cloud from below git repository :

Lets go to our next tutorial where we will discuss

Part 2 – Scenario To Develop

In this tutorial we will understand below topics
– Scenario to develop in microservice architecture
– Create rest end points
PART 2 – MICROSERVICES WITH SPRING CLOUD : SCENARIO TO DEVELOP

Microservices Tutorial

Microservices Tutorial

Related Posts

Microservices Interview Questions