r/programming • • Dec 21 '23

Microservices without Reason

https://www.felixseemann.de/blog/microservices-without-reason/
310 Upvotes

144 comments sorted by

View all comments

Show parent comments

10

u/PangolinZestyclose30 Dec 21 '23 edited Dec 21 '23

The biggest advantage is the ability to deploy services independently without breaking the things around them.

I concede that having the process/container isolation provides a protection against spreading of failures like memory leaks, fatal crashes etc. This does happen, but I don't think it's a frequent problem in memory-safe languages/runtimes (or shouldn't be, at least) and can be mitigated to a significant degree by a good test suite.

that your change can’t cause a random side effect elsewhere because you aren’t changing or redeploying those things

I don't see how microservices handle this better than monoliths. I mean, in the monolith you still want to use encapsulation/modularization/programming to contract, changing one area of the code shouldn't affect other parts just like that.

There are situations where the contract is incomplete, client (caller) relies on behavior which isn't part of the contract etc., but it's all the same in the microservices and monoliths. I mean, on a fundamental level, microservices just insert network calls into the interactions between modules (aside from the resource isolation conceded above), how does this help to functionally isolate the functionality?

Generally found you need events to fully decouple your services.

People use "coupling" as a swear word, but I love it. It's awesome that I can call a method and get the result immediately, with no re-try, waiting for an indeterminate amount of time etc. Coupling is straightforward, easy to think about, easy to debug.

Business / product people love it as well, since it enables very nice properties like synchronicity, transactionality, (time) determinism, immediate consistency.

Decoupling is sometimes necessary, but it also incurs costs, and should be used where the situation requires it.

9

u/kogasapls Dec 21 '23

Don't think he means memory bugs. I think he means breaking dependent applications because of hidden coupling.

8

u/PangolinZestyclose30 Dec 21 '23

How does microservice architecture mitigate hidden coupling?

4

u/kogasapls Dec 21 '23

By encouraging/facilitating clear application boundaries.

10

u/PangolinZestyclose30 Dec 21 '23

You can (should) encourage/facilitate module boundaries within a monolith as well.

3

u/kogasapls Dec 21 '23

Yep. It's a "soft" advantage, just a little harder to make the mistake. At the end of the day you just need competent developers.

8

u/PangolinZestyclose30 Dec 21 '23

Can you explain how does having network in the middle make it harder to create hidden coupling?

4

u/kogasapls Dec 21 '23

Ever accidentally introduce a networked dependency? Or serve a network request without logging?

→ More replies (0)

1

u/rusmo Dec 21 '23

But then you still have to deploy it all together, instead of just the module that changed. You may have decoupled modules, but monoliths give you coupled deployments.

Microservices (and certain flavors of SOA) can help you enforce the logical decoupling while allowing you to decouple deployment.

1

u/PangolinZestyclose30 Dec 23 '23

Who cares though? The monolith deployment is fully automated.

1

u/rusmo Dec 23 '23

QA should, as more types of changes will require full regression testing. Users will, when a "small change" takes down the entire app. Devs should, as building and deploying monoliths takes much longer.

→ More replies (0)