News for hackers. Stuff that matters.
Re:Kernighan and Pike were right: Do one thing, and do it well by francasso on Saturday August 19, 2023 @04:59AM (#37186877)
You don't need a damn network between two pieces of code just to "do one thing and do it well", for God's sake, I'm so sick of this rampant cluelessness in the industry.

Do you saturate the resources of one machine and need to split things off? Do you have multiple teams each taking care of their own stuff? Do multiple services, it's fine in those cases. For almost any other reason you are just adding complexity, boilerplate and additional failure conditions.

If you think that microservices solve the "spaghetti code problem", well, good luck to you, you'll need it.

Re:Kernighan and Pike were right: Do one thing, and do it well by hickelpickle on Saturday August 19, 2023 @05:42AM (#37187079)
I also don't get the comparison to UNIX philosophy into the domain of service development. These are totally different domains with their own patterns of resource usage and interaction. Piping "fairly" simple input -> output code that is sharing machine resources and releasing them at the end of execution is total different than running a micro service architecture across multiple containers/hosts. Even if some of them share the same host there is still extra resource overhead from their allocations that will have a constant baseline.
Re:Kernighan and Pike were right: Do one thing, and do it well by jacquesm on Saturday August 19, 2023 @06:24AM (#37187301)
Unix has a lot of services that listen to 'localhost'. It has had elements of a service oriented architecture since the first daemon was launched, even though the IPC endpoint wasn't always something listening to a socket.
Re:Kernighan and Pike were right: Do one thing, and do it well by lijok on Saturday August 19, 2023 @05:28AM (#37187022)
> If you think that microservices solve the "spaghetti code problem", well, good luck to you, you'll need it.

That is a very good point. In fact, good monolithic code layout is a precursor for microservices, as only once you have identified your boundaries and isolated your concerns can you begin splitting them out into their own services.

I will say this however - microservices might not solve the "spaghetti code problem", but it definitely helps isolate it. When we get consultants in to speedboat a new system, we give them their own separate service. Saves a lot of time and de-risks our beautiful monolith.

Re:Kernighan and Pike were right: Do one thing, and do it well by qaq on Saturday August 19, 2023 @05:34AM (#37187046)
Have your teams use façade pattern and you no longer need microservices to "isolate it"
Re:Kernighan and Pike were right: Do one thing, and do it well by lijok on Saturday August 19, 2023 @05:46AM (#37187098)
Facade doesn't help with poor tests, scripts, new dependencies, cicd workflows, repo settings, etc
Re:Kernighan and Pike were right: Do one thing, and do it well by monsieurbanana on Saturday August 19, 2023 @06:29AM (#37187324)
If it's that bad, you might be better off paying extra to avoid shitty outsourcing companies.

But you're probably not the person I should telling this, developers aren't usually in charge of that.

Re:Kernighan and Pike were right: Do one thing, and do it well by jacquesm on Saturday August 19, 2023 @06:59AM (#37187481)
Who mentioned outsourcing?
Re:Kernighan and Pike were right: Do one thing, and do it well by andsoitis on Saturday August 19, 2023 @07:21AM (#37187639)
> Who mentioned outsourcing?

lijok wrote:

When we get consultants in to speedboat a new system, we give them their own separate service. Saves a lot of time and de-risks our beautiful monolith.

Re:Kernighan and Pike were right: Do one thing, and do it well by lijok on Saturday August 19, 2023 @07:12AM (#37187581)
You wont know how bad the product produced by consultants will be until it already had effect.

And on pricing specifically, both shitty and good consultancies charge about the same. The ones that charge well below market are an outlier that will guarantee bad product - those are to be avoided.

Re:Kernighan and Pike were right: Do one thing, and do it well by otikik on Saturday August 19, 2023 @06:44AM (#37187408)
Micro services don’t solve any of those either.
Re:Kernighan and Pike were right: Do one thing, and do it well by lijok on Saturday August 19, 2023 @07:10AM (#37187569)
What specifically do they not solve? Because in this thread we're, very specifically, discussing isolating the well maintained monolith from risky product produced by consultants, which microservices absolutely do solve.
Re:Kernighan and Pike were right: Do one thing, and do it well by LeBit on Saturday August 19, 2023 @08:42AM (#37188196)
I think the hot trend these days is to bash on microservices. I hear that a lot here, random blogs, youtube videos by self proclaimed top guns.

If hacker news is correct, microservices is the #1 worst idea of software engineering.

And whoever promotes them is either a kid with no experience or a complete moron.

Re:Kernighan and Pike were right: Do one thing, and do it well by discreteevent on Saturday August 19, 2023 @10:53AM (#37189407)
Well, speaking for myself, I was against them from the start. Maybe the rejection of distributed objects (when it came) was a hot trend also but it didn't make it wrong.
Re:Kernighan and Pike were right: Do one thing, and do it well by otikik on Saturday August 19, 2023 @07:38PM (#37194467)
Any of the problem above.

If you have a problem with bad consultants then solve that. Trying to solve it by jumping into microservices you will just have bad consultants writing your microservices equally badly, or even worse.

Re:Kernighan and Pike were right: Do one thing, and do it well by qaq on Saturday August 19, 2023 @10:30AM (#37189168)
Yep and people you do not trust should not have access to CI/CD workflows and repo settings. Your CI/CD workflows should prevent everything else you mentioned.
Re:Kernighan and Pike were right: Do one thing, and do it well by prakhar897 on Saturday August 19, 2023 @07:07AM (#37187544)
Can your "facade" "isolate" interns making change in your service as well so that the whole service which powers the system doesn't go down. Microservices can.
Re:Kernighan and Pike were right: Do one thing, and do it well by ivanhoe on Saturday August 19, 2023 @07:26AM (#37187657)
If that happens it's an organizational problem (lack of mentoring, code reviews, access control), not an architectural problem...
Re:Kernighan and Pike were right: Do one thing, and do it well by ahtihn on Saturday August 19, 2023 @07:11AM (#37187577)
You let interns push to production without code review?
Re:Kernighan and Pike were right: Do one thing, and do it well by prakhar897 on Saturday August 19, 2023 @07:26AM (#37187659)
Totally missed the point. Even with Code reviews, Unit/Integration Testing, Automated CI/CD and more can a person broke the prod.

One intern was told to deploy the app and I guess he made a mistake and updated k8 configs which deleted all the pods. Tell me how code reviews are supposed to catch it.

If you think "why not restrict config actions" etc, it's because the dev can go there and tweak those actions too. And each step added means less velocity of development. It's a game of cat and mouse. With isolation, you can limit the blast radius and loss of revenue.

Re:Kernighan and Pike were right: Do one thing, and do it well by sapiogram on Saturday August 19, 2023 @08:51AM (#37188261)
> Automated CI/CD

[...]

> One intern was told to deploy the app and I guess he made a mistake and updated k8 configs which deleted all the pods. Tell me how code reviews are supposed to catch it.

These sound contradictory to me. Part of having automated CI/CD, is not having to manually deal with k8s to do a regular deploy.

Re:Kernighan and Pike were right: Do one thing, and do it well by ahtihn on Saturday August 19, 2023 @10:22AM (#37189079)
> One intern was told to deploy the app and I guess he made a mistake and updated k8 configs which deleted all the pods. Tell me how code reviews are supposed to catch it.

So you don’t have a staging environment to check config changes before deploying to prod? Or you don't put k8s manifests (or helm charts or whatever)in source control and just update prod through CLI? And you let interns do it alone?

Your problem isn't interns, it's a terrible deployment processs with weak controls. Even senior engineers are going to break prod regularly in conditions like that.

Re:Kernighan and Pike were right: Do one thing, and do it well by josephg on Saturday August 19, 2023 @07:15AM (#37187598)
Elixir can. I’m not in any hurry to use it, but I suspect there’s a lot we still have to learn from its design.
Re:Kernighan and Pike were right: Do one thing, and do it well by ninkendo on Saturday August 19, 2023 @08:41AM (#37188176)
I don’t understand how micro services prevent a system from “going down”. I pushed an infinite loop to the auth service, oops. Now nothing works. How did micro services prevent this?
Re:Kernighan and Pike were right: Do one thing, and do it well by qaq on Saturday August 19, 2023 @10:33AM (#37189200)
Sure with proper CI/CD in place which you need regardless of app being a monolith or a set of micorservices. It's also infinitely simpler to setup proper CI/CD for a monolith.
Re:Kernighan and Pike were right: Do one thing, and do it well by renegade-otter on Saturday August 19, 2023 @08:38AM (#37188160)
That is a very strategic and appropriate use of this pattern, and it's not even "microservices" - it's just goddamned "services"!
Re:Kernighan and Pike were right: Do one thing, and do it well by Kamq on Saturday August 19, 2023 @11:42AM (#37189876)
It also seems like an intentional wielding of Conway's Law.
Re:Kernighan and Pike were right: Do one thing, and do it well by hinkley on Saturday August 19, 2023 @11:44AM (#37189908)
Compartmentalization.
Re:Kernighan and Pike were right: Do one thing, and do it well by baz00 on Saturday August 19, 2023 @07:05AM (#37187521)
This. So much this. We are 5 years into a microservices wank-fest. So far the net ROI is negative, the user experience sucks more than ever, the complexity is so high that people can't get things done, nothing works properly any more and no one owns anything because they have washed their hands of it all. But this is still promoted as a success because no one wants to be accountable for the fuck up.

Our team spend most of the time designing fucked up messes that run over poorly designed APIs, slowly, that impact customers. If it's not that it's upgrading 100 services worth of dependencies constantly, debugging contract violations and weirdness or performance issues.

Re:Kernighan and Pike were right: Do one thing, and do it well by renegade-otter on Saturday August 19, 2023 @08:36AM (#37188141)
And if you say this at work, you are going to get a look as if you have grown three heads.
Re:Kernighan and Pike were right: Do one thing, and do it well by dgb23 on Saturday August 19, 2023 @08:54AM (#37188290)
One thing I wonder is this:

There are companies that are very successful and have split their service architecture into domain entities, called microservices.

Are they successful because or despite this decision?

Is both true in some sense?

A more natural way to split up a server architecture is to use computational boundaries. These are found by thinking of how data is processed and flows through the system as opposed to separation of high level domain concerns.

But this requires a computational design and not a domain/feature centric one.

Re:Kernighan and Pike were right: Do one thing, and do it well by baz00 on Saturday August 19, 2023 @10:29AM (#37189156)
There are successful companies that this model applies to. But the problem is that they are outliers.

The biggest problem with the whole IT industry is seeing outliers promoted as the successful path and people taking on faith arguments for technical decisions instead of rational decision making processes.

Re:Kernighan and Pike were right: Do one thing, and do it well by wazoox on Saturday August 19, 2023 @09:53AM (#37188811)
The code reflects the organisation, that's one of the laws of computing (Fred Brook's law maybe?). Microservices work well in a sufficiently large org, with autonomous entities working on different parts of the system, extremely well-defined interfaces between the services, and someone high up having a bird's eye view of the system.

If your organisation doesn't look like that, you can only fail at microservices. Either the company restructures around the code, or the code looks like the company. Trying to make pasta from mash potatoes is doomed to fail.

Re:Kernighan and Pike were right: Do one thing, and do it well by baz00 on Saturday August 19, 2023 @10:30AM (#37189171)
This is one reason I am an opponent of microservices generally. Every organisation I've worked for is made of shit and straw bound together with a solution of piss. ergo a monolithic crap pile is were they should aim.

Plus it's easier to run a hundred monoliths than it is to run 100 services. This is on the basis that running 100 instances of something the same with no inherent complexity in each instance is much easier to automate, build and manage than 100 things that are different and have to talk to each other.

Re:Kernighan and Pike were right: Do one thing, and do it well by zer8k on Saturday August 19, 2023 @11:08AM (#37189546)
> If it's not that it's upgrading 100 services worth of dependencies constantly, debugging contract violations and weirdness or performance issues.

Of all the reasons microservices are bad this isn't it. Your first point can be handled mostly automatically with half decent SRE tooling. Lock files on any modern language (including Python via poetry) fix dependency weirdness. Contract violations are a problem with your developers not the style of programming. As for performance I've been on both sides and being able to independently scale microservices via kubernetes is a god send. With proper tooling microservices work great.

The real problem with microservices is what you mentioned before that IMO. Complexity for complexity's sake. Some things are better as monoliths and some things are better as microservices. It's the same problem you see with normalization vs denormalization. Microservices are unambiguously faster in almost all cases. "Do one thing" means that one thing can be optimized to death, in isolation, without fear of interrupting other services. It also means team structures are easier to manage. Microservices don't mean pull in the entire universe of RESTful libraries and use exactly one feature for 1 or 2 endpoints.

But this introduces another problem:

A second managerial problem is that microservices are often used in scrappy startups with < 200 engineers. On any complicated platform this means one engineer might need to know how 10 services work. That's not feasible. You need to split it so a team owns a couple services and "does one thing right" (those services) and nothing else. It's the overapplication of microservices to every problem that is the source of most woes.

Startups will religiously apply microservices. The thought, of course, being that they can hire/fire faster and an outsourced engineer can probably pick up the necessary work quicker. Of course, this never happens, because instead of 10 microservices you have 300 and no one even knows where half of them are. 99% of the time it's not the pattern that is the problem. It's cargo culting. Just like everything else in the industry (looking at you electron, leetcode, functional programming, agile, etc).

Re:Kernighan and Pike were right: Do one thing, and do it well by UltimateEdge on Saturday August 19, 2023 @03:47PM (#37192393)
Why did you include functional programming in that list? It seems like the odd one out to me.
Re:Kernighan and Pike were right: Do one thing, and do it well by zer8k on Saturday August 19, 2023 @10:51PM (#37195608)
It's over applied in almost every professional context. I've watched entire codebases go from reasonably tolerable OOP to FP and the subsequent fallout. Usually, it's because some unhinged programmer starts adding stuff they like to a language it doesn't fit with. Then, you bring new developers on and no one wants to wade through the several layers of map/flatten/reduce/etc. Worse, the bolted-on FP is not optimized well by the compiler leading to worse than usual benchmarks. It's almost always a lose-lose except when it's done with a functional-first language.

It has it's purpose. It's almost universally over-applied owing to the cargo cult and holier-than-thou attitude of a lot of functional programmers. I see it happen in Python where comprehensions are often replaced with maps. While it is nice, the comprehension is more idiomatic and far more widely understood.

Re:Kernighan and Pike were right: Do one thing, and do it well by MyAccountYo on Saturday August 19, 2023 @07:06AM (#37187528)
I think you are misunderstanding the whole topic. Obviously it's about software at scale. Picking the right solution for a problem is kind of the whole job of software development.

I have gone through the migration of monoliths to microservices (yes, at scale with multiple teams and requirements to scale individual components etc.) and it solved a lot of problems.

The benefits outweigh the costs in my opinion (and drastically so).

When people say "you can write well separated components in a monolith..." I can only say: of course you could, but you are not going to (and certainly not everybody at your giant ass company is going to).

Re:Kernighan and Pike were right: Do one thing, and do it well by ivanhoe on Saturday August 19, 2023 @07:33AM (#37187708)
The problem is that most of people don't work in a giant ass company and so don't have the same problems you've had have, and thus they can achieve the same easier, faster and cheaper with monoliths - but they don't because of the hype.
Re:Kernighan and Pike were right: Do one thing, and do it well by francasso on Saturday August 19, 2023 @08:12AM (#37187955)
I don't know why you think you are better off with microservices.

I'm going to assume your monolith didn't require splitting things off for scaling purposes, and that a single team was working on it, otherwise, as I said I don't see a problem with services.

Let's also assume that you are not some manager that lead the transition but actually someone working day to day on the code, so you are talking from day to day experience rather than some made up fantasy. And let's assume that your team was able to figure out the microservices boundaries correctly for the current feature set that you support. Fine, now everything has been cleaned up and things are so much better.

Now, do you think you got to that point in your monolith because people that contributed to it are stupid? No, most of the time things start off clean (like your microservices architecture is now). But as time passes, and new requirements come in, the way you split things up in the beginning doesn't work well anymore. And you have a choice: refactor now or do some hack and push the mud ball down the line.

If your org wasn't able to keep a simple monolith clean with changing requirements, what makes you think that, now that the complexity of changing boundaries is 10x, things are going to be better in the future?

Re:Kernighan and Pike were right: Do one thing, and do it well by _shantaram on Saturday August 19, 2023 @07:06AM (#37187533)
"grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too

seem very confusing to grug"

-- https://grugbrain.dev

Re:Kernighan and Pike were right: Do one thing, and do it well by baz00 on Saturday August 19, 2023 @07:10AM (#37187570)
There is so much wisdom in here.

Fundamentally, don't make life hard for yourself, or others.

Re:Kernighan and Pike were right: Do one thing, and do it well by marcosdumay on Saturday August 19, 2023 @08:26AM (#37188052)
And yet defaulting into grug-mode is clearly self-defeating.

The wisdom only applies to the places where it applies, and there is no wisdom there on telling where those places are.

Re:Kernighan and Pike were right: Do one thing, and do it well by baz00 on Saturday August 19, 2023 @08:31AM (#37188089)
It's not really. Grug solves problems. Grug does not create problems that need to be solved to solve other problems.
Re:Kernighan and Pike were right: Do one thing, and do it well by marcosdumay on Saturday August 19, 2023 @08:38AM (#37188158)
> Grug solves problems.

Well, except for the problem of too much grug.

Re:Kernighan and Pike were right: Do one thing, and do it well by sph on Saturday August 19, 2023 @08:56AM (#37188302)
When a company measures developer productivity in code added and feature delivered, it creates a perverse incentive that attracts people that really love to write a lot of code and building mountains out of molehills.

The best engineer (and not only, see that famous quote by Kurt von Hammerstein-Equord) often is the lazy one. It was a known notion that somehow disappeared around the turn of the millennium.

Re:Kernighan and Pike were right: Do one thing, and do it well by baz00 on Saturday August 19, 2023 @10:27AM (#37189132)
Indeed.

We're still around. We're just so far up the hierarchy now that the wisdom can't be pushed down easily.

Re:Kernighan and Pike were right: Do one thing, and do it well by sph on Saturday August 19, 2023 @08:51AM (#37188260)
Fuck agile and 10x DevOps developers.

Who's hiring grugs, the lazy programmers that try to do the most efficient thing in the least amount of work? I'm not smart enough to set up a whole georeplicated k8s cluster for your blog. I'll use Apache, maybe put Varnish if you get on the frontpage of HN, ok?

(Work smart, not hard. DevOps today is the exact opposite of that)

Re:Kernighan and Pike were right: Do one thing, and do it well by AugustoCAS on Saturday August 19, 2023 @07:36AM (#37187726)
I agree with you. MS can be a solution to a few problems, and as you mentioned 'do one thing and do it well' is not one of them.

In my head MS works well for - Teams with different approaches. - Different tech stacks

I cannot think of another good reason in which MSs would be a better solution than a good monolith (and communication).

Re:Kernighan and Pike were right: Do one thing, and do it well by JohnAaronNelson on Saturday August 19, 2023 @08:09AM (#37187927)
Exactly what the article said. I feel like you are strongly asserting a key premise of the article as if you are saying something new.
Re:Kernighan and Pike were right: Do one thing, and do it well by marcosdumay on Saturday August 19, 2023 @08:24AM (#37188039)
> Do you saturate the resources of one machine and need to split things off?

No, of course not. We divide a single machine in an uncountable number of virtual ones; write some code to make sure they don't talk to each other; write some code to make them able to talk to each other; write some code make more or fewer divisions on the run, automatically; and write some code so we can set them up automatically too every time we get a new split.

That's how you use software scalability and create a simple, predictable ops environment.

Re:Kernighan and Pike were right: Do one thing, and do it well by dgb23 on Saturday August 19, 2023 @08:44AM (#37188204)
None of those things require you to introduce network calls.
Re:Kernighan and Pike were right: Do one thing, and do it well by renegade-otter on Saturday August 19, 2023 @08:46AM (#37188221)
And what if a certain permutation of these hundreds of services goes down or slows down? What if one service starts generating tons of data and floods another service? Do you have backpressure figured out? Distributed systems introduce a whole new level of complexity and edge cases, but most companies never even hit the scale at which it matters. It's just a pointless, wasteful exercise in "how they do it over at Google".
Re:Kernighan and Pike were right: Do one thing, and do it well by marcosdumay on Saturday August 19, 2023 @09:17AM (#37188461)
Nothing that can't be solved with more code and more splitting! That will make things simpler! The more problems your code causes, the more code, the more solutions!

(Well, ok, I'm having a hard time solving the first one with more code, but did hear this claim applied to it more than once, so I'm keeping it general.)

There is a huge amount of people that sees nothing wrong with my rationale up there. I don't get it either.

Re:Kernighan and Pike were right: Do one thing, and do it well by beebeepka on Saturday August 19, 2023 @01:50PM (#37191277)
Ignoring the sarcasm?
Re:Kernighan and Pike were right: Do one thing, and do it well by hinkley on Saturday August 19, 2023 @11:42AM (#37189888)
I can’t even get people to make new web pages in a web app past year 1. Everyone wants to just cram new features into whichever page makes the most sense, and so average page load time just gets worse and worse because we still want ### milliseconds but now the page is doing twice as much.