News for hackers. Stuff that matters.
Re:Meta’s Microservice Architecture [pdf] by danwee on Tuesday July 11, 2023 @04:20AM (#36677963)
Indeed, but I think we are too late for that. It's not like the usage of GOTO: someone who mattered wrote that its usage should be considered harmful, and hence nowadays GOTO has practically a niche usage.

If only someone that mattered would have written on time an essay titled "Microservices Architecture Considered Harmful".

Re:Meta’s Microservice Architecture [pdf] by randomdata on Tuesday July 11, 2023 @04:41AM (#36678078)
> hence nowadays GOTO has practically a niche usage.

Except where it was rebranded as throw/catch. All while bridled (C-style) gotos were considered acceptable by Dijstrka, but are now looked upon with disdain. Amazing what marketing can do.

Re:Meta’s Microservice Architecture [pdf] by gordian-not on Tuesday July 11, 2023 @05:31AM (#36678441)
Aren't you talking about break and continue? throw and catch unwind the stack and goto doesn't
Re:Meta’s Microservice Architecture [pdf] by randomdata on Tuesday July 11, 2023 @09:44AM (#36680866)
break, continue, and even goto in any language created in the last several decades cannot leave the current function. These are not what Dijkstra was talking about. Dijkstra wrote the piece when structured programming was just starting to become a thing and was urging people towards it. Think more like goto in BASIC, where there is no bridling of the operator.
Re:Meta’s Microservice Architecture [pdf] by gordian-not on Tuesday July 11, 2023 @11:36AM (#36682482)
Yes, however I am not sure if Dijkstra meant goto in the sense of jump outside of a function. I don't know enough about Algol 60 and languages of the time, but if you allow usage of goto between different functions you will have a corrupt stack in no time, so I'll be surprised if it was implemented.

Going back to the original discussion, my point was that the only statements that are real gotos still in usage (except for C cleanup gotos) is break and continue, which even support labels

Re:Meta’s Microservice Architecture [pdf] by randomdata on Tuesday July 11, 2023 @12:04PM (#36682975)
Functions do not exist in the context of the "Go to statement considered harmful" paper, so there is no good analog in there. Further, he is specific that it is only about unbridled gotos. continue and break are decidedly bridled. In reality, the paper just doesn't apply to any language created in the last several decades, even those which use the goto keyword. We bought in to structured programming.

Except I posit that throw/catch still suffers the same problem he speaks of. It becomes difficult to follow when and where the code will jump to an arbitrary spot. The harmful parts of goto live on. Granted, we are learning. Modern languages are abandoning the throw/catch concept.

Re:Meta’s Microservice Architecture [pdf] by gordian-not on Tuesday July 11, 2023 @12:32PM (#36683406)
I agree about the somewhat unexpectedness of exceptions, although it is much structured than gotos (you just go up the stack)

virtual polymorphism for example is completely unexpected, as well as function pointers and other constructs that in my opinion are harder to track than exceptions

Re:Meta’s Microservice Architecture [pdf] by whstl on Tuesday July 11, 2023 @06:05AM (#36678739)
Almost everything is a "rebranded goto". Functions, conditions, iteration, break/continue.

Doesn't mean that Dijkstra was wrong, or that they are the same as goto.

Also, throw/catch do quite more than a goto, though. It's not only about stack unwinding, it's about the ergonomics of not needing code that uses throw to have any information about where catch is located.

Sure you can simulate some use cases of try/catch with goto, but implementing the general case is much harder.

throw/catch is exactly the kind of good goto-replacement provided by "higher level" programming languages that Dijkstra is talking about in his paper.

Re:Meta’s Microservice Architecture [pdf] by gjvc on Tuesday July 11, 2023 @06:18AM (#36678868)
> Almost everything is a "rebranded goto". Functions, conditions, iteration, break/continue.

That's like saying all maths is just the application of addition.

Re:Meta’s Microservice Architecture [pdf] by ubercore on Tuesday July 11, 2023 @06:37AM (#36679028)
I think that's the point -- it's nearly as useless to call throw/catch a rebranded goto as it is anything else.
Re:Meta’s Microservice Architecture [pdf] by whstl on Tuesday July 11, 2023 @07:57AM (#36679723)
Yeah. It’s a useless pedantism that serves no purpose in most discussions.

That’s what I have “rebranded goto” in quotes. And that’s what I address in the second paragraph.

Re:Meta’s Microservice Architecture [pdf] by gjvc on Wednesday July 12, 2023 @11:47AM (#36696375)
it failed to satisfy me
Re:Meta’s Microservice Architecture [pdf] by randomdata on Tuesday July 11, 2023 @09:30AM (#36680685)
> Almost everything is a "rebranded goto". Functions, conditions, iteration, break/continue.

Not within the context of discussion, where goto refers to the harmful kind. Throw/catch exhibits the very problem Dijkstra was talking about, with execution jumping all over the place haphazardly. Functions, conditions, iteration, break/continue, even (C-style) goto does not exhibit the same problem. They are strictly bridled in the execution scope.

There is good reason why modern languages are moving away from throw/catch. However, there is little question that it is still widely used at this time.

Re:Meta’s Microservice Architecture [pdf] by patmorgan23 on Tuesday July 11, 2023 @10:25AM (#36681424)
Throw is much worse than GOTO. GOTO is explicit you always know where it goes. Throw has no idea where catch is and catch has no idea where throw is. It's hidden control flow.

Go/Rust/Zig Errors as values is a much better system forcing you to explicitly deal with the error, crash or pass it on. Rather than hoping you handled all the correct exceptions/someone else will handle all of them.

Re:Meta’s Microservice Architecture [pdf] by o1y32 on Tuesday July 11, 2023 @12:08PM (#36683038)
If this were a top level comment I am sure you'll get 20 people disagree with you on this
Re:Meta’s Microservice Architecture [pdf] by randomdata on Thursday July 13, 2023 @10:03AM (#36709319)
Even Dijkstra followed up the "Go To Statement Considered Harmful" letter with the "On a Somewhat Disappointing Correspondence" letter because "20" people disagreed with him.

There will always be naysayers. The above is starting to become generally accepted, though, and modern languages are moving away from the practice just as languages moved away from unbridled gotos.

Re:Meta’s Microservice Architecture [pdf] by fvdessen on Tuesday July 11, 2023 @06:13AM (#36678822)
The thing is they are not harmful, they are valuable above a certain scale. To caricature, monoliths scale with O(n) and microservices O(nlogn). At some point the lines cross and microservices start to get better. The problem is there's no clear answer to where is that point as it also depends on the product being built and other company specifics. But I wouldn't see it being usually worthwhile below a hundred devs.
Re:Meta’s Microservice Architecture [pdf] by jcparkyn on Tuesday July 11, 2023 @08:09AM (#36679836)
Your analogy is backwards, nlogn > n.
Re:Meta’s Microservice Architecture [pdf] by pc86 on Tuesday July 11, 2023 @11:44AM (#36682621)
They're saying that microservices scale much worse than monoliths at the beginning, and need to reach a certain scale before they're worth the effort. The debate around is usually around where that inflection point is, and to a lesser degree if there are other non-scale advances to microservices that might make it worth adopting sooner.
Re:Meta’s Microservice Architecture [pdf] by nonameiguess on Tuesday July 11, 2023 @11:56AM (#36682830)
This comment was grayed out at the time I upvoted and am commenting. Either readers don't appreciate pedantry or don't realize what the point was, but for any n > 2, n * logn is a larger number than n.

I believe what the original poster meant to say was microservices grow like O(klogn) and monoliths O(n), i.e. microservices have some upfront constant cost that is large enough that, for small projects, monoliths will still perform adequately and be cheaper to develop and deploy. Once you exceed n large enough to overcome that upfront constant cost, microservices become the superior option.

I'm not agreeing or disagreeing with this, by the way.

Re:Meta’s Microservice Architecture [pdf] by fvdessen on Tuesday July 11, 2023 @12:10PM (#36683062)
Indeed that's what I meant, but cannot edit my comment.
Re:Meta’s Microservice Architecture [pdf] by inkyoto on Wednesday July 12, 2023 @12:03AM (#36690335)
Neither agreeing nor disagreeing, either, but the thing is… that both, monoliths and µ-services, are loose concepts, and they mean different things to different people and/or in differing circumstances.

A monolith itself can be monolithic either at the design level (only the whole thing can build and work) or at the deployment level (multiple components build, test and – to a certain extent can work – independently of each other but are assembled into a single deployment unit).

As far as differing viewpoints are concerned, let's consider a hypothetical design where GET, POST, PUT, PATCH and DELETE are a «µ-service» design and deploy as 5x distinct deployment units but as the whole and at once, i.e. leaving the DELETE out of the deployment renders the solution inoperable from the business POV. So far so good, we have a conventional µ-service.

Let's now consider a hypothetical yet real scenario where a single POST invocation triggers a chain of 27x service invocations to 10x different systems to produce a result. The implementation is stateless and idempotent, but the processing logic is complex, and it has to be executed in a particular sequence, intermediate results have to collated or fed into the next processing step – either sequentially, or in parallel, or both. And the processing can't be refactored out into smaller components due to the complexities or the business logic or due to technical constraints that the 10x external systems impose. Is the implementation of POST a µ-service, or POST is a monolith, or POST is a monolith within a µ-service? It can be either, neither or both – depending on the point of view. Such hypothetical design are, in fact, real and are fairly common in large environments.

On the scalability point, there is no single answer, either. A design can have scalability constraints either at the design level or at the deployment level. An example of the design level constraint is the strict processing order requirement that imposes substantial restrictions on what and how it can be scaled. It can typically only scale up but not out with not much room to wiggle around in. If the processing order is not important (i.e. the eventuality – not the linearity – is the only requirement), then scalability (up and out) becomes a deployment level constraint which is easy to fix (i.e. a configuration time or an auto-scaling policy change).

Scalability can also be impaired in both, monoliths and µ-services, if at least one external system is slow to respond, or the response time varies. In such a case, both designs will equally suffer.

> […] and be cheaper to […] deploy.

I have deliberately omitted the «develop» part to emphasise the «deploy» part. The deployment cost has gone down significantly over the last decade alone. What used to be an arduous task requiring a coordination of multiple people has now become a few line deployment file change and a one person job in many cases. Even complex deployments are much easier now than they had ever been. Therefore, I would posit that the cost of monolith and µ-service deployments is roughly the same today compared to monoliths being cheaper to deploy 10+ or so years ago.

Re:Meta’s Microservice Architecture [pdf] by pjmlp on Tuesday July 11, 2023 @12:37PM (#36683469)
Thing is, contrary to GOTO, microservices help selling books, conferences and consulting services.