Tecnology and architecture decissions

Theory Introduction to Microservice Architecture.

The objective of this section is to motivate the use of an architecture based on microservices.

Microservices allow a software to be divided into small services, thus making it much easier to develop, debug, deploy and maintain.

To carry out the communication between the different microservices and these with the database, there are several alternatives such as REST, SOAP, AMQP or ZMQ.

Advantages of using microservices as opposed to a monolithic block:

  1. It allows to be polyglot and therefore, to develop each microservice in the language that is most convenient.
  2. The code is simplified and much smaller. Updating and adding functionality is a more atomized and simple process than restructuring code in a monolithic architecture.
  3. Flexible (horizontal) scaling. A development based on microservices allows to estimate costs and to scale according to the demand.
  4. Work well within containers, such as Docker.
  5. If one service fails, all other services continue to work. A partial drop of one functionality does not drag down the others.
  6. Each microservice has its own process (and culture, working with nodes, clusters and the cloud) of DevOps versus the role of system administrator (working with your own team).
  7. If they run inside containers, they can be easily orchestrated (docker-compose)
  8. They are__ easily reusable__. For example, a microservice that provides authentication for one system is very easy to adapt for a different system.
  9. Each microservice provides minimum guarantees of isolation, thus facilitating security issues and compatibility between microservices.
  10. Unit tests are simpler as the combination of functionality provided by the microservice in question is more packaged and defined.

Questions to be answered using microservices:

  1. Communication protocols must be designed between the microservices. Not everything is a microservice. You have to know how to detect what a microservice is and what it is not. Too many microservices could overload the development of the software system we have in mind to build.
  2. It is necessary to know how to orchestrate well and correctly balance the load between the different microservices.
  3. Integration tests are more complex when we have to take into account each and every one of the microservices that provide the software system.

Proposed design

Proposed microservices: