I’ve had a good experience with Microservices, come on:
Perks:
Team division: When your system grows and the development team also ends up coming the need to break a large team into smaller teams to facilitate communication and task division. With the Microservices paradigm, teams can attack different services without the risk of one change affecting the development of the other team (collisions in merges, etc).
Scalability: When you need more performance in the monolithic model you usually duplicate the whole server or increase its capacity. With Microservices (or any distributed systems paradigm), you can scale only the part of the system that really needs more performance, without touching the rest.
Development speed: This part only applies afterward that your entire system is already very mature and I’m talking about the code part only. Smaller solutions compile faster and are easier to work with.
Freedom to choose technologies: Each microservice can be written in the language and use the most interesting database to solve that specific problem. New technologies/frameworks can be tested quickly and contained.
Quick update of frameworks: As each microservice is independent, it is easier to move up the version of a certain framework without fear of side-effects in other parts of the system. The work is also smaller, since the solution is very small and can simply be rewritten if this is the case.
Disadvantages
Setup: The setup of your application can get much longer depending on your context. You have to think about Gateways API, Discovery service and all Microservices orchestration, things that are not normally needed in monolithic applications.
CORS: If you make AJAX calls for multiple services, you may have the CORS problem. This can be solved with a reverse Gateway/Proxy API (more work, more items to manage).
Authentication: Same thing as CORS, it can be solved in several ways (API Gateways + tokens for example), but it generates much more work at the beginning.
Logs: logs are decentralized and should be centralized somewhere for full diagnosis.
Deploy: This is the worst part. If you already have problems deploying with your monolithic application, don’t even think about Microservices. All problems will be multiplied by the number of services, since instead of 1 single, simple deploy, you have to do several.
Testing: Testing the application as a whole takes a lot more work on each developer’s sandbox. End-to-end debugging becomes more complex as you will be working with each service. Container technologies can help.
API Gateway Bottleneck: If you have a team looking after the Gateway API, it can turn your development Bottleneck if in your case every new feature has to go through there.
Backup: As each microservice ends up having its own database, you will have many more backups to do and manage.
Transactions: With multiple databases you will get the problem of distributed transactions and perhaps some data replication.
Completion
The Microservices paradigm is trendy and a lot of people are using a lot to think about the pros and cons. There is nothing wrong with monolithic applications, it all depends on your context.
As with any decision to use any technology, the question you have to ask is:
What problem do I want to solve with Microservices? And what problems will I introduce with them? It’s worth it?
And one last tip:
If your company does not have a strong culture of devops, Forget Microservices. Nurture and strengthen this culture and only when you’re really good at it start thinking about this paradigm. Deploy will be key to the success or failure of such a system.
Good clarification, but some of the disadvantages are not inherent to the architecture of Microservices, but to policies and technologies not (or poorly) implemented and that bring problems both in one scenario and in the other, as the deploy problematic, for example.
– dellasavia
Hello @dellasavia, yes, but regardless of its maturity with deploy, it is always more expensive and complicated to deploy from multiple applications than from one.
– andrecarlucci
In time, if you want to see a real-life example, read about the Predix (http://www.predix.io) that GE (General Electric) released. It is a platform for Iiot (Industrial Internet of Things) based on Microservices.
– Leonardo Pessoa