Migrating Monolith applications to Microservices(quick tips)

This post is inspired by my previous experience of migrating apps from monolith to microservices, hoops I have to jump and hours I spent researching this topic on the web.

A common approach is to start with a monolith and gradually peel off microservices at the edges. Such an approach can leave a substantial monolith at the heart of the microservices architecture, but with most new development occurring in the microservices while the monolith is relatively still. Picture below illustrates this concept effectively:

Few tips which will help you in this journey:

  1. Things should be done via small, incremental changes
  2. Adequate test coverage to validate these changes
  3. Make sure that we still have a working product after every round of change
  4. Identify services boundaries inside Monolith app, which later on could be externalized to standalone service.
  5. Microservices communication: understand when to use service-to-service communication(TCP/UPD, HTTP, gRPC) patterns as opposed to asynchronous patterns(Apache Kafka, RabbitMQ, etc).
  6. Most probably you will need 2 teams, one for supporting old code base and one for building a new one.
  7. Be very cautious about which interfaces, classes, libraries, etc goes to “common” modules and shared across numerous microservices. As you may end up in different microservices will need to use a different version of the same library.
  8. Don’t forget about SOLID principles

More info on that:
Martin Fowler’s blog
Building Microservices: Designing Fine-Grained Systems

Leave a Reply

Your email address will not be published. Required fields are marked *