Microservices

History
Before if we wanted to start an application, we had to buy servers and then install applications on servers.
This was a time and cost-consuming process. It is also difficult to manage these many servers.
Then came virtual machines where we could allocate space, memory and CPU usage based on our requirements.
As time proceeded, containers came into usage here the application was given an isolated environment where we could run our applications.
Configuration Management
It is the process of maintaining the system in its desired state.
Today's applications are based on immutability.
Consider the application to be ' Whats App', there are many changes or advancements which happen in an application, imagine whenever these changes are being deployed, the application stops running. This creates a chaotic scenario.
Monolithic Architecture
The whole code of an application is a single unit.
Consider a shopping application, there are many units in it like products, shopping cart, payment, menu bar, user, trending stats and many more.
Everything was developed, deployed and scaled as a single unit.
So when this development process is happening, people working on different groups have to be coordinated so that the functionality on which the other group is working does not get affected.
This used to be the standard way to develop an application before.
Challenges of Monolithic Applications
The application tends to be very large and complex.
Scaling the whole application is the only way possible instead of a specific service.
When there is a bug present in any module of the application, this issue brings down the entire application.
High infrastructure costs
So we move on to MICROSERVICES.
In simple terms, we break down the entire application into smaller and independent services.
This split of the application into smaller modules is based on business functionalities but not on technical functionalities.
Each microservice does one specific job.
Consider the example of a Shopping app: products, shopping cart, payment etc. Each module is self-contained and independent. This also means that they are developed, deployed and scaled separately. This is also known as loose coupling.
A basic application has - Frontend, Backend, Chat messaging, Database, and Networking. Consider a scenario where we have to change the front end of an application into a better version.
After making the change in the front end to a better version, in monolithic applications, for the changes to be observed by the user we have to deploy the whole application again completely which even includes the other modules in which changes were not made.
When we divide the application into smaller modules, all the modules become independent microservices. Here, we deploy each module separately.
This makes it an efficient approach and the application will not face downtime when the changes are being made.
But if it is a large application, then there will be many microservices to be managed.
Orchestration
- It is a process where managing and coordination of individual microservices happens dynamically.

There are many tools which help in doing this functionality like:
Kubernetes ( created by Google)
Azure Kubernetes Service (AKS)
ECS (Amazon Elastic Container Service)
Conductor ( It is created by Netflix).
Facts on Microservices!
Each microservice has a separate codebase
Each microservice can be developed, deployed and scaled separately.
Each microservice has specific functionality in the whole application.
Services are communicated to each other via API.
They have the flexibility to use different programming languages and frameworks to build other microservices.



