1. What is MicroServices?
Microservices are an architectural and organizational approach to software development where software is composed of small independent services that communicate over well-defined APIs. These services are owned by small, self-contained teams.
Microservices architectures make applications easier to scale and faster to develop, enabling innovation and accelerating time-to-market for new features.
For more refer Microservices and Microservice Architecture.
2. Monolithic vs. Microservices Architecture
With monolithic architectures, all processes are tightly coupled and run as a single service. This means that if one process of the application experiences a spike in demand, the entire architecture must be scaled. Adding or improving a monolithic application’s features becomes more complex as the code base grows. This complexity limits experimentation and makes it difficult to implement new ideas. Monolithic architectures add risk for application availability because many dependent and tightly coupled processes increase the impact of a single process failure.
With a microservices architecture, an application is built as independent components that run each application process as a service. These services communicate via a well-defined interface using lightweight APIs. Services are built for business capabilities and each service performs a single function. Because they are independently run, each service can be updated, deployed, and scaled to meet demand for specific functions of an application.
3. Characteristics of Microservices
Each component service in a microservices architecture can be developed, deployed, operated, and scaled without affecting the functioning of other services. Services do not need to share any of their code or implementation with other services. Any communication between individual components happens via well-defined APIs.
Each service is designed for a set of capabilities and focuses on solving a specific problem. If developers contribute more code to a service over time and the service becomes complex, it can be broken into smaller services.
4. What do you understand about Autonomous of a MicroService?
A MicroService is
- Independent of other services,
- Easier to deploy,
- Maintain
- Can be developed by a small team or one member.
- If anything goes wrong with a MicroService it does not cause system failures since the MicroServices are autonomous.
5. What do you understand about the Cohesive of a MicroService?
Cohesion is the way to identify how to group related functionalities if they are part of the same domain and how to break apart or delegate to different MicroService if the functionality belongs to a different domain boundary.
A high cohesive MicroService follows a single responsibility principle as It implements or group relation functionality and independent functionality is developed by other MicroService.
For more visit Identify domain model boundaries and MicroServices Properties.
6. What is Bounded Context?
Bounded Context is a pattern that is used in DDD - Domain-Driven Design. It's a part of DDD and deals with large domain models. Domain model is an object model which incorporates both data and behavior. DDD deals with these large domain models by dividing them into Bounded contexts. In other words, One MicroService is implemented for one bounded context or one domain model. For more visit - BoundedContext.
7. What is Domain-Driven Design? Or MicroService is DDD specific?
DDD (Domain-Driven Design) means - designing an application based on models of underlying domain. A model consists of both data and the behavior of the domain. MicroServices are DDD specific, means - One service is responsible for the implementation of one domain-model.
For example, there are two domain models Sales and Support then DDD will deal with this situation by dividing these models into two bounded contexts. Hence you need two explicitly interconnected MicroServices for these two different bounded contexts.
8. MicroServices are technology agnostic. Explain it.
In MicroServices architecture, MicroServices can be developed using any tech stack such as Java, .NET, Node.js, any hardware or software which best fits to the requirement.
9. What are the benefits of MicroServices?
MicroServices Architecture offers many benefits because of its characteristics.
Microservices foster an organization of small, independent teams that take ownership of their services. Teams act within a small and well understood context, and are empowered to work more independently and more quickly. This shortens development cycle times. You benefit significantly from the aggregate throughput of the organization.
Microservices allow each service to be independently scaled to meet demand for the application feature it supports. This enables teams to right-size infrastructure needs, accurately measure the cost of a feature, and maintain availability if a service experiences a spike in demand.
Microservices enable continuous integration and continuous delivery, making it easy to try out new ideas and to roll back if something doesn’t work. The low cost of failure enables experimentation, makes it easier to update code, and accelerates time-to-market for new features.
Microservices architectures don’t follow a “one size fits all” approach. Teams have the freedom to choose the best tool to solve their specific problems. As a consequence, teams building microservices can choose the best tool for each job.
Dividing software into small, well-defined modules enables teams to use functions for multiple purposes. A service written for a certain function can be used as a building block for another feature. This allows an application to bootstrap off itself, as developers can create new capabilities without writing code from scratch.
Service independence increases an application’s resistance to failure. In a monolithic architecture, if a single component fails, it can cause the entire application to fail. With microservices, applications handle total service failure by degrading functionality and not crashing the entire application.
10. What do you understand about Resiliency in MicroService Architecture?
- Resiliency refers to the ability of a service to recover from failures and continue to function in previous state.
- It does not mean to avoid the failures but accepting the fact that there should be minimal data loss and downtime.
- The Primary goal of resiliency is that a system or application should return to a fully functioning state after a failure.
- You should design your systems to be resilient to partial failures like Network outage, VMs crashes which will certainly occur eventually.
For more visit Resiliency in MicroServices.
11. What are key Principles of MicroServices?
MicroService design has IDEALS Principles similar to Object oriented design has SOLID principles.
- I - Interface Segregation Principle
- D - Deployability (is on you) Principle
- E - Event-Driven Principle
- A - Availability over Consistency Principle
- L - Loose-Coupling Principle
- S - Single Responsibility Principle
- For more about it you can refer Microservice design Principles - IDEALS
No comments:
Post a Comment