This block of templates describes possible deployment options for the developed microservices.
Table of Contents
Deploying each service instance on its host (virtual or physical) is recommended when moving to a microservice architecture. The Service Instance Per Host pattern allows you to isolate service instances from each other, avoid version conflicts and resource requirements, make the most of host resources, and make redeployments easier and faster. The disadvantages of the pattern include potentially less efficient use of resources compared to deploying multiple instances per host.
Sometimes there are varieties of the described pattern that are most often used in practice: “Service Instance Per VM” and “Service Instance Per Container.” When using them, each service instance is packaged and deployed as a separate virtual machine or container, respectively.
The pattern allows you to deploy new versions of services as seamlessly as possible to users, reducing downtime to a minimum. This is achieved by running two identical production environments – nominally blue and green. Suppose blue is an existing active instance and green is a new application version deployed alongside it.
At any given time, only one of the environments is active, and it serves all production traffic. After successfully deploying a new version – with all tests passing and so on – traffic switches to it. In case of errors, you can always revert to the previous version.
This group of patterns is designed to improve the reliability of microservices architecture applications.
When microservices interact, situations are not excluded when, for some reason, one of the services stops responding. Repeated calls help to cope with temporary disruptions (slow network connection, temporary unavailability, etc.). However, repeated calls will only waste resources for more severe failures caused by a complete outage of service.
In such cases, it is recommended to use the Circuit Breaker pattern. The microservice will request another microservice through the proxy server. It counts the number of recent failures and, based on this, determines whether to allow subsequent calls or return an exception immediately.
A proxy server can be in three states:
Using a template improves resiliency and prevents cascading failures but requires careful configuration and monitoring.
The pattern got its name from the bulkheads used in shipbuilding: they protect the ship from total flooding in the event of damage to its parts. Similarly, in the architecture of the application: bulkheads isolate the elements of the application into pools so that if one of them fails, the rest will continue to function.
The pattern allows you to separate resources to ensure that the resources used to call one service do not affect the resources used to call another service. An example is using a separate connection pool for each of the downstream services.
Another use case for the template is to assign a separate service instance to each service client. In this case, if one of the clients makes too many requests by overloading its instance, the other clients can continue working.
Using this pattern prevents cascading failures and isolates critical resources but introduces additional complexity and less efficient use of resources.
Also Read: Data Management Patterns In Microservice Architecture
Unlock Audio Effortlessly With The Best YouTube Audio Ripper Tools Description: Discover how to use…
If you enjoy Dungeons & Dragons (D&D), you have come across many tools to improve…
The existence of several accounts in miscellaneous social networks allowed me to understand that one…
Introduction Access to new technologies and artificial intelligence has become vital in today's digital era.…
Google Chrome is the most used browser today due to its speed, reliability, and versatility…
Staying relevant in the dynamic digital environment is impossible. Besides influencers, small business owners, and…