Microservice architectures, which are a special case of service-oriented architectures (see here for details), are increasingly becoming more popular and are preferred over monolithic architectures. A modular architecture approach based on microservices aims at dismantling an application into small, independently deployable pieces of software. Together, they provide a greater output that can be compared with the output that a larger monolithic application would produce. However, the advantage of the modular architecture is that every single microservice can be managed individually, so that they can be programmed, scaled, reused, analyzed, or replaced individually – with less or no impact on the overall system.
To illustrate that, consider the case of a bakery that bakes bread. In both cases, there is a bakery that produces bread as output. Also, the process steps are about the same. The difference is the architecture, which is monolithic in one example, and modular in the other:
In a monolithic architecture, the business functionality “make bread” of the bakery is considered as a whole and cannot be broken down. If something had to be changed, the business functionality would have to be stopped, adapted, and updated as a whole.
In a microservices architecture, the business functionalities of the bakery are divided into microservices, which allows to deploy them individually. For example: If a bakery does not make the dough on its own, but gets it delivered, microservice 1 is not deployed. If a customer does not want the bread cut in slides, microservice 4 is not deployed.
If you want to learn more about the advantages and disadvantages of microservices and when to use them, take a look at this article.