Skip to main content
Cyber Monday is here!
Save 30-65% now through December 5!

Microservices: Definition and Main Applications

January 10, 2022Announcements

By Marco Fioretti

Microservices are a software architecture for complex web applications, based on one, really non-complex concept: encapsulation of each main function of the system as one small, semi-independent, network-based service often provided, as we say these days, “in the cloud”. A specific microservice is an almost self-contained software program that exists only to perform a single (possibly quite complex!) task as part of a larger platform for other components of that same platform. The first thing to understand about microservices is that…

Microservices are not APIs!

Their use to make large software platforms more modular may give the impression that microservices are just the currently glamorous name for the Application Programming Interfaces (APIs) that have been around for decades now – that is not the case! 

APIs are rules, or libraries, that only implement interactions between software programs, not what each of them actually does. APIs describe without ambiguities which data formats can be exchanged, which commands are acceptable and their possible replies, and similar tasks. Therefore, the same API may be used by wildly different programs. Meanwhile, microservices are currently the most popular of the many categories of applications that need APIs to be first of all useful, and then manageable.

Main microservices types, and risks

By its own nature, “microservice” is an umbrella term for very different programs, and this makes it impossible to describe them completely in one short article. Nevertheless, there are at least a couple of things that are valid for, and essential to know about, just every kind of microservice.

ATechnically, a microservice can be stateless or stateful, and since this classification has huge consequences on its implementation it is crucial to get it right. “Stateless” indicates any microservice that does not preserve session data, or any other memory of previous events, between consecutive transactions with the same, or different users (whoever those “users” may be, that is other microservices, third party applications or actual human beings). In stateless microservices, every transaction happens as if it had been the first. This makes them simpler to build, test and maintain. In many cases, however, this “statelessness, is not  possible. The alternative, or fallback solution is statefulness, that is microservices that store session data,  or logs of every interaction in some database, to reuse them when needed.

The other crucial thing to know about all microservices is that yes, they must be as self-contained and independent as possible. But if, for example, every team responsible for one microservices of the same platform adopted a different language, this could open the system to a greater variety of attacks (that is to the SUM of all the vulnerabilities that are discovered in ANY of the languages used).

Microservices are big

While the general principle is certainly not new, microservices have experienced a surge in popularity in the last few years.

According to an IBM survey, in early 2021 microservices were most commonly used for data analytics, business intelligence, and database applications in general. As of late 2021, major adopters of microservices include Amazon, IBM, Microsoft, Netflix and Oracle, and those are just some of the big names you find mentioned here and in other market reports of 2021.

The same technology is also quickly spreading outside the services industry, and specifically in the manufacturing sector: ThyssenKrupp handles predictive maintenance of their elevators by managing IoT devices through microservices, and several companies run microservice on AWS to control their manufacturing plants at the lowest possible cost. Collectively, if analysts got it right, the cloud microservices market should “reach USD 2701.36 million in 2026… registering a CAGR of approximately 21.7%”.

When and why to use microservices

Microservices may play a very important role in the infrastructure of any large organization, as well as in the portfolio of every software developer. The microservice advantage most frequently reported, in the already mentioned survey, is greater ease when adding or removing resources or functions to suit changing business needs, which translates to higher satisfaction among customers.

That’s hardly surprising. Being smaller, and as decoupled as possible from the rest of their platform, microservices are easier to update frequently, with minimal risks for the rest of the system. This, in turn, makes updating or expanding the larger application easier, whatever its purpose is, even when requirements change frequently.

In other words, microservices can be very good for long term, sustainable productivity of any complex software system. Besides making it easier to build and modify an application, microservices always do it in the manner that best matches objectives and ways of working of each part of the organization, in any given moment.

This is also true for providers of online corporate-level services. Cloud applications like Gmail would never customize their behaviour for an individual. A cloud-based payroll-management platform for corporate customers, however, would be a totally different animal. The providers of such a service could and would want to offer different versions of the system, e.g. one for EU companies, one for US ones and so on. But if those versions differed for just one or a few specific functions, keeping all customers happy would be much easier if those functions were provided as two separated microservices, than if the whole application had a monolithic architecture.

Migration to a microservices architecture could be a wise choice also for existing applications, if they are becoming increasingly harder to update and maintain with the speed and frequency that modern business environments demand.

At the end of the day microservices do not exempt their architects and developers from enforcing very clear common rules and supervision; quite the contrary, actually! Lack of coordination and common vision can make a microservices-based platform unnecessarily hard to manage in many ways. To discover more about microservices and how they may help your organization or career, stay tuned for the next articles of this series.

Thank you for your interest in Linux Foundation training and certification. We think we can better serve you from our China Training site. To access this site please click below.

感谢您对Linux Foundation培训的关注。为了更好地为您服务,我们将您重定向到中国培训网站。 我们期待帮助您实现在中国区内所有类型的开源培训目标。