News for hackers. Stuff that matters.
Re:You Want Modules, Not Microservices by mpweiher on Tuesday January 03, 2023 @08:37AM (#34231113)
> Microservices [..] actually solve for a human problem in scaling up an organization.

So does modularity.

"The benefits expected of modular programming are: (1) managerial_development time should be shortened because separate groups would work on each module with little need for communication..."

On the Criteria To Be Used in Decomposing Systems into Modules, D.L. Parnas 1972.

http://sunnyday.mit.edu/16.355/parnas-criteria.html

Re:You Want Modules, Not Microservices by regularfry on Tuesday January 03, 2023 @08:57AM (#34231327)
Parnas was writing under an assumption of BDUF, big-bang releases, and expensive hardware instances. As soon as you want to decouple module deployments and accommodate changing requirements over time you need something else. That "something else" might be "making sure your modular monolith has a good enough test suite that any team can deploy it with only their changes" or it might be "microservices for all", but Parnas' assumption that independently verified modules will need to be built once by independent teams then function correctly when assembled has been comprehensively squashed in the last 50 years.

He's right as far as Conway's Law goes, though.

Re:You Want Modules, Not Microservices by unwind on Tuesday January 03, 2023 @09:17AM (#34231576)
Here I guess BDUF = big design up front.

Edit: failed to spell "I" correctly. Ouch.

Re:You Want Modules, Not Microservices by treis on Tuesday January 03, 2023 @09:25AM (#34231678)
Can you explain why you can deploy microservices independently but not modules?
Re:You Want Modules, Not Microservices by regularfry on Tuesday January 03, 2023 @09:54AM (#34232094)
You can deploy modules independently, but the technical and organisational measures you need in place to do it safely are an extra step you need to take whereas with microservices they're built in. Modules live in the same execution context, so you need a good shared ownership model for that context itself.

The point is that Parnas never conceived of doing it because he was writing about a world where the interfaces between modules were known ahead of time and were static.

Re:You Want Modules, Not Microservices by treis on Tuesday January 03, 2023 @10:23AM (#34232504)
You need to do additional steps in both cases:

With modules you need some sort of wrapper application to bring it all together.

With microservices you need some sort of network layer so that the microservices can talk to each other.

Re:You Want Modules, Not Microservices by regularfry on Tuesday January 03, 2023 @10:26AM (#34232568)
And also with modules you need the business processes to coordinate deployments across teams, because they all live in the same wrapper application. That's what stops them being independent.

You don't restart the network every time you deploy a microservice.

Re:You Want Modules, Not Microservices by treis on Tuesday January 03, 2023 @10:42AM (#34232847)
>And also with modules you need the business processes to coordinate deployments across teams, because they all live in the same wrapper application. That's what stops them being independent.

If we're being technical some languages support hot swapping modules so no restart would be needed. Setting that aside, restarting an application isn't anything that needs coordination today. You wouldn't even restart the application. You'd deploy a new version, swap over, and shut down the old version.

>You don't restart the network every time you deploy a microservice.

No, but something changes in the network configuration so that the other microservices are aware of the deployment.

Re:You Want Modules, Not Microservices by pjmlp on Tuesday January 03, 2023 @10:03AM (#34232220)
Same thing with microservices, unless you do a blue green deployment, have a planned shutdown, load balancer in between releases,...
Re:You Want Modules, Not Microservices by regularfry on Tuesday January 03, 2023 @10:24AM (#34232521)
The key word is "independently".
Re:You Want Modules, Not Microservices by pjmlp on Tuesday January 03, 2023 @10:29AM (#34232607)
There is no independently in distributed systems.
Re:You Want Modules, Not Microservices by regularfry on Tuesday January 03, 2023 @10:37AM (#34232764)
You can't solve the halting problem either, and yet somehow useful work gets done.
Re:You Want Modules, Not Microservices by jacobr1 on Tuesday January 03, 2023 @11:01AM (#34233138)
But there are rules of blame.

With microservices, as long as you maintain the contract with caller services, you can deploy whenever you want. If you have some kind of issue, your team is solely responsible. If the caller services do weird things, they are responsible for fixing them.

If you are pushing changes to a module as part of a more monolithic, or wrapper service - if you do a deploy and break the whole big service, you are now responsible for the entirety of any issue, which is now more likely due to integration risk and unrelated changes from others, especially because now there need to be coordination across many teams integrating - hopefully via tests and observability. But this requires a high-degree of maturity for automated quality assurance and site reliability. If you don't have that, the operational risks are very high. So that alternative is having some ops-like function, or other integration team responsible. Or doing more top-down waterfall coordination.

Given the service maturity needed is rare, microservices distributes that operational ownership in a way where there is more accountability.

Re:You Want Modules, Not Microservices by pjmlp on Tuesday January 03, 2023 @11:30AM (#34233618)
Unless there is infrastructure in place good luck replicating those dropped requests as services are replaced.

Infrastructure that someone has to take care of.

Re:You Want Modules, Not Microservices by Pet_Ant on Wednesday January 04, 2023 @12:05PM (#34248216)
Every organisation I've worked at that had microservices has had all of them released every other Thursday at the same time by the same pipeline because they are tied to the organisation scrum schedule. Also, most changes are part of epics that span multiple microservices. If you are gonna argue that properly done microservices don't have that problem you are free to practice your perfect microservices alongside perfect scrum, oop, and communism.
Re:You Want Modules, Not Microservices by jacobr1 on Wednesday January 04, 2023 @02:22PM (#34250116)
I was arguing the opposite, coordinated deployments already presumes more maturity than I was considering. I've only been at one company with same-day deployments. All the other places have been free-for-alls where each group determines their own release schedule, with their own pipelines. Managing deployments between dependent services thus requires significant coordination overhead (or none, because you are stuck with what you get until the other teams deliver your needs on their own timeline).

In chaotic environments like that, microservices help with defining clear ownership of operational responsibility, though at the cost of clear responsibility for the overall distributed system. This comes at the cost of making it hard to develop, let alone ship, changes that impact multiple microservices (outside the scope of a single team, or closely related sibling teams).

The main point I was making was that, with a more monolithic system, managing that kind to organization disfunction, necessitates top-down, waterfall like control. So moving to microservices enables non-coordinated agility removing one layer of coordination problem (a the cost of other problems).

Re:You Want Modules, Not Microservices by dkarl on Tuesday January 03, 2023 @11:05AM (#34233198)
> the technical and organisational measures you need in place to do it safely are an extra step you need to take whereas with microservices they're built in

They aren't built in, it's just that the need for them is impossible to ignore. Developers (and management) can't help but recognize and respect modularity in microservices because the separation of services and the APIs between them make the modularity obvious. When the separation between modules only exists in code, and even then only when seen through the eyes of someone who understands the modular architecture of the codebase, it is easily ignored, inevitably forgotten, and might as well not exist at all.

Re:You Want Modules, Not Microservices by esailija on Wednesday January 04, 2023 @04:53AM (#34243837)
Module is not just code in a separate file. Litmus test: if you cannot have two modules be written in separate languages - you don't have modules. M

If all modules have to be deployed using the same build even though different build of the modules would have been API compatible - you don't have modules.

Re:You Want Modules, Not Microservices by int_19h on Thursday January 05, 2023 @05:03PM (#34267499)
That sounds way too strict to me. A C++ app might use the C++ ABI to communicate with its modules, which would preclude writing them in any other language without jumping through too many hoops. But that's an ABI constraint and says nothing about the actual modularity of the application.

IMO a module is defined as something that has a self-contained API, and versioning rules for that API if the module is evolving.

Re:You Want Modules, Not Microservices by dkarl on Tuesday January 03, 2023 @10:59AM (#34233097)
For code modularity to serve the same purpose, I think there needs to be explicit language-level support, because on a medium-sized or larger project, when the modularity exists only in the minds of developers, it might as well not exist at all. You need virtually all of your developers to understand the design and respect the seriousness of violating it, and beyond a certain project size, that isn't possible.

Developers do a much better job with microservices. I think it's easy for them to respect the seriousness of designing and changing the API of a microservice. In contrast, they often don't respect or even realize the seriousness of making a change that affects the modular design of code.

Language-level support for defining and enforcing module interfaces might help developers invest the same level of care for module boundaries in a modular monolith as they do in a microservices architecture, but I've yet to work in a language that achieves this.

Re:You Want Modules, Not Microservices by JAlexoid on Tuesday January 03, 2023 @07:13PM (#34240024)
You would hope so... but it's not necessarily the case.

Often people are too lazy to issue API version change on a "bugfix", and take down multiple applications.

Funny thing, a modularized monolith may have identified some of those issues.

Re:You Want Modules, Not Microservices by LAC-Tech on Tuesday January 03, 2023 @05:50PM (#34239282)
Off topic, but 70s computing papers are just the best aren't they?