MICROSERVICE WITH .NET

Overview

Hello devs, Today we would understand the concept of Microservice with .NET Core.

Sounds surprising right? In this blog we will understand what is a microservices and it’s features. But before understanding microservices, first you have to understand “ What is Monolithic?”.

If you want to develop an application, you can develop and publish it on serve, but when you want to scale up you application then you have to go on a cluster environment

But when some errors occur in code, then we can deploy the whole application and this type of application called Monolithic Application

For solving this problem Microservice comes

net_image1

What is Microservices?

Microservices also called Microservice Architecture is a collection of small modules and services. Each service and module are deployed individually and this modules communicate with each other.

Features of Microservices

  • Decoupling
  • Componentization
  • Business Capabilities
  • Autonomy
  • Continuous Delivery
  • Responsibility
  • Decentralized Governance
  • Agility
  • Independent Development
  • Independent Deployment
  • Fault Isolation
  • Mixed Technology Stack
  • Granular Scaling

Microservices with .NET Core

Why Microservices with .NET Core?

  • Cross-platform
  • Consistent across architectures
  • Command-line tools
  • Flexible deployment
  • Compatible
  • Open source

net_image2

Prerequisite for build Microservices with .Net Core

  • Visual studio 2017
  • .NET Core SDK
  • Windows 10 pro for Docker Installation with 64 bit windows
  • Docker for Windows
  • Docker Tools

Creating Application of Microservices with .NET Core

net_image3n

Check the checkbox right hand side panel “Enable Docker Support
And select from dropdown linux after that click Create

Now you want to right click on project name then select “Container Orchestrator Support” option

net_image4n

It will create the Docker-Compose.This docker compose use for running your application.

net_image5

Be careful before running your application, you must start your docker.
In this application you can create the small modules or services and you can run this service individually using docker. Before starting your application you want to check your port is same or not in “Dockerfile” or “docker-compose.yml”

net_image6

net_image7

After that you can run your Application you get the following output

net_image8

Conclusion

So friends, today we learnt about Microservices with .NET Core and How Microservices is working and Why microservices is useful. Also learnt why we use .NET Core with Microservices.

mm

Raju Giri Goshwamee .NET Developer

I am passionate about my technology. I am researching the latest technology in .NET. I like to challenge the complex problem. I am always ready for Learning new technology.

Comments are closed.

Top