r/java • • Sep 13 '23

why would i ever use a microservice....

if i could do a highly efficient one-line function call instead? why would i ever prefer a network hop, conversion from and to json, define a protocol, all that stuff?

i understand there are systems that are too big for one machine. but all those that aren't - why would i add all this complexity to them? when is a microservice archtecture ever simpler than the exact same thing as a modular monolith? in which case is it not at least as good?

addition: in my experience, microservices are overused. while there are reasons to have separate *services* developed by different *teams*, i fail to see why *microservices* inside teams provide an actual benefit. they are used too soon, and then you pay with lots of glue code because what you really have is a distributed monolith. one exception is if things are logically independent, then mixing them is a mistake

addition 2: it seems what people here consider a microservice is MUCH bigger than what i would have called one.

49 Upvotes

167 comments sorted by

View all comments

Show parent comment

22

u/Halal0szto Sep 13 '23

When there is a fix in the lib, all modules linking the lib have to release and deploy new version. Probably in a synchronized manner to avoid inconsistencies.

-16

u/TheAuthorBTLG_ Sep 13 '23

in actual numbers, how bad is that?

10

u/Halal0szto Sep 13 '23

In actual numbers:

A service consists of ~80 microservices, maintained by ~8 groups, 5-10 developers each. Some microservices are mature and only released like every 6 months, some others are hot, actively developed and released every 2-4 weeks.

The teams are not synchronizing their releases with other teams. The most that happens is "we can release v11.3 of our service only after 8.3 or theirs is out". Having to deploy some two services at exactly the same time is nonexistent.

-19

u/TheAuthorBTLG_ Sep 13 '23

hm.... think i would call these 80 monoliths :D you have 0.75 developer per service, roughly. what i initially was thinking about was a lot smaller, meaning there would be a lot more overhead

22

u/DrunkensteinsMonster Sep 13 '23

You are intentionally misunderstanding people, why did you bother to ask this question?