Turning the modular monolith into microservices
Our application, while it is modular, is a monolith. It is built as a single executable and can be deployed as a single application. There is nothing wrong with that but faced with scaling issues, we have only one knob we can adjust. If we broke the application up by turning each module into its own microservice, then when faced with scaling issues, we would have finer control over how the application can be deployed to support the load.
Turning our application into microservices will have many steps to it but will not be difficult:
- We will need to refactor the monolith construct used to initialize each module.
- We will make some small updates to the composition root of each module.
- We will then update each module so it can run as standalone.
After we are done with these steps, we will update the Docker Compose file and make other small changes so that the two experiences, running the monolith or running the microservices...