←back to thread

1087 points smartmic | 10 comments | | HN request time: 1.273s | source | bottom
Show context
anthomtb ◴[] No.44303941[source]
So many gems in here but this one about microservices is my favorite:

grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too

replies(8): >>44304390 #>>44304916 #>>44305299 #>>44305300 #>>44306811 #>>44306862 #>>44306886 #>>44309515 #
default-kramer ◴[] No.44304916[source]
I'm convinced that some people don't know any other way to break down a system into smaller parts. To these people, if it's not exposed as a API call it's just some opaque blob of code that cannot be understood or reused.
replies(5): >>44304992 #>>44305050 #>>44307611 #>>44308060 #>>44310571 #
1. dkarl ◴[] No.44304992[source]
That's what I've observed empirically over my last half-dozen jobs. Many developers treat decomposition and contract design between services seriously, and work until they get it right. I've seen very few developers who put the same effort into decomposing the modules of a monolith and designing the interfaces between them, and never enough in the same team to stop a monolith from turning into a highly coupled amorphous blob.

My grug brain conclusion: Grug see good microservice in many valley. Grug see grug tribe carry good microservice home and roast on spit. Grug taste good microservice, many time. Shaman tell of good monolith in vision. Grug also dream of good monolith. Maybe grug taste good monolith after die. Grug go hunt good microservice now.

replies(4): >>44305340 #>>44305660 #>>44307196 #>>44312789 #
2. stavros ◴[] No.44305340[source]
We've solved this problem by making the modules in the monolith only able to call each other from well-defined APIs, otherwise CI fails.
replies(2): >>44305435 #>>44309744 #
3. PaulHoule ◴[] No.44305435[source]
In the Java world both Spring and Guice are meant to do this, and if you have an ISomething you've got the possibility of making an ILocalSomething and a IDistributedSomething and swap one for the other.
replies(1): >>44305671 #
4. pbh101 ◴[] No.44305660[source]
Maybe the friction imposed to mess up the well-factored microservice arch is sufficiently marginally higher than in the monolith that the perception of value in the factoring is higher, whereas the implicit expectation of factoring the monolith is that you’ll look away for five seconds and someone will ruin it.
5. pbh101 ◴[] No.44305671{3}[source]
This is generally a bad idea imo. You fundamentally will have a hard time if your api is opaquely network-dependent or not. I suppose, you’ll be ok if you assume there is a network call, but that means your client will need to pay that cost every time, even if using the ILocal.
replies(1): >>44305772 #
6. PaulHoule ◴[] No.44305772{4}[source]
It depends on what the API is. For instance you might use something like JDBC or SQLAlchemy to access either a sqlite database or a postgres database.

But you are right that the remote procedure call is a fraught concept for more reasons than one. On one hand there is the fundamental difference between a local procedure call that takes a few ns and a remote call which might take 1,000,000 longer. There's also the fact that most RPC mechanisms that call themselves RPC mechanisms are terribly complicated, like DCOM or the old Sun RPC. In some sense RPC became mainstream once people started pretending it was REST. People say it is not RPC but often you have a function in your front end Javascript like fetch_data(75) and that becomes GET /data/75 and your back end JAXB looks like

    @GET
    @Path("/{id}")
    public List<Data> fetchData(@PathParam("id") int id) { ... }
7. vharish ◴[] No.44307196[source]
I think monoliths are not such a good idea anymore. Particularly with the direction development is going w.r.t the usage of LLMs, I think it's best to break things down. Ofcourse, it shouldn't be overdone.
replies(1): >>44307306 #
8. discreteevent ◴[] No.44307306[source]
> grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too

> I think it's best to break things down

Factoring system = break things down.

9. williamdclt ◴[] No.44309744[source]
I honestly think it's the only way outside of one-person projects (and even then...), you need _some_ design pressure.
10. manmal ◴[] No.44312789[source]
Put the modules in different git repos and interfaces will get super clean eventually.