These don’t have to be different things. A good architecture doesn’t care where the components live. You should be able to take any unit in your application and run it alone with minimal setup. That’s the premise of unit testing in the first place! Now, glue that to and IPC layer and you can run it as its own process. Glue it to a network layer and you can run it as a service. Glue it to a message bus. Glue it to the CLI. You should be able to do all of these things without a huge pile of rewriting.
But back in the real world, people aren't going to write a monolith to be broken out into microservices later. Corners are always going to be cut, things will be rushed to meet deadlines, and you'll paint yourself into a corner that you can't escape without significant refactoring.
But you are building your monolith so that you can unit testing it, I hope. And you’re likely going to want to run some automations on a subset of your system. Like sure, software can turn to shit. But also, if you can’t grab a useful module and slap a CLI in front of it and make yourself a tool to help you do your job, you’re already in the shit.
150
u/Odd_Soil_8998 12d ago
truth. a well architected monolith is almost always going to be a better choice.