Advantages and disadvantages

In the modern economy, the creation of software (software) is an entire industry that, on the one hand, helps businesses automate and digitalize all processes, and on the other hand, independently generates profit and creates virtual assets. At present, designing in the field of R&D has become more complicated, the number of programmers is constantly growing, and the tasks for them are becoming more and more complex. These reasons have led to the emergence of new software development methodologies and types of architecture.

Modern web applications are multifunctional, and the digital transformation that is happening now with many businesses is increasing the requirements for software. The application should be: easily scalable, flexible and cross-platform, quickly changeable for user tasks. These requirements are set by task managers already at the stage of developing such software.

To create software that meets all the requirements of modern business, you must first seriously study the software development process itself and choose the right architecture.

Choice of architecture in software development

As a rule, earlier all applications were developed on the basis of a monolithic architecture. Let’s take a closer look at what a monolith application is.

Monolithic applications are developed as a whole, the logic for processing requests is placed inside a single process.

Monolith applications can be structured in modules and blocks. When developing them, separate classes, functions, etc. are used, depending on the programming language used. But the built connections between the modules are very strong. From this follows the following conclusion: changing any module will greatly affect the operation of the entire application.

As an example, consider a typical corporate learning management system (LMS) application.

This software has a three-tier architecture, which includes:

1. user interface;

2. server part responsible for software business logic and data access;

3. database.

The business functions of such an application are very different. It includes the following blocks: “Courses and training”, “Courses catalog”, “Organizational structure of the company”, “Calendar of events”, “Reports”, “Messages”, “News”, etc., however, all of them combined into a single monolithic block and located on the same server. Such an application is quite difficult to scale and change. Let’s highlight the disadvantages of a monolithic architecture:

  • If any application module fails, then as a result of this, the operation of the entire application may be disrupted.

  • Difficulty in managing a large team of skilled developers. Each developer should understand the entire functionality of the application, and not just their module.

  • Any update affects the entire functionality of the application, this leads to the risk of application failure after updates. Therefore, only infrequent releases of updates are made.

If this is a small free program for teaching some individual skills for an ordinary user, and even updated quite rarely, then a monolithic architecture is quite suitable for such development.

If we are talking about a corporate application (a full-fledged LMS, for example), and even frequently updated, then you need to choose a microservice architecture.

Microservice architecture is the optimal approach to software development. In a microservice architecture, an application is divided into small and self-contained components (microservices) with defined interfaces. This architecture has found its application in the field of cloud computing.

What is its difference from monolithic architecture? In a microservice architecture, an application is developed as a set of small and loosely coupled components, which are called microservices. Microservices are developed, deployed and maintained almost independently of each other.

If we take our example with an LMS application, then each microservice is aimed at solving only its specific business task, has its own database, and contact with other microservices occurs through the API. Thus, for a corporate learning management application, it will be necessary to develop the following microservices: “Courses and Training”, “Course Catalog”, “Organizational Structure of the Company”, “Event Calendar”, “Reports”, “Messages”, “News” and etc.,

It should be noted that there is another type of architecture – this is service-oriented architecture (SOA, service-oriented architecture). Sometimes it is confused with microservice. It seems that the differences between microservice architecture and SOA are not so obvious. But there are differences between microservices and SOA, this is manifested in relation to the role of the enterprise service bus (ESB).

SOA is a company-wide architecture that aims to standardize the interaction and integration of a company’s web services. The purpose of microservice architecture is to develop a specific application. The following patterns are relevant to SOA: CORBA, web services, message queues, ESB, and so on.

Below we will describe in detail the advantages of microservices for creating web applications.

Key Benefits of Microservice Architecture

We will evaluate the advantages of microservices in comparison with a monolithic architecture.

  • Simplicity and independence in application deployment. In the case of microservices, only one application module can be deployed. For example, in our case with LMS, it is possible to deploy only one module (“Calendar of events”), leaving the rest of the application components unchanged. If you need to rewrite a couple of lines of code in the Reports module, then there is no need to get a lot of permissions. This component (“Reports”) is a separate and independent microservice.

  • Scaling accuracy and efficiency. First, you need to decide which microservices will require frequent scaling, and which ones will not. Modules that do not need to scale often can be placed on weaker servers, and those that do not need to scale often can be scaled separately from the rest of the software.

  • Increased application resiliency. Rational design of the application and building independent links between modules gives the following advantage: the failure of one of the modules does not lead to the failure of the entire software. For example, if the “Messages” module fails, the user will receive a notification about the temporary unavailability of this block. All other application blocks will work.

  • Choice of technology stack. When developing each microservice, you can choose the technology stack that best suits its functions and ease of development.

  • Flexibility in managing development teams. Here’s a simple example: Team 1 develops the Course Catalog service, Team 2 develops the Events Calendar, and Team 3 develops News. It is easier for a new specialist to get to work faster, since they do not need to study the functionality of the entire application for a long time, it is enough to master the technology stack for a specific microservice.

  • Replacing or deleting services that are unnecessary for the customer is solved quickly and easily. For example, a specific customer will not use the “News” block in the LMS, then this module can simply be removed, without global changes in all software.

  • Each microservice uses its own database. This fact leads to the independence of data models. For example, if a programmer changed the data model in one specific service, then this will not affect the operation of other services.

As we can see, the microservice architecture has significant advantages and attracts developers more and more. However, before choosing an architecture for software development, it is worth looking at the disadvantages of microservices, which will be listed below.

Disadvantages of microservices

The system of microservices is distributed. On the one hand, this is an advantage in the operation of the software. On the other hand, if there are too many microservices and each of them makes requests to other services, then the resulting response time will increase and “points of failure” will appear. There are two ways to solve this problem:

1) change in call detail, which may lead to a decrease in their number;

2) the introduction of asynchrony, reviews are performed in parallel, as a result, this leads to the fact that the final response time is the slowest time of all, and not the total time of all delays.

The constant complication of the development process, which leads to increased requirements for the qualifications of programmers. In microservice architecture, the role of integration processes and continuous delivery processes is great. And therefore, it is quite difficult to handle many processes without automating testing and deploying services. These factors require the implementation of DevOps in the company and the close cooperation of developers with system engineers, testers, and technical service. support, etc.

Decentralization in a microservice architecture creates problems with the consistency of microservices. For example, in a monolithic application, many changes can be made in one transaction, but it is also possible to roll back if a failure occurs, while maintaining data consistency. When using microservices, the following situation is possible: if one of the services fails, another microservice stops responding. In this case, it is a matter of developer priorities: you can give priority to the availability of components (if one service fails, others will continue to function). In general, developers must strike a balance between service consistency and service availability, and this must be done very carefully.

conclusions

Before choosing a microservice architecture for developing web applications, developers should evaluate both its advantages and disadvantages. After all, the wrong choice of architecture may affect the performance and functionality of the software in the future. If the microservice architecture is applied incorrectly, developers can have big problems that level out all the benefits of microservices.

In the next part of the article, we will consider the technical tools that a developer who is going to use microservice architecture in software development should master.

Similar Posts

Leave a Reply