Microservices:
Devepoment Process Application Architecture Deployement and Packaging Application Infrastructure
Waterfall->Monolithic-> Pysical Server->Datacenter
Agile->N-Tier->Virtual Servers->Hosted
DevOps->Microservices->Containers->Cloud
Introduction:
A microservice is a small unit that has only one responsibility or single logic which solve a specific problem.
.Microservice are small & independent services that work together to build highly automated, independent and evolving software.
.Each Microservice can be deployed independently.
.All services don’t need to share the same technology stack,libraries,or framework.
Microservices Principle:
* Modelled Around Business Domain.:
Separate Sytem capability into different domains and each domain will focus on one thingand its associated logic.
*Culture Of Automation.:
Follow the cultural of automation by designing it for continues integration and continues delivery.
*Hide Implementation Details.:
Hiding the internal details to reduce coupling and helps to do changes and improvement without affecting the overall architecture.
*Highly Observable.:
The service should collect as much informationto analyze what is happening within each of them like log evemts and stats.
*Decentralise All The Things:
There is no centralized database,usually each service is designed to manage its own database.
*Isolate Failure:
The impact of a failure is less in microservice architecture comapres to monolithic type as it will only affect that particular service and its associates.Other services can keep running.
*Deploy Independently:
Each service can be deployed independently.
When to use Microservices Architecture:
.Large application that require a high release velocity.
.Complex application that needs to be highly scalable.
.Application with rich domains or many subdomains.
.An organization that consists of small developement team.
Advantages of Microservces:
.Language independent and framework independent.
.independently develop,deploy,redeploy,version and scale component service in seconds without compromising the integrity of an application.
Better fault isolation keeps Other services to work even on failure.
.Zero downtime upgrades.
.Services can be of from different servers or even from different datacenters.
.reliable and self healing.
.Support continuos integration and delivery.
.Easy to integrate with third parties.
Challenges of Microservices:
Complexity: A microservice application is more complex as compared to the equivalent monolithic application.
Developement and Testing: Building and testing a service that relies on other services need domains understanding and refactoring them can be difficult.
Lack of governance: The decentralized approach to building microservices has advantages, but it also lead to so many problems like maintenance because of any different languages and frameworks.
Network congestion and latency-The use of many small, services can result into additional latency because of interservice communication and a long chain of service dependencies, So design API’s carefully and use asynchronous communication patterns.
.Data integrity: Each microservice is responsible for its own data persistence. As a result, data consistency can be challenge.
Management: To be successful with microservices requires a mature DevOps culture. Correlated logging across services can be challenging for a single user operation.
.Versioning :Be-careful while updating a service. It must not break services that depend on it. So without careful design, you might have problems or forward compatibility.
Skillset:
Microservice are highly distributed systems, So need a skilled and experience team to implement it.