by cynusx · 3y ago · 0 comments
That's assuming good intent, worse intent is that devs want to experiment with different languages or generally want to avoid learning what everything is in the codebase or they are unable to use their editor properly to navigate large codebases efficiently.
There is absolutely no reason to split the codebase and subsequently the test-suite ever.
You can always take a monolith codebase and deploy it differently with the configuration driven by environment variables. (e.g. external vs. internal API's). This way your test-suite remains unified and can test the entire application.
There are always reasons for and against any decision. Engineering is about balancing those tradeoffs to meet your particular needs. It's silly to say "there is absolutely no reason to ..." about almost anything.
This is simply not true. Microservices are a solution primarily to an organizational problem and secondarily to the problem of allocating and managing computational resources. The organizational problem is solved by the hard boundaries and loose coupling imposed by operating and consuming independent services. Allowing a team to own and operate their services allows them to have more control over all aspects of a their life cycle, reducing the scope of other stakeholders to what contract their interfaces need to comply with.
Those who naively shit on microservices seem to be totally oblivious to what it would be like if all we had were monoliths. We tried that already. It's awful, and we learned from that mistake. Well, some of us did.
"A" solution does not mean the only solution or the best solution. They're often treated as the only solution though.
They are often, and by far, the best solution though, specially taking into account the tradeoffs of whatever alternative you come up with.
Specially massive monoliths in a monorepo.
It makes no sense to mindlessly crap on operating services, specially when compared with alternatives. I get that some people feel the need to vent their personal frustrations, but this does not mean they have a point.
Are you trying to solve a problem with code organization? I've heard of folders, they do a pretty good job. Most of the time though, microservices tend to get in the way of delivering VALUE to the company I work for ... because someone thinks 'this is the way.' I was hired to deliver VALUE, not beautiful code, not code that follows this year's 'best practices' that aren't, or even bad code.
I will always write easy, simple, and clear code that delivers VALUE. Microservices usually get in the way of doing that, for basically arbitrary reasons.
Having it all together is perfect for code re-use and testability.
It's also very easy to know if you broke the bigger picture while working on a subsystem of the monolith because the test-suite will tell you.
In my humble opinion, monoliths are unpopular because not much thought went into the original design of the code and as a consequence there are large chunks of technical debt interfering with everybody's work. It certainly doesn't help that many popular frameworks don't give you the design architecture to grow big apps.
But the good news is that if you don't split your teams, you also have more engineers on hand to refactor the codebase to be more manageable.
They are not better than modules. The problem is that dynamically typed languages can't support proper modules, so microservices are their only alternative (so far).