07 Dec 2021

Microservices: versatile and efficient architectures.

Reading time: 10 minutes

When we talk about microservices, we must be aware that this is a vast and complex topic that is divided across a wide range of uses and variations. However, to try to shed some light on the matter, in this article we will see both the positive implications and possible critical issues associated with the use of microservices during the creation of applications.

Microservices: what are they?

First of all, it is necessary to clearly define what we mean when we talk about microservices: it is basically an architectural approach to the development of applications. This style contrasts with the traditional monolithic method, which involves unique and specific work on an application and on its entire system. Microservices, on the other hand, act separately and autonomously, integrating and expanding the various necessary functions. In short, we could say that each microservice represents a distinct application that carries out a very precise operation within a more complex system. Taking as an example an online sales site, the search in the specific bar, the insertion of a product in the cart, and the suggestion of products similar to those searched for are all targeted actions that can be implemented through the development of microservices.

But just how does an architecture based on microservices work?

Each part of an application made through microservices will be autonomous and its operation will not be dependent on that of the other parts. This obviously makes it easier to integrate each of these into the main system, but at the same time requires a structural rethink of the framework that regulates their communication and the exchange of data and information. The most effective way to achieve this result is to integrate the fundamental elements of an SOA architecture, especially if we want to facilitate the execution of the deployment of microservices.

Microservices: a history of constant evolution

Leveraging the basics of SOA architecture (an acronym that stands for a Service-Oriented Architecture), we can design applications through microservices. In fact, conceiving of development as an articulated system composed of several parts that dialogue with each other is nothing new. SOA architecture is, precisely, a largely consolidated software design style, which already in the mid-1990s went against the monolithic structure, blazing the trail for microservices. Monolithic architecture, although considered the most stable, involves a series of massive interventions following every single change to an existing app: the work is inexorably slowed down, not to mention the costs that this can have in terms of time and resources. A source code compiled in a single deployment unit, as a single monolith, requires that if you upgrade part of the application, you may have to disconnect the entire system. While this approach is still sustainable when it comes to small software, the scale of current processes forces companies to focus on systems that are much more flexible and on which intervention times are shorter. This is where microservices come in.

The advantages of the new architecture

What are the obvious benefits of using a microservice-based architecture?

  • Rapid market introduction: the development cycles for these architectures are certainly shorter, allowing an early deployment compared to differently structured applications and ensuring leaner updates;
  • High degree of scalability: in the hope that demand for certain services is constantly growing, microservices can benefit from a more targeted and widespread distribution;
  • Maximum independence: when development work is carried out correctly, each microservice is autonomous and does not affect the other parts of the architecture. In this way, the entire app does not risk being blocked in the event of a failure of a specific component, as occurs in monolithic structures;
  • Simplified deployments: their small size and modularity make microservices less prone to deployment problems. This, however, requires greater coordination between the various parts, which is easily achieved with a workflow that is well structured in the first instance;
  • Immediate accessibility: each app is divided into smaller parts, which are less challenging to update and implement, allowing a significant acceleration of development cycles.
  • Open structure: thanks to the non-language-dependent APIs used, the development of the app can be carried out using whatever technology and system are considered best to obtain the requested service.
  • Heterogeneity: different languages and technologies allow you to take advantage of the best performing stacks to boost particular functions. For example, it will be possible to introduce a specific type of database capable of naturally mapping a given data item, or to launch a calculation in an efficient and timely manner.
  • Easy replacement: the autonomy of each microservice allows the work team to easily intervene where it is necessary to replace a function en bloc.

A series of simplifications and advantages that make the choice of an architecture based on microservices particularly attractive for every developer.

The critical issues of development through microservices

So, there are no contraindications to the use of this development system?

It is no doubt necessary to properly assess what resources are available to the work team before starting to use the microservices structure: forcing this approach in a context with communication and collaboration difficulties between the development teams could be particularly risky. This is not a problem directly related to the field of development, but it is fundamental in order to be able to proceed in this direction.

This obviously derives from the fact that an architecture built on microservices is particularly challenging to manage in a productive and efficient manner.

If we take a closer look at this aspect, it is important to understand that the development of a microservice requires a long-term vision, especially in terms of return on investment. Indeed, since this is a largely unexplored territory, every time you start a project related to this type of applications, you must take into account the fact that it is not possible to establish the timescale to bring the project to its close with certainty. Indeed, although the advantages of microservices are evident, on the other hand it is essential to remember that, especially for small development teams, the amount of time invested will be repaid only thanks to a well-structured economy of scale. The more a feature will be used, the more easily it will reach potential customers, and the faster it will be possible to make a return on the investment. This is not a secondary aspect, but a bona fide determining factor that must not be taken lightly when approaching the development of a microservice-based architecture.

What are the critical issues arising from the use of microservices?

  • The identification of dependencies between the various services involved;
  • The greater difficulty in implementing integration and end-to-end tests;
  • Backward compatibility with the entire system when a new version is released;
  • The initial configuration of the deployment, especially if carried out manually in cases of particular complexity of the microservice system;
  • The need for centralised registries to keep the various components connected;
  • Constant monitoring, able to give a centralised view of the system to the teams involved;
  • In the case of particularly complex architectures, it is impossible to debug off-site.

 

The problems listed underline how it is necessary to take precautions and keep certain aspects in mind during processing and development, but they must not divert attention from the advantages and potential that microservice-based architectures offer today.

Share: