by rco8786 · 4y ago · 0 comments
Here, here! If I had a dollar for every team I’ve seen adopt micro services as a solution to code modularization I’d have several dollars.
“Hey our code could be cleaner and our git repo seems to be getting big”
“Sweet let’s inject the network in between everything”
Not really. Cloud providers did convince everyone that if you hit a resource limit in one of your boxes then your best strategy is being able to add more boxes, and not move everything and the kitchen sink to a larger box.
Also, not everything sits in the hot path of anything. Sometimes all you want is a long-running job to run somewhere.
* Network calls are traceable by default — logging all incoming queries is easy, logging all function calls is harder.
* Network calls are easily made — function calls in a backend can require passing some kind of a huge config structure, or might be entirely unavailable if you're using a compiled language, while network calls can be done with nothing more than curl/grpcurl/etc.
The downsides are a) decreased performance b) you have to handle failures c) dev ergonomics, but eh. I would still choose network calls over function calls for a big backend, probably.
It's really not though. Many (most?) languages have some way to annotate function calls with logging logic
> function calls in a backend can require passing some kind of a huge config structure, or might be entirely unavailable if you're using a compiled language
Not really sure what you're referring to here
Are you genuinely suggesting that making a network call is easier than calling a function in the same code base running in the same process?
Dev ergonomics explode the cost of everything and you spend your time trying to figure out what the hell is going on where rather than just... plugging the profiler and sending the input, then observe the internals moving around.
If the system can work without micro services, it should.
Define "easy" because curl is not "easy" compared to a function call and involves building a few large datastructures to work at all.
Real world is messy.
There are very real reasons to need process isolation in larger systems. Code modularity is not one of them.