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
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
- Business Capabilities
- Continuous Delivery
- Decentralized Governance
- Independent Development
- Independent Deployment
- Fault Isolation
- Mixed Technology Stack
- Granular Scaling
Microservices with .NET Core
Why Microservices with .NET Core?
- Consistent across architectures
- Command-line tools
- Flexible deployment
- Open source
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
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
It will create the Docker-Compose.This docker compose use for running your application.
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”
After that you can run your Application you get the following output
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.