We're an enterprise saas product and while there is a whole hell of a lot of it I would love to to redo from the ground up, the mono repo route with some other large supporting services take is not one of them.
Micro services means oh we have 30 sperate code bases that all did their own thing. We have the one main mono that handles 75% of everything and 4 other things that do things that just made sense to be in a supporting role.
I would not call any of them micro services though, they're big in their own right
Lol, distributed monoliths (aka macroservices) are the worst of both worlds. You lose the benefits of both and gain the downsides of both.
Also, no, you can do the same things across 30 microservices just as easily as you can do them in that same code within the monolith. Either you have standards and checks and enforcement mechanisms, or you don't.
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.
152
u/Odd_Soil_8998 3d ago
truth. a well architected monolith is almost always going to be a better choice.