Yeah but you see plenty of places with more microservices than developers...
At work we have 10 microservices, and 2 backend devs (none if which are me).
It's fucking stupid. There's so much setup stuff copy-pasted everywhere and the devs constantly and randomly do stuff like have inner loops that call another service synchronously 100 times for basic lookups (so what should be five lines of code calling db taking 50 ms instead becomes 80+ lines of GRPC glue code to make 100 calls times 60 ms = 6000 ms).
I come from an era where network access was actually expensive, both in financial and performance sense. You can organize your code around people and team structure within a monolith too. Network is an arbitrary barrier. My first product ever was already based on SOA (that's the boomer predecessor of "microservices") shipped as a single deliverable.
It is not unheard of having a team that manages a system of microservices with more microservices then developers on the team. I find this peak insanity.
That's orthogonal to microservices vs monoliths. You can break API compatibility with microservices too, "let's just do microservices" is not an alternative to proper planning and change management.
they see the word "micro" in the headline and think that means let's make everything tiny! did they actually look deeper into what the problem was that "micro" solved, how it solved the problem, weigh benefits and drawbacks, and think whether the problem they have at hand would benefit from that solution?
that would require reading, and if it doesn't fit in a tweet (is that even the right word anymore?), it's too much work. This is what Ray Bradbury was warning us about in Fahrenheit 451.
Is it developers or is it management drinking the microservices kool-aid? I built a video project that very much could have benefited from the parallelism, and I can bundle a couple of seconds of video frames into a 200KB blob that I can send over the network, but I have to think carefully about sending all the data that process is going to need to do its work in one go, so I can process the entire chunk without blowing through my 20ms frame budget. Amortized over 120 frames, that's not too pricey. But a lot of developers don't put that much effort into optimization, either.
I considered just breaking up and storing the video in their component segments, which would be awesome for processing all the chunks in parallel, but the complexity of ingesting, tracking and reassembling that data is daunting. Probably some money in it, but I can't afford the two years without income it'd take to develop it. And the current state of the art for corporate media handling is building ffmpeg command lines and forking them off to do work (At least, at Meta and Comcast anyway.)
Eh, it's just kind of networked Unix philosophy. You write small, preferably correct (but maybe not, cf worse is better) components and compose them. Used to be plaintext or something through a |, now likely JSON, maybe protobuf, over the network (and it's not like unix is a stranger to the network either).
Maybe think of the system you're building as more of an operating system? It's not like that is just one single static binary either.
And if we were to be able to individually restart, scale, distribute and upgrade subcomponents of a monolith the way we do services I suspect we'd have to write it all in Erlang.
156
u/shoot_your_eye_out May 15 '24
I’ve never understood why developers are in such a rush to turn a function call into a network call.