News for hackers. Stuff that matters.
Re:I've been merging microservices back into the monolith by eightysixfour on Monday December 21, 2020 @02:28PM (#25498429)
This article absolutely nails it. Finally, recognition that microservices are a technical tool for solving a people and organizational problem. We need to understand that a lot of "new" technology paradigms (especially those coming down from FAANG or other large organizations) are often designed to solve the organizational problems of operating at scale, not to provide some kind of technical panacea we should all aspire to built towards.
Re:I've been merging microservices back into the monolith by humanrebar on Monday December 21, 2020 @04:51PM (#25500052)
> ...microservices are a technical tool for solving a people and organizational problem

They're also available to solve technical problems. For instance, it's hard to run some python3.5 and some python3.9 in a python monolith. A monolith must choose one python version and cut over en masse at some point. Microservices allow more gradual adoption (in production, not just in test suites!) of low level technology changes.

Re:I've been merging microservices back into the monolith by JamesBarney on Tuesday December 22, 2020 @03:18AM (#25504130)
Solving the problem of needing to run two different technology stacks by running two different technology stacks is decades older than the concept of micro services.

I'm a huge monolith proponent. But that doesn't mean I think every application should be one service. I just believe you shouldn't create a second service until you have a good reason to like "we need to run on two different tech stacks", or "our team is getting hard to manage let's split it into two teams that work on 2 services".

Re:I've been merging microservices back into the monolith by humanrebar on Tuesday December 22, 2020 @08:39AM (#25506101)
Problems are typically older than solutions, yes.

And it's simple to concede that monoliths need to be split sometimes. It's much harder in practice to do so. Most monoliths do not have standards, let alone enforcement mechanisms, to ensure that the design of the monoliths leave open splitting later. The things that can make that process difficult (or impossible) are many and subtle, such as global state, in process locks, interpreter protected consistency guarantees, disregard for ABI implications, etc. Having different processes (in production!) does guarantee that a snarl of those problems will not prevent splitting things up later.

Re:I've been merging microservices back into the monolith by JamesBarney on Saturday December 26, 2020 @01:24PM (#25545285)
> such as global state, in process locks, interpreter protected consistency guarantees,

If you need to share state or you need consistency/locking/transactions across bounded contexts on one service it's trivial to implement. But this can be incredibly difficult to do correctly across multiple servers. No one has implemented a multi-phase commit over multiple services and said "dang that was easy" afterwards.

Re:I've been merging microservices back into the monolith by hinkley on Tuesday December 22, 2020 @01:19AM (#25503509)
They're the cure and the disease.

Without a way to keep the system heterogeneous, people have to accept that they are on the same upgrade treadmill as the rest of the people in the organization, which means they have to constantly invest time and energy into keeping up with things.

Containers or microservices mean that the upgrade happens fifteen times, not once, and each group has their own little passion play about why they should do it later instead of now. And in the time it takes to argue about 15 upgrades, 2 more versions have come out.

Re:I've been merging microservices back into the monolith by still_grokking on Tuesday December 22, 2020 @06:07AM (#25505075)
This is the same issue as with static linking. This debate is quite old and was once "decided" already in favor of dynamic linking...

Using dynamically linked libraries enforces to upgrade all dependencies in lock-step. But you need to fix bugs or security issues only once for your whole software distribution.

Re:I've been merging microservices back into the monolith by danielheath on Monday December 21, 2020 @05:01PM (#25500140)
Right, but you can also eg run both versions of python on different machines and switch between them at the load balancer layer. That also lets you eg quickly roll back the upgrade from a single area.

You can do all these things either way. The question is which way suits your tools and organisational structure.

Re:I've been merging microservices back into the monolith by humanrebar on Monday December 21, 2020 @05:57PM (#25500708)
But if you have a lot of migration to do, you're keeping compatibility across the whole stack that entire time. If you have more atomic processes, the trivial ones get migrated trivially and aren't forced to carry technical debt for extended periods of time.

And there are worse scenarios than python upgrades. What happens if your processor or your OS reaches end of life? Do you keep running the whole stack on Windows XP without security patches until the last bit is ready?

Re:I've been merging microservices back into the monolith by nicoburns on Monday December 21, 2020 @06:05PM (#25500783)
Hopefully you fix compatibility with newer versions of windows years before XP goes end of life. A lot of people seem to have created these problems for themselves by buying into proprietary platforms that then get yanked from underneath them. You can generally choose stacks that don't have this problem (or not to nearly the same degree).
Re:I've been merging microservices back into the monolith by danielheath on Monday December 21, 2020 @06:04PM (#25500775)
If some parts are running xp exposed and unpatched, your organisation needs to fix that before tackling application architecture. The question doesn’t make sense; I might as well ask which galaxy I should colonise.

No technique or tool will fix your organisation.

Re:I've been merging microservices back into the monolith by rualca on Monday December 21, 2020 @05:41PM (#25500549)
> Right, but you can also eg run both versions of python on different machines and switch between them at the load balancer layer.

That sounds to me like you are complementing the downsides of running a monolith with the downsides of operating a distributed system, without any noticeable upside.

Re:I've been merging microservices back into the monolith by danielheath on Monday December 21, 2020 @06:01PM (#25500748)
I should clarify; that technique doesn’t work if there are calls between systems on different versions unless they are tested on both.

I wouldn’t run a system where the two servers call one another.

This is a technique for reducing risk via toggles at the load balancer. The reduction is achieved by making it possible to deploy smaller changes to users, and by reducing the latency of rollback.

These are only useful if you have the ability to introspect the system state in production and confirm whether a new version is working correctly.

Re:I've been merging microservices back into the monolith by rualca on Tuesday December 22, 2020 @03:31AM (#25504214)
I still fail to see the point of your approach.

It sounds like you're referring to blue/green deployments without using it's name, for some reason, and while failing to present any case of why a monolith provides an advantage. You're just showing downsides without any upside as a tradeoff.

I mean, with microservices you can also do blue/green deployments, and they are not all-in like monoliths. Each deployment only covers a subset of features that can gradually be rolled in and out with the only risk of causing partial failures.

Re:I've been merging microservices back into the monolith by mejutoco on Monday December 21, 2020 @05:17PM (#25500280)
It is possible, and easy, to have two virtual environments with a different python version in the same project. I am doing this right now with a long-lived project, where a deploy script uses python 2 and everything else python 3.
Re:I've been merging microservices back into the monolith by humanrebar on Monday December 21, 2020 @05:54PM (#25500677)
Only in different processes.
Re:I've been merging microservices back into the monolith by NicoJuicy on Monday December 21, 2020 @06:33PM (#25501051)
That's not a big problem in a small org/app
Re:I've been merging microservices back into the monolith by burade on Monday December 21, 2020 @02:31PM (#25498465)
People are godamn hopeless.

I just saw a guy trying to argue that writing functional-style Java is the "new" way to write Java, and that not using functional interfaces means you're writing "old" style code.

Re:I've been merging microservices back into the monolith by lmm on Tuesday December 22, 2020 @04:07AM (#25504401)
> I just saw a guy trying to argue that writing functional-style Java is the "new" way to write Java, and that not using functional interfaces means you're writing "old" style code.

Sounds right to me. (Of course not having first-class functions was just as bad 20 years ago, but fewer people had realised it back then).

Re:I've been merging microservices back into the monolith by akmarinov on Monday December 21, 2020 @02:57PM (#25498820)
I don’t know about Java, but we’re seeing a shift to functional in the mobile space, where non functional code is definitely “old” code. In Swift with Combine and in Kotlin with their thing.
Re:I've been merging microservices back into the monolith by burade on Monday December 21, 2020 @03:17PM (#25499070)
"Old" in what sense though? In the style/fashion sense?
Re:I've been merging microservices back into the monolith by rualca on Monday December 21, 2020 @05:46PM (#25500602)
> "Old" in what sense though? In the style/fashion sense?

If you take the time to look into it, you'll discover that the functional style is only a change in the "fashion sense" to those who are totally oblivious to their advantages.

I get how the pedantic take on monads turns people away from the functional side of programming, but you'd be hard pressed to find anything to criticize how returning either/result monads from promises is not a huge improvement over the boilerplate-rich/pure OO approach to Java.

Re:I've been merging microservices back into the monolith by akmarinov on Monday December 21, 2020 @03:26PM (#25499170)
In the “writing non-functional code in 2 years will be the same as writing Objective-C today” sense.
Re:I've been merging microservices back into the monolith by Animats on Monday December 21, 2020 @03:29PM (#25499190)
I feel guilty when I write a FOR statement in Rust.
Re:I've been merging microservices back into the monolith by Spartan-S63 on Monday December 21, 2020 @04:39PM (#25499915)
Me too. Mostly because it’s a smell to me that I’m mutating some internal state. I try to avoid that as much as possible because it quickly becomes soup.
Re:I've been merging microservices back into the monolith by refactor_master on Monday December 21, 2020 @05:21PM (#25500332)
I feel guilty when my C# method isn’t immediately returning a LINQ expression.
Re:I've been merging microservices back into the monolith by ConcernedCoder on Monday December 21, 2020 @06:02PM (#25500762)
The contortions I see used day-to-day to write code in the latest/greatest pardigm du-jour is criminal... I routinely have to revisit "functional masterpieces" of "easy to grok" code, and completely re-write to minimize CPU and/or memory consumption.
Re:I've been merging microservices back into the monolith by coding123 on Monday December 21, 2020 @04:13PM (#25499620)
People are still using Java?
Re:I've been merging microservices back into the monolith by cmdshiftf4 on Monday December 21, 2020 @04:48PM (#25500021)
>People are still using Java?

C'mon, you've been around here long enough to know better than to be making such comments

https://insights.stackoverflow.com/survey/2020#most-popular-...

https://octoverse.github.com/

Re:I've been merging microservices back into the monolith by maya24 on Monday December 21, 2020 @04:33PM (#25499855)
Yes Java is uqititous and it's not going away for 30 years at least. See Cobol. Java also has had significant improvements in the language so that there is less incentive to use other JVM languages like kotlin and it's fully interoperable with heartland code bases as far as I know
Re:I've been merging microservices back into the monolith by gnat on Tuesday December 22, 2020 @02:51AM (#25503994)
Forgive my ignorance: what's a "heartland" code base?
Re:I've been merging microservices back into the monolith by imtringued on Monday December 21, 2020 @05:19PM (#25500317)
The number of flaws that make Java inferior to other JVM languages is surprisingly small. By far the worst parts are excessively verbose "Beans", nullpointer by default, the JEE ecosystem (there are good alternatives) and the high RAM consumption (a JVM flaw). Honestly 80% of the value I derive from using a different JVM language come from avoiding NPEs, getters and setters. The remaining 20% can be very useful but they are certainly not essential nor can they be considered mandatory.
Re:I've been merging microservices back into the monolith by eitland on Monday December 21, 2020 @05:00PM (#25500132)
Whenever possible, yes.

Sane language. Fantastic tooling. Huge ecosystem. Backwards and forwards compatible like few other things.

Re:I've been merging microservices back into the monolith by rualca on Monday December 21, 2020 @05:48PM (#25500623)
> People are still using Java?

Yes, pretty much the whole world is using Java. Some FAANGs use it as basically their default software stack, and at most have introduced some Kotlin along the way.

The world doesn't revolve around flavor of the month tech stacks.

Re:I've been merging microservices back into the monolith by onethought on Tuesday December 22, 2020 @06:54AM (#25505391)
It revolves around JavaScript I think. ;p
Re:I've been merging microservices back into the monolith by rualca on Tuesday December 22, 2020 @07:36AM (#25505650)
Javascript in the browser, Java everywhere else.
Re:I've been merging microservices back into the monolith by onethought on Tuesday December 22, 2020 @02:10PM (#25509913)
Sure, if node didn’t exist, you’d be close to right.

If you check GitHub JavaScript and typescript are outstripping Java.

Re:I've been merging microservices back into the monolith by hackerfromthefu on Tuesday December 22, 2020 @08:54AM (#25506261)
Username checks out ..

Have you ever heard of search bubbles?

Re:I've been merging microservices back into the monolith by mumblemumble on Monday December 21, 2020 @04:05PM (#25499520)
That seems like an unnecessarily confrontational way to put it.

What I would say is that, from a 10km perspective, functional interfaces are just where the Interface Segregation Principle takes you when you really lean into it, and that dependency injection can be thought of as just a convenient way to do partial application in bulk, and that CQRS encourages you to create an ever-wider separation between your commands and your queries, and that, in general, once you get far along where clean object-oriented design wants to lead you, the whole functional vs OO debate often starts to feel like it's quibbling about syntax as much as anything else.

Re:I've been merging microservices back into the monolith by drewcoo on Monday December 21, 2020 @05:32PM (#25500465)
I think you missed part of this, from the article (emphasis mine):

> Microservices Solve >Both< Technical and People Problems

Re:I've been merging microservices back into the monolith by eightysixfour on Monday December 21, 2020 @06:20PM (#25500932)
I'd love some additional examples of technical problems microservices solve that are unrelated to scaling the organization.

I've mainly come across the occasional one-off where a different language is significantly better suited to the problem at hand, so that has been broken out as its own service, and there's another one here in the comments about migrating a python application between versions (I could argue the semantics of microservice here, but I'll roll with it), but I have not come across many where a microservice was the "right" solution to a purely technical problem.

Re:I've been merging microservices back into the monolith by saberience on Tuesday December 22, 2020 @06:35AM (#25505260)
Microservices are easier to understand and debug.

This should speak for itself. If you ship a service which is well defined and only handles a reasonable amount of functionality, reasoning about its runtime behavior, memory, CPU usage, IO, etc, becomes much simpler.

Microservices are easier to test, either through unit testing, load-testing, integration testing etc. If you push a new version of a microservice and you see it's using more memory than the previous iteration, it's usually trivial to work out which line of code caused the change.

Microservices are mentally easier to grok for engineers working on them. I've worked on monoliths that required months for engineers to get up to speed on working with them because they did SO much stuff and if we had a memory issue with our monolith it could take weeks to diagnose the issue and we had to have our best engineers look at those problems because the service had grown so big and complex over many years.

Re:I've been merging microservices back into the monolith by eightysixfour on Tuesday December 22, 2020 @09:39AM (#25506627)
> Microservices are easier to understand and debug.

I think an individual microservice is easier to grok and debug, but I also think a system made of microservices is harder to understand and debug. Depending on scale this is a bit of a wash to me, YMMV.

Re:I've been merging microservices back into the monolith by yawnxyz on Tuesday December 22, 2020 @07:34AM (#25505642)
I broke out all our code for displaying public content into a few different microservices so my sites could easily grab them, which allowed me to play with different frameworks and ways to display our content (blog posts and directory/references for biology). The new content microservices endpoints are also a public (though undocumented) API as an extra bonus.

Basically it gave me the flexibility to work faster, and generating the code (e.g. the REST endpoint or the Svelte/Sapper front-end) is also a lot faster, and I get to host them on Vercel for free

Oh and it also helps me to separate business logic code and other not-so-public data to somewhere else (Heroku instead of Vercel) and it just runs completely separately. That way I don't have to worry about accidentally sharing data

As a solo designer/engineer this Vercel + microservices / tiny APIs + tiny frontends makes my life much easier

Re:I've been merging microservices back into the monolith by felixhuttmann on Tuesday December 22, 2020 @02:09AM (#25503773)
Examples:

1) Long-living connections. One part of your application offers large file downloads, so that your users sometimes take significant amount of time to download, and the error rate shall be low. Think people doing `curl -L https://github.com/.../some-commit-hash.zip` in CI. I'd guess this is not served by github's ruby monolith. Or you use websockets. Redeployments typically stop all running tcp connections. Splitting this part off allows you to redeploy the main application frequently without disrupting websockets or downloads.

2) Reduce startup time. For some languages/ecosystems, startup time is significant and scales with the size of the codebase. For example, a typical java enterpise app like keycloak has half a million lines of code and takes about 1 minute only for startup. This is even more relevant when running things in AWS Lambda or google cloud run, and can also be relevant for integration tests. Having several deployables each handling a subset of the functionality may give you better cold start times than having one that contains all code.

3) Resiliency toward resource exhaustion. If two functionalities are served in the same process or VM, and one of them

* has a memory leak

* uses the connection pool to the database inefficiently and thereby clogs it up

* has an endpoint that is overloaded by a misbehaving client

then the other functionality is also affected, which can be avoided by putting them into separate processes/containers/VMs. Splitting services allows to reduce the effort spent on resource hygiene and rate limiting.

4) Binary size. It is often convenient to compile static info or asset-like things into the application, think geoinformation on timezones. This bloats the binary, splitting that part off into an independent deployable can give you a much smaller binary for the main application.

Re:I've been merging microservices back into the monolith by eightysixfour on Tuesday December 22, 2020 @09:50AM (#25506735)
1) Sure, that may be an example of a good microservice, but I'm not sure that is a requirement to follow a broad microservices architecture. This can also be handled via proxies/load balancers and rolling deployments of monoliths.

2) Agreed, for individual services. Maybe/maybe not for the entire system.

3) I think this is generally true, but if you have a service that others are dependent on, you can still have these problems. Auth services for example (that was a fun day at work).

4) Sure, but now you have two binaries.

Re:I've been merging microservices back into the monolith by jzoch on Monday December 21, 2020 @02:47PM (#25498672)
I would say 99% of all articles on this site and r/programming on reddit have someone say exactly what you have - that microservices are an organizational tool. At this point your view is not an unpopular one.

However, microservices can also serve actual technical purposes too. But the nuances of accepting two viewpoints often placed in juxtaposition to one another is not internet friendly. Microservices, service oriented architecture, whatever you call it depends on your level of cynicism i suppose (or optimism?).

Re:I've been merging microservices back into the monolith by eightysixfour on Monday December 21, 2020 @02:53PM (#25498754)
I agree, I don't think my view is unusual or controversial, which is why it surprises me that the writers of the blog posts that get submitted to here or on r/programming rarely acknowledge both the technical and organizational aspects. Just yesterday there was the article "Back to the '70s with Serverless" which compared smalltalk and its fast feedback loops to the complexity of cloud and serverless computing and argued it was about good marketing.

So I will keep commenting that it isn't just about technical issues and it isn't just about organizational ones, and you must look at both to really understand what is going on.

But I probably did get a little too excited that a technical post acknowledged and made it an important point in their article.

Re:I've been merging microservices back into the monolith by rualca on Monday December 21, 2020 @05:38PM (#25500533)
> I would say 99% of all articles on this site and r/programming on reddit have someone say exactly what you have - that microservices are an organizational tool. At this point your view is not an unpopular one.

Microservices have been from the start an organizational tool, with reliability and the ability to scale horizontally to avoid constraints of vertical scaling trailing at second place.

The rationale is that the first bottleneck that is hit by a growing organization is developer's throughput (i.e., the ability to deploy bugfixes and features without hitting blockers due to multiple teams being affected by a changeset). After that point, a service has to grow a tad more until reaching a point where the requests bounded to a subset of features justifies peeling them out to independent services.