What is a microservice?

Microservices are becoming increasingly popular in software development. One of the reasons for this is that microservices scale well and make it easier to deal with complexity. But what exactly is a microservice? And what does a systems architect need to know about it?
Microservice as a black box
A microservice is a software service that is addressed via a clearly defined interface, no more and no less. A microservice is therefore a Design pattern. There are many misunderstandings about microservices. Specifically, a microservice is not the following:
- No architecture: Although a microservice can play an important role in the implementation of an architecture, it is to be understood more tactically (i.e. as a design pattern).
- Not automatically web- or REST-based: Web technologies, which also include REST are widely used. However, there are also other ways to implement microservices.
- Not automatically container-based: Microservices are often "containerized" (e.g. with Docker), but this is not a prerequisite.
- Not automatically stateless: It is advisable to implement the services stateless. However, this is not a prerequisite for a microservice.
However, the fact that microservices are often associated with these points is due to the fact that they are useful concepts:
- A microservice severely limits the possible architectures. Or to put it another way: Microservices are a design pattern for architectures.
- Some kind of protocol is required for the interfaces. In addition to REST, GraphQL is a useful abstraction that makes it much easier to manage the evolution of interfaces. RCP from the 1990s is also a possible interface protocol. Here is an article on three REST alternatives.
- Container technologies initially have very little to do with microservices. With the Container virtualization the first step is to deal better with dependencies. This is just another contribution to robustness.
- It also makes microservices robust if they are stateless. This drastically simplifies testing. And not only that: combined with container virtualization, systems can be scaled up much more easily. Since (almost) every system also needs to store data, there are at least some services with state, such as a database.
Scaling with microservices
As systems engineers, we understand the concept of Encapsulation. A microservice is a "black box" that is only defined via its interface. This has a certain similarity to object-oriented programming. But there are two important differences. Firstly, a microservice runs in its own process. This means that a crash of a microservice does not paralyze the entire system.
Secondly, microservices are generally much easier to scale. If the microservice is stateless, then the system can simply start more microservices if required. If this is not possible, then at least a resource-hungry microservice can run on powerful hardware.
Microservices for Systems Engineers
At the moment, we primarily encounter microservices in the infrastructure: if a vehicle manufacturer wants to network all vehicles, for example, the platform must be able to scale. For example, there are VWs registered on German roads today (2021). Depending on what the platform can do, robustness could be relevant to safety. An architecture based on microservices is a good option here.
A completely new application is the use of microservices in the product itself. While conventional cars consist of a network of dozens of control units, Tesla has only a single. Presumably this one system is based on microservices. Worth reading in this context is the paper Microservice Architectures for Advanced Driver Assistance Systems: A Case-Study.
Conclusion
At the end of the day, a systems engineer should quickly understand the concept of microservices, it's not rocket science. Nevertheless, now is a good time to get to grips with the subject: After all, systems are becoming ever more software-heavy and ever more networked. And as ECUs become more powerful and cheaper, there will be more and more opportunities to use microservices.






