3 ms·
In the right circumstances, some microservices make a lot of sense. I was recently working on a .NET project where the need for compiling handlebars templates o
by davidgh 10y ago
In the right circumstances, some microservices make a lot of sense. I was recently working on a .NET project where the need for compiling handlebars templates on the sever came up. This was the perfect use case for a little service. Its purpose was clear and independent from the rest of the application. In this case, we deployed the microservice on AWS Lambda, saving the need to install Node or spin up another server with all the associated care & feeding. Compiling large handlebars is fairly CPU intensive, and we don't have to worry about the load on our app servers. To me, it was an ideal scenario to develop a microservice. It solved a specific problem and didn't bring new ones to the table.
Microservices make sense to me when the task is clearly abstract from the application using it (which allows the service to be used more widely), the nature of the service is such that it has significantly different resource requirements than the rest of the application (allowing it to be scaled independently), and the problem it solves is not trivial.
I would be happy indeed as a developer to walk into a project and have a handful of tools at my disposal for doing things like sending emails, event notifications, logging, encryption key rotation, etc. I just consume the API. It's the reason I appreciate AWS; they provide a load of features (i.e. microservices) that let me focus on domain problems and not things that have been solved a thousand times already. So as a thoughtful developer, deploying something as a microservice can be a prudent contribution that brings a great deal of business value down the road.
But it starts to get out of control. After a bit of success with a legitimate microservice or two you become a hammer and every function starts to look like a nail.
If you can't visualize the microservice you're building ever becoming an AWS product, popular open source project or service offered by some SaaS company, likely it's too domain-centric and should stay in the monolith.
"Better learn balance. Balance is key. Balance good, everything good. Balance bad, better pack up, go home. Understand?" - Mr. Miyagi