Microservices Architecture: what it is and how it works
Microservices architecture is a revolutionary approach which allows the development of dynamic apps which are easy to manage, update and upgrade. The idea is to sub-divide the services within the structure and develop them separately so that each is responsible for a specific task, thereby avoiding potential overload of the application code.
This definition may recall SOA (Service Oriented Architecture), but in the case of microservices architecture, communication is encoded and managed using clearly defined API’s.
Differences between microservices and monolithic architecture
The first apps were developed using so-called monolithic architecture. In practice, this consisted of enormous blocks of code which contained the various available services functioning in unison, as they were all inter-linked.
The main disadvantage of this configuration was the fact that in order to update or modify a specific service, you had to update the entire application. This resulted in down time during which user access was temporarily suspended. Of course, this led to considerable inconvenience for businesses and consequently the search for new solutions began.
The above-mentioned Service Oriented Architecture was the closest fore-runner of microservices architecture and introduced the concept of separated services in app development. This new method of programming made it more versatile and easier to update, but also entailed some significant drawbacks.
The absence of an accessible general code in terms of cost, capable of coordinating services developed in different languages, turned out to be too great an obstacle due to its cost.
In light of this, we might say that microservices architecture takes the best features of the two previous architectures and combines them to achieve an optimal result. The services are developed autonomously by small teams and are used for highlly specific tasks, but are able to communicate with each other efficiently thanks to the API’s, as if they formed one single application.
The advantages of adopting microservices
We have already described the main advantages of microservices architecture, how it facilitates updating and maintenance, as well as its almost unlimited capacity for expansion and versatility. However, the following points should also be added to the list:
- Individual faults can be eliminated: considering that bugs and malfunctions are mostly limited to the service where they were generated, it is easy to isolate and resolve the problem;
- Orchestration is more streamlined: implementing automated build, testing and distribution processes means that these are easier to manage, while coherent communication with the various sectors is maintained and the number of configurations requested is reduced;
- Versioning: with this system, the API’s can be updated separately from the single services, since they are based on models which are isolated from those of the rest of the application.
Disadvantages of microservices architecture
Like any other type of architecture, microservices is not without its disadvantages. The negative aspects are mainly encountered during the phase of scalability of the application, during which the complexities of certain systems must be dealt with. Sub-division into separate services, furthermore, results in a larger number of factors which require close monitoring:
- Although streamlined, the orchestration is complex without any largescale automated implementation of management verification procedures. These procedures must in fact remain coherent in the long-term for the duration of the app’s lifetime;
- Communication between services requires special attention during development, since any error may transform into a negative user experience. Detailed checks and specific procedures are therefore necessary;
- Problems with the coherence of data transmitted can arise due to the huge number of databases replicated and the continual exchange of information between different services.
Translated by Joanne Beckwith
