After reading some articles on the advantages and disadvantages of micro service architecture (MSA), I would like to highlight other aspects that it presents for flexible orchestration, scaling control of cloud infrastructure, choreography - describing the interaction between multiple services and dynamic traffic management. ). The term "Microservice Architecture" has arisen over the past few years to describe a special way of developing software applications developed and deployed independently of each other. While there is no clear definition of this architectural style, there are certain common characteristics inherent to it: automated deployment and decentralized management of its components and data.
In short, this architectural style is an approach to developing a single application as a set of small services, each of which works in its own process and communicates with the services, often using the HTTP REST API. There is an absolute minimum of centralized management of these services, which can be written in different programming languages and use different data storage technologies.
Monolithic applications can be very successful, although more and more people feel extremely disappointed, especially when these applications are deployed in the cloud. After making a small part of the application changes, you need to rebuild the entire monolith and re-deploy it in the cloud. Over time, it is often difficult to maintain a good modular structure of the application, after a change that should affect only one module, which increases the overhead of maintaining the product.
Scalability: Flat vs 3D
Horizontal scaling (X-axis scaling) allows you to run only many instances of the entire application, and not the part of it that requires more resource, for the load balancer. If there are N copies of the application, then each copy handles 1 / N load. This is a simple and frequently used approach to scaling the application. One of the drawbacks of this approach is that, since each copy potentially has access to all the data, the caches require more memory to be efficient. Another problem with this approach is that it does not take into account the subsequent development and increase in the complexity of applications. ')
Vertical scaling - increasing the performance of each component of the system in order to improve overall performance. Scalability in this context means the ability to replace components in the existing computing system with more powerful and faster components as technology grows. This is the easiest way to scale, because it does not require any changes in the application programs running on such systems.
Parametric scaling (Z-axis scaling) - each instance performs an identical copy of the code. In this respect, it is similar to (X-axis scaling). The big difference is that each server is responsible only for its own subset of data. Some component of the system is responsible for routing each request to the corresponding instance. One of the routing criteria is usually the request attribute, another common routing criterion is the client type. (Z-axis scaling) has several advantages and is usually used for database scaling. Each instance deals only with its own subset of data. This improves the use of cache memory and reduces the use of I / O traffic, as well as improves transaction scalability, since requests are usually distributed across multiple instances. In addition, (Z-axis scaling) improves isolation of failures, since the failure of one instance leaves some of the data available.
Functional scaling (Y-axis scaling) unlike (X-axis and Z-axis), which consist of several, working identical copies of the application, the latter type of scaling divides the application into several different services. Each service is responsible for one or more functions, interacting with each other. There are several different ways on the functional decomposition of the application, but this is the topic of a separate article ...
Comprehensive application of all three types of scaling allows not only to solve problems of development and increase the complexity of applications, but also significantly improve the performance and efficiency of your infrastructure.
Service Orchestration and Choreography
Technologies that describe the behavioral model of the interaction of services, including a sequence of actions and relationships between different types of services that define a business process. There are two ways to build this process: orchestration and services choreography.
Orchestration is a single centralized executable business process (Orchestrator) that coordinates communication between different services. Orchestrator is responsible for invoking and merging services. Relationships between all participating services are described by one end point (composite service). Orchestration involves managing transactions between individual services. Orchestration uses a centralized approach to the composition of services.
The choreography describes the interaction between several services, while the orchestration represents control from the perspective of one of the parties. Choreography differs from orchestration by the arrangement of logic that controls the interaction between services. A choreography is a global description of the services involved, which is determined by the exchange of messages, the rules of interaction and agreements between two or more services, and uses a decentralized approach to the composition of the services.