Software System Design Dilemma: Monolithic vs. Microservices
Starting any project requires considering how to start building the perfect idea in your head. Probably everyone out there would immediately head into development and enjoy actually making the product without thinking about the next possible steps. Could this project lead to something bigger?
Each project has its own personality. One could be more serious, and one could be very specific and targeted to a niche audience. Decide on what you are targeting. The main difference is the amount of code rewriting you will do between monolithic and microservice architectures. Usually, smaller-scale projects intended to stay that when should go in the direction of monolithic architecture as they are likely to have a larger codebase or multiple specialized components.
Monolith | Microservices |
Less repetitive code | Lots of repetitive sections across different modules |
Lives under one project | Separate projects for each module |
Less maintenance | Maintenance for each module separately |
Harder to get up to speed | Faster understanding of a module due to being specialized |
Requires full deployment and functioning for the project to run | Taking down one module will not kill the entire service but just a part of it |
For personal projects, my direction is always to build monolith applications as I have less repetitive coding to develop the idea. That way focusing on the product is much easier and there is less thought and energy going into the service architecture.
Here is another bonus of monolith applications!
Let’s think about this scenario. After developing a project, you think of changing the architecture, and you plan to switch from a monolith to microservices. This is relatively easy compared to the other way around as you already have a structure you can apply to all the new microservices you created. Switching to a monolith is much tougher. You will have to properly bind all the code into one. It is very likely that the project structure will change and also have to optimize as the goal is to have one project running all the features.
If you are not sure which one to choose, definitely go with the monolith as it will be easier to switch if needed. Always think about the possible future before you start the project and assess your goals for it. As you plan and set goals before starting, making such decisions before you start and later down the road will save you time.
Thanks for reading this post!
If you’d like to contact me about anything, send feedback, or want to chat feel free to:
Send an email: andy@serra.us
Leave a Reply