Choosing between monolithic or microservices architectures might be evident nowadays, where cloud-native applications and containers are everywhere, but the truth is that it really depends on your specific use case. The case study provided by UppLabs gives a perfect example of when the migration from monolith to microservices makes perfect sense. They had a project with a concrete goal: the optimization of application performance.
The full original article is available on the UppLabs blog.
Monolithic vs Microservices Architectures
The comparison between the two architectures is an open discussion that goes on for years. They both provide pros and cons. In a nutshell:
|Monolith Applications||Microservice Applications|
|Unified “block” or “unit” with one code base and a single executable file that couples all of the business functions together. Everything gets delivered, released, and updated at once. Code is easy to manage, understand, and deploy.||Relies on independent services that work together. Each service has its own business logic and a specific goal. Same for updates, tests, deployments, and scaling. It is easier to quickly adapt the app to the user’s requirements.|
|Easier deployment and development. |
Testing and debugging simplified.
Continuous and independent deployment.
Highly maintainable, testable and reliable.
When this migration makes sense
- The server can’t handle the amount of real-time users;
- The monolith architecture can’t scale up;
- The backend code isn’t optimized;
- Database triggers create a performance bottleneck;
- Bad business logic;
- Legacy code doesn’t facilitate the introduction of new features.
In the first stage:
Two potential approaches
- Rewrite the application from scratch to microservice architecture and follow the best code practices. It required more than 1 year of the development of a team of 5+ members.
- Implement microservices that cover a part of the functionalities, the most used ones which bring the biggest performance issues.
The UppLabs team analyzed the existing application. Besides monolith, the project had problems with code structure, so it has to be rewritten from the very beginning. The team decided to put the logic into the microservice, creating a Public Getaway API.
After successfully realising the plan, the architecture had the following structure:
Read the full article: https://upplabs.medium.com/from-legacy-monolith-app-to-microservices-infrastructure-case-study-90b57821b7ea