News for hackers. Stuff that matters.
Re:The Costs of Microservices by bob1029 on Monday October 30, 2023 @01:04PM (#38072226)
> And think of the sheer number of libraries - one for each language adopted - that need to be supported to provide common functionality that all services need, like logging.

This is the #1 reason we quit the microservices game. It is simply a complete waste of mental bandwidth to worry about with the kind of tooling we have in 2023 (pure cloud native / infiniscale FaaS), especially when you have a customer base (e.g. banks & financial instutitions) who will rake you over hot coals for every single 3rd party dependency you bring.

We currently operate with one monolithic .NET binary distribution which is around 250 megs (gzipped). Not even the slightest hint of cracks forming. So, if you are sitting there with a 10~100 meg SaaS distribution starting to get nervous about pedantic things like "my exe doesnt fit in L2 anymore", then rest assured - Your monolithic software journey hasn't even begun yet.

God forbid you find yourself with a need to rewrite one of these shitpiles. Wouldn't it be a hell of a lot easier if it was all in one place where each commit is globally consistent?

Re:The Costs of Microservices by _a_a_a_ on Monday October 30, 2023 @01:36PM (#38072710)
Word. BTDT, all services getting out of sync etc. Not worth it.
Re:The Costs of Microservices by tsss on Monday October 30, 2023 @01:53PM (#38073048)
No one says you can't have all of your microservices use the same language...
Re:The Costs of Microservices by bob1029 on Monday October 30, 2023 @02:08PM (#38073302)
Absolutely. This is how we operated when we were at the peak of our tech showmanship phase. We had ~12 different services, all .NET 4.x the exact same way.

This sounds like it could work, but then you start to wonder about how you'd get common code into those 12 services. Our answer at the time was nugets, but we operate in a sensitive domain with proprietary code, so public nuget services were a no go. So, we stood up our own goddamn nuget server just so we could distribute our own stuff to ourselves in the most complicated way possible.

Even if you are using all the same language and patterns everywhere, it still will not spare you from all of the accidental complexity that otherwise becomes essential if you break the solution into arbitrary piles.

Re:The Costs of Microservices by ValtteriL on Monday October 30, 2023 @04:10PM (#38075036)
Can't you share them via shared libraries in .NET?
Re:The Costs of Microservices by jcmontx on Monday October 30, 2023 @06:21PM (#38076765)
YMMV but I think you can only do that if you have a monorepo with the shared library and all the microservices
Re:The Costs of Microservices by Atotalnoob on Monday October 30, 2023 @06:46PM (#38076995)
You can, but it’s just kind of hinky, you end up relying on a specific path for the shared library
Re:The Costs of Microservices by lmm on Monday October 30, 2023 @08:36PM (#38078165)
Does .net not have a way to run simple private repository like Nexus? Over in JVM-land that's a basic thing that you'd be doing anyway.
Re:The Costs of Microservices by smaudet on Monday October 30, 2023 @09:48PM (#38079082)
It's the difference between drag-dropping a reference between "projects" or whatnot in your monolith project, or coming up with a publish pipeline after which your merged code gets into the repo so that other people can use it, if you have three projects in three checkouts that all have to be coordinated and merged in order so that you don't accidentally break your environment and worry about security and and and....

One is much simpler than the other. Artifact management is surprisingly complex, it only looks like it works great while you aren't managing many versions and acting more like a monolith, just spread across repos/deploy points.

Re:The Costs of Microservices by lmm on Monday October 30, 2023 @10:59PM (#38079712)
> It's the difference between drag-dropping a reference between "projects" or whatnot in your monolith project, or coming up with a publish pipeline after which your merged code gets into the repo so that other people can use it

You already have that pipeline for release/deployment though, don't you? (And it's already hooked up to your SSO or what have you).

> if you have three projects in three checkouts that all have to be coordinated and merged in order so that you don't accidentally break your environment and worry about security and and and....

It's the same as any other library dependency though, which is a completely normal thing to deal with. The cost of separating your pieces enough that you can use different versions of a library in different services is that you can use different versions of a library in different services.

I'm skeptical about microservices as a deployment model, but I'm absolutely convinced that code-level modularisation and independent release cycles for things that deploy independently are worthwhile, at least if your language ecosystem has decent dependency management.

Re:The Costs of Microservices by briHass on Monday October 30, 2023 @11:19PM (#38079864)
The only way package feed complexity works -- and really microservices in general -- is to be absolutely fastidious about backwards compatibility of your packages and as open as possible with transitive dependency versions.

Nuget does provide mechanisms for obsoleting packages, so it's reasonable to enforce that new packages should allow for a few versions worth of backwards compatibility before deprecation and finally pulling the plug.

Re:The Costs of Microservices by ljm on Monday October 30, 2023 @03:46PM (#38074684)
Ideally you would use the same language if it had distributed support. Use Erlang or Elixir for example and you have everything you need for IPC out of the box. Might take a little bit more effort if you're on Kubernetes.

One of my problems with microservices isn't really the services themselves, but the insane amount of tooling that creeps in: GRPC, Kafka, custom JSON APIs, protobufs, etc. etc. and a lot of them exist in some form to communicate between services.

Re:The Costs of Microservices by tsss on Monday October 30, 2023 @04:13PM (#38075093)
If you do so much IPC that you have to design your language around it you're probably doing it wrong. I don't think that moving to a monolith would really cut down that much on other technologies. Maybe you can do without Kafka, but certainly you will need some other kind of persistent message queue. You will still need API docs and E2E integration tests.
Re:The Costs of Microservices by jocaal on Monday October 30, 2023 @04:39PM (#38075460)
> If you do so much IPC that you have to design your language around it you're probably doing it wrong...

I'm gonna have to disagree with this. Often when languages add features to their core, it allows for a very different (and often better) approach to writing code. Think Lisp with first class functions, or Rust with the borrow checker. Why should concurrency be any different? This feels like a Blub moment and I would highly recommend you give erlang or elixir a try, just to see what it is about.

Re:The Costs of Microservices by tsss on Tuesday October 31, 2023 @08:17AM (#38083597)
If you need that much IPC then you aren't doing microservices correctly. Microservices are supposed to be independent, self-contained domains wherever possible. Purely technical boundaries like dedicated caching services that you see in very large companies like Google are more of an exception and should only be used when the non-functional requirements absolutely dictate it. A language that is designed around IPC wants to distribute dynamic parts of one application over multiple interchangeable compute resources (like in an HPC environment). This is a different thing altogether from microservices, which are self-contained applications working independently to each provide a fixed piece of the whole.
Re:The Costs of Microservices by ljm on Tuesday October 31, 2023 @09:32AM (#38084540)
The theory is that microservices are supposed to be independent and self-contained, but such a wonderful implementation of DDD is a theoretical fantasy that rarely plays out in practice. It's not just a technical difficulty but an organisational problem where communication between teams also throws a spanner in the works.

If your typical microservice setup is simply distributing your call stack over a network (and oftentimes that's all it is), then you might as well use a language designed to operate in such a manner and reap the benefits of it. That kind of microservice architecture only really exists as a function of the organisation's structure such that teams can work more autonomously.

Re:The Costs of Microservices by smaudet on Monday October 30, 2023 @09:55PM (#38079155)
"You will still need API docs"

Been free in my IDE since I compiled the code...

"E2E integration tests"

I can mostly run these on my machine, no need to stand up a cluster to get it running (bonus points if you virt multiple machines on one and still don't need the cluster for complex distributed scenarios).

"you will need some other kind of persistent message queue"

var queue = new Queue(); // then sometime later... queue.Save(); // or queue.EmplaceAndSave(); ... queue.Pop();

Trivial and didn't need a server to set it up.

Lots of tech stack stuff simply disappears without server boundaries and the like to get in the way. There is other tech you have to deal with, but at the small scales it mostly doesn't apply. Which, you as a dev are usually only working at small, testing scales, so you don't usually need to support it.

Re:The Costs of Microservices by tsss on Tuesday October 31, 2023 @08:09AM (#38083535)
> var queue = new Queue(); // then sometime later... queue.Save(); // or queue.EmplaceAndSave(); ... queue.Pop();

Yeah, no... you'll lose data for sure, you'll have race conditions or no cooperative queuing between multiple instances of the application. This is exactly the kind of half-assery that people resort to when they say monoliths are so much less complex than microservices. A good monolith still requires all the same hard decisions about modularity, high-availability etc.

Re:The Costs of Microservices by smaudet on Tuesday October 31, 2023 @03:59PM (#38090621)
Eh?

Default queue implementations come with co-operating queuing out of the box. I suppose you could use some hand-rolled queue with no internal locking, but this is disingenuous.

> you'll have race conditions or no cooperative queuing between multiple instances of the application.

You're thinking micro-service again here. There's no need to have multiple "instances" at all. Any concurrency is handled internal to the application itself with use of e.g. fibers, threads, etc. A good argument to why monoliths have drawbacks can't be "well its not a microservice". :)

> A good monolith still requires all the same hard decisions about modularity, high-availability etc.

Never said it didn't. What it doesn't require is all the tech stack to support that over many instances, because there's one instance. A large majority of µServices is just re-implementing what your runtime gives you for free.

Re:The Costs of Microservices by erik_seaberg on Wednesday November 01, 2023 @02:31PM (#38102746)
Sure, but even a monolith should store data on redundant hardware before launch, because commodity hardware isn’t completely reliable and neither are datacenters.
Re:The Costs of Microservices by switch007 on Tuesday October 31, 2023 @04:00AM (#38081489)
You need a CTO with a backbone to say no to the senior people hell bent on padding their resumes and scratching an itch though

Too often devs weaponise micro services and say it’s one of the key reasons for microservices is to allow free language choice !

Re:The Costs of Microservices by superfrank on Monday October 30, 2023 @02:21PM (#38073506)
I think this is a false dichotomy. Most places I've worked with microservices had 2 or 3 approved languages for this reason (and others) and exceptions could be made by leadership if a team could show they had no other options.

Microservices doesn't need to mean it's the wild west and every team can act without considering the larger org. There can and should be rules to keep a certain level of consistency across teams.

Re:The Costs of Microservices by orochimaaru on Monday October 30, 2023 @03:09PM (#38074229)
Not sure why you’re downvoted - but you’re right. We heavily use microservices but we have a well defined stack. Python/gunicorn/flask/mongodb with k8s. We run these on Kafka or rest api. We even runs jobs and corn jobs in k8s.

Functional decomp is left to different teams. But the libraries for logging, a&a, various utilities etc are common.

No microservices that don’t meet the stack unless they’re already developed/open source - eg open telemetry collectors.

Edit: I think the article is a path to a book written by the author. It’s more of an advertisement than an actual assessment. At least that’s my take on it.

Re:The Costs of Microservices by tcgv on Monday October 30, 2023 @06:32PM (#38076878)
> Most places I've worked with microservices had 2 or 3 approved languages for this reason (and others) and exceptions could be made by leadership if a team could show they had no other options.

This works well if you have knowledge redundancy in your organization, i.e., multiple teams that are experienced in each programming language. This way, if one or more developers experienced in language 'A' quit, you can easily replace them by rearranging developers from other teams.

In small companies, this flexibility of allowing multiple languages can result in a situation in which developers moving to other jobs or companies will leave a significant gap that can only be filled with recruiting (then onboarding), which takes much more time and will significantly impact the product development plan.

More often than not, the choice between Microservices and Monoliths is more of a business decision than a technical one to make.

Re:The Costs of Microservices by LelouBil on Monday October 30, 2023 @08:12PM (#38077901)
> More often than not, the choice between Microservices and Monoliths is more of a business decision than a technical one to make.

I think that, technically you can use one or the other and make it work. However management is very different in the two cases, so I completely agree with you. I hadn't thought of the part about moving people between teams.

It's my first job but I understand why they chose microservices : 6 teams working on 6 "features/apps" can be managed (almost) fully independently of each other if you split your code base.

Re:The Costs of Microservices by nijave on Monday October 30, 2023 @06:39PM (#38076936)
I think it's fair to say microservices increase the need for governance, whether manual or automated systems. When you start having more than 1 thing, you create the "how do I keep things consistent and what level of consistency do I want" problem
Re:The Costs of Microservices by LelouBil on Monday October 30, 2023 @08:10PM (#38077876)
In the department I work there's a lot of microservices, about 5-6 so 5-6 teams. But everything is quarkus/spring java and nothing else.
Re:The Costs of Microservices by cpill on Monday October 30, 2023 @02:26PM (#38073580)
> God forbid you find yourself with a need to rewrite one of these shitpiles. Actually, this is much easier with micro services as you have a clear interface you need to support and the code is not woven into the rest of the monolith like a French plat. The best code is the easiest to throw away and rewrite, because let's face it, the older the code is, the more hands it's been through, the worse it is, but more importantly the less motivated anyone is in maintaining it.
Re:The Costs of Microservices by lemmsjid on Monday October 30, 2023 @03:22PM (#38074385)
If the monolithic application is written in a language with sufficient encapsulation and good tooling around multi-module projects, then you can indeed have well known and encapsulated interfaces within the monolith. Within the monolith itself you can create a DAG of enforced interfaces and dependencies that is logically identical to a set of services from different codebases. There are well known design issues in monoliths that can undermine this approach (the biggest one that comes to mind is favoring composition over inheritance, because that's how encapsulation can be most easily broken as messages flow across a single-application interfaces, but then I'd also throw in enforced immutability, and separating data from logic).

It takes effort to keep a monolithic application set up this way, but IMHO the effort is far less than moving to and maintaining microservices. I think a problem is that there's very popular ecosystems that don't have particularly good tooling around this approach, Python being a major example--it can be done, but it's not smooth.

To me the time when you pull the trigger on a different service+codebase should not be code complexity, because that can be best managed in one repo. It is when you need a different platform in your ecosystem (say your API is in Java and you need Python services so they can use X Y or Z packages as dependencies), or when you have enough people involved that multiple teams benefit from owning their own soup-to-nuts code-to-deployment ecosystem, or when, to your point, you have a chunk of code that the team doesn't or can't own/maintain and wants to slowly branch functionality away from.

Re:The Costs of Microservices by protomolecule on Monday October 30, 2023 @04:58PM (#38075697)
"composition over inheritance, because that's how encapsulation can be most easily broken as messages flow across a single-application interfaces, but then I'd also throw in enforced immutability, and separating data from logic"

Could you elaborate on this? I see how "separating data from logic" is a problem but what about the other two?

Re:The Costs of Microservices by lemmsjid on Monday October 30, 2023 @07:10PM (#38077247)
Well now that you mention it I think it does all come down to 'separating data from logic'. I was working backwards from the premise of: "what if we want a monolithic in-process application to have the same cognitive simplicity as an API-based client-server model?"

If you want to enforce a clean interface between an in-process client and server (i.e. a piece of code calling a library interface), then the best model is to think of it as a message passing system, where once a payload is passed from the client to the server and vice versa, the other side should not be able to witness changes to the payload. An immutable payload in this context is the same as the json that goes over the wire between a client and server.

If you really wanted an in-process application to look like a microservice you could take the added step of forcing a serialization / deserialization step on both client and server. I've seen frameworks that do this. But I think immutability, if it can be enforced, is a practical way of solving this problem and far less complex.

Inheritance is a hazier point I was making, in hindsight, because you could use inheritance for data modeling, which is quite fine in some situations... so I think it's effectively subsumed under the "separating data from logic" argument: which is that if you're passing behavioral inheritance from a "server" to a "client", then it gets harder and harder to predict how that client is going to use it and thus it's harder to reason about the functional boundary between two pieces of code. But it's a hazy point because I think the larger and more important point to make, as you point out, is that you simply shouldn't (in most cases) pass any kind of behavior between client and server--just data.

Another approach to look at (besides taking inspiration from Smalltalk) is the actor model, where it's incredibly clear that any communication between modules in an ecosystem is immutable messages. In fact a side effect of the actor model is that it gets pretty easy to move things from in-process to cross-process because most activity in the system is already performed through message passing, so you can just start channeling messages from Actor A to Actor B through a serialization/networking layer rather than in-process if you want to deploy them separately for reasons of convenience or computational needs.

Re:The Costs of Microservices by protomolecule on Tuesday October 31, 2023 @05:39AM (#38082254)
I see, thanks. My original interpretation was that by "separating data from logic" you meant data-oriented programming where you intentionally give up on encapsulation.

"which is that if you're passing behavioral inheritance from a "server" to a "client", then it gets harder and harder to predict how that client is going to use it"

You mean a "server" returning the base class object whose methods are overridden by a successor class known only to the "server"?

Re:The Costs of Microservices by lemmsjid on Tuesday October 31, 2023 @12:51PM (#38087769)
Yep. Mentally it's rather like the unpredictable behavior you'd get if an API server was passing code to the client for it to execute.
Re:The Costs of Microservices by gedy on Monday October 30, 2023 @07:01PM (#38077157)
> If the monolithic application is written in a language with sufficient encapsulation and good tooling around multi-module projects, then you can indeed have well known and encapsulated interfaces within the monolith. Within the monolith itself you can create a DAG of enforced interfaces and dependencies that is logically identical to a set of services from different codebases.

So then, not Rails apps

Re:The Costs of Microservices by lemmsjid on Monday October 30, 2023 @07:29PM (#38077430)
Yes, a good point, I think the more dynamic the language, the more one gravitates towards microservices as a problem solving tool, because you'd give up a lot of the value of the dynamic environment by enforcing strict rules.

Though I'm seeing a lot of convergence between environments over time, which makes me think we're all headed towards a nicer future.

For example in Scala, which does a lot of type inferencing, it's typical to tell the linter to require that public methods have explicit types, even though the compiler will reify them at compile time anyhow, because that makes the interface much more robust to refactoring. Meanwhile in a more dynamic environment, in Python it's getting more typical to use type annotations, and, similarly, to especially use them on functions that define a reusable interface.

I figure that the ideal languages in the future have module-level systems where they can define strict interfaces across modules, but then get as crazy and dynamic as they want inside of the modules.

Re:The Costs of Microservices by LelouBil on Monday October 30, 2023 @08:16PM (#38077933)
With microservices, you can also version them independently. In a monolith you can't roll back "a part" of the app to the latest version if you pushed multiple unrelated features at once.
Re:The Costs of Microservices by lemmsjid on Monday October 30, 2023 @08:40PM (#38078243)
You can. If you set up the modular DAG as I mentioned above, you can now set up service boundaries between the leaves of the DAG. E.g. parts of the code call other parts of the code as a service. You then version and deploy the same codebase separately.

Say you have Libraries A, B, and C, where B and C depend on A and not one another. You can have B call into C via a service, just as you would in a microservice. Now B and C can be versioned and deployed independency. You can also deploy updates to Library A incrementally, tying it to the B and C deployments.

Re:The Costs of Microservices by charcircuit on Monday October 30, 2023 @09:41PM (#38079006)
> a monolith you can't roll back "a part" of the app to the latest version if you pushed multiple unrelated features at once.

git revert <bad commit>

Re:The Costs of Microservices by LelouBil on Tuesday October 31, 2023 @10:50AM (#38085726)
Well yes, but if you used a compiled language you have to make a new release based on this commit.

What I mean is, if you have v2 of your software that introduces a bugfix for module A that's perfectly fine and a bugfix for module B that breaks everything, you can just roll back just module B directly with your deployment pipeline.

There's no need to go back to the code base and make a new release.

Re:The Costs of Microservices by cpill on Wednesday November 01, 2023 @05:34PM (#38105660)
> It takes effort to keep a monolithic application set up this way Yeah, this is the problem and _why_ I think microservices are the way forward as it doesn't take effort because the programmer is forced into do the right thing. On project with many different types of coders (and lets face it we are all different) consistency drops off fast. Of course you can do it with monoliths but I'm coming from a "real world" scenario where there are many people with different levels of ability and different levels of giving a cr@p about code quality. Micro services let people who code badly to do it in isolation and let themselves be the only ones who have to suffer under it, and ultimately learn from it (if they are not fired first). Also decoupling in a monolith vs by deployment is really just which git repo the code lives in, which are next to each other in the same directory on your hard drive. If there is shared code factor it out as a library/module and install it into the projects that need it. Its not a big deal
Re:The Costs of Microservices by lemmsjid on Monday November 06, 2023 @08:05PM (#38171717)
My instinct from your response is that if we chatted on this for a bit in person we'd see eye to eye and we're probably thinking of different use cases, because I can see how thoughtful you are and usually it comes down to thinking about particular problems in particular companies. So at the risk of going back into crass generalizations, I do persist in thinking that the TCO of a monolith is lower under a lot of the constraints you're describing, assuming (big emphasis) the tooling of the language you're using for the monolith, i.e. a combination of linters and compiler, can enforce the rules. I've been in service-first environments where the equivalent of not caring about code quality in the monolith is firing up a new service without consideration for refactoring the older service, until I am in endless architecture meetings about how to make cross cutting changes around a bunch of services everyone regrets creating.

I suppose in the end it comes down to the classic issue of needing to pay down of tech debt, which is true in any software ecosystem.

Re:The Costs of Microservices by antonhag on Monday October 30, 2023 @04:59PM (#38075729)
This assumes a clear interface. Which assumes that you get the interfaces right - but what's the chance of that if the code needs rewriting?

Most substantial rewrites crosses module boundaries. In micro services changing the module boundary is harder than in a monolith, since it can be done in a single commit/deploy.

Re:The Costs of Microservices by butlike on Monday October 30, 2023 @05:41PM (#38076322)
I disagree. The older the code is, the more hands it's been through, which generally means it's stronger, hardened code. Each `if` statement added to the method is an if statement to catch a specific bug or esoteric business requirement. If a rewrite happens, all that context is lost and the software is generally worse for it.

That being said, I agree that maintaining legacy systems is far from fun.

Re:The Costs of Microservices by smaudet on Monday October 30, 2023 @07:03PM (#38077186)
> If a rewrite happens, all that context is lost and the software is generally worse for it.

Unless you have a strong test suite which tests the absence of those bugs. OFC you can never prove the absence of an issue just the continued functionality of your codebase, but re-writes are often prompted by weird "in-between" functionality becoming the norm (or slow/buggy behavior).

Of course a lot of test suites are of dubious quality/many devs have no idea what a good test suite looks like (usually unit tests are some combination of throw-away/waste-of-time, acceptance tests are mostly happy-path and due to recent trends integration tests are all but non-existent).

But in theory, re-writes are fine when you do have a test-suite. Even with a bad one, you learn what areas of the application were never properly tested and have opportunities to write good tests.

Re:The Costs of Microservices by wernercd on Monday October 30, 2023 @06:33PM (#38076889)
> The best code is the easiest to throw away and rewrite, because let's face it, the older the code is, the more hands it's been through, the worse it is, but more importantly the less motivated anyone is in maintaining it.

The more testing that's been done and the more stable it should be.

The argument for new can be flipped because new doesn't mean better and old doesn't mean hell.

Re:The Costs of Microservices by starttoaster on Monday October 30, 2023 @03:22PM (#38074384)
> Wouldn't it be a hell of a lot easier if it was all in one place where each commit is globally consistent?

I always find this sentence to be a bit of a laugh. It's so commonly said (by either group of people with a dog in this fight) but seemingly so uncommonly thought of from the other group's perspective.

People that prefer microservices say it's easier to change/rewrite code in a microservice because you have a clearly defined contract for how that service needs to operate and a much smaller codebase for the given service. The monolith crowd claims it's easier to change/rewrite code in a monolith because it's all one big pile of yarn and if you want to change out one strand of it, you just need to know each juncture where that strand weaves into other strands.

Who is right? I sure don't know. Probably monoliths for tenured employees that have studied the codebase under a microscope for the past few years already, and microservices for everyone else.

Re:The Costs of Microservices by tklinglol on Monday October 30, 2023 @03:26PM (#38074450)
My first gig out of school was a .net monolith with ~14 million lines of code; it's the best dev environment I've ever experienced, even as a newcomer who didn't have a mental map of the system. All the code was right there, all I had to do was embrace "go to definition" to find the answers to like 95% of my questions. I spend the majority of my time debugging distrubuted issues across microservices these days; I miss the simplicity of my monolith years :(
Re:The Costs of Microservices by iterateoften on Monday October 30, 2023 @03:27PM (#38074464)
Not so much a ball of yarn but more like the cabling coming out of a network cabinet. It can be bad and a big mess if you let it, but most professionals can organize things in such a way that maintenance isn’t that hard.
Re:The Costs of Microservices by starttoaster on Monday October 30, 2023 @03:49PM (#38074723)
Well, the point I was making was that the same can easily be true of microservice architectures. If you have people that don't know what they're doing architecting your microservices, you'll have a difficult time maintaining them without clear and strict service contracts.

It's not clear to me that we're ever comparing apples to apples in these discussions. It would seem to me that everyone arguing left a job where they were doing X architecture the wrong way and now they only advocate for Y architecture online and in future shops.

Re:The Costs of Microservices by smaudet on Monday October 30, 2023 @09:41PM (#38079002)
Functionally its the same stuff.

Both have boxes of stuff and the stuff talks to other stuff.

Logistically its a bit easier to scale the one where the boxes are married to closer to the hardware abstraction (microservices on instances) versus the one where boxes are married to the software abstraction (threads with memory), for the same reason one (monolith) is a lot faster (dev/process/latency) (at small scales) than the other (microservice).

You can scale both, really its mostly about fights about the tooling, process, and where your sec-ops decided to screw you over the most (did they lock down your environments or did they make it impossible to debug ports/get logs).

Practically, AWS is expensive, and they're bloated. Cluster environments that let you merge 1000 computers into 1 big supercomputer and have 1 million cores/terabytes of ram, come with different technical challenges that not as many people know how to overcome, or expensive hardware bills.

So I'd say if someone tells you it "has to be" one or the other they are blowing smoke. Micro-services were recently the hip-new-thing so it makes sense some really really bad nonsense has been written in them so people are rediscovering monoliths (and realizing the microservice people were snake-oil salesmen). In 10 years we'll realize again that some monoliths are really badly written and some people without a clue will re-write them as microservices...

Re:The Costs of Microservices by disintegore on Monday October 30, 2023 @04:02PM (#38074915)
I've noticed that a lot of industry practices demonstrate their value in unexpected ways. Code tests, for instance, train you to think of every piece of code you write as having at minimum two integrations, and that makes developers who write unit tests better at separating concerns. Even if they were to stop writing tests altogether, they would still go on to write better code.

Microservices are a bit like that. They make it extremely difficult to insert cross cutting concerns into a code base. Conditioning yourself to think of how to work within these boundaries means you are going to write monolithic applications that are far easier to understand and maintain.

Re:The Costs of Microservices by protomolecule on Monday October 30, 2023 @05:00PM (#38075747)
"because you have a clearly defined contract for how that service needs to operate"

But if you need to change the contract the changes span the service and all of its clients.

Re:The Costs of Microservices by sanderjd on Monday October 30, 2023 @08:16PM (#38077936)
> you just need to know each juncture where that strand weaves into other strands.

No I don't, that's what computers are for. It's why static analysis is good. Instead of knowing what calls what, you say, "yo, static analysis tool, what calls this?".

Re:The Costs of Microservices by BHSPitMonkey on Monday October 30, 2023 @08:36PM (#38078157)
The comment you quoted is talking about the non-monolithic situations where static analysis tools cannot help you, e.g. when the callers are external and difficult to trace.
Re:The Costs of Microservices by sanderjd on Tuesday October 31, 2023 @11:26AM (#38086281)
I don't think so? The full quote that I pulled out a piece of was:

> The monolith crowd claims it's easier to change/rewrite code in a monolith because it's all one big pile of yarn and if you want to change out one strand of it, you just need to know each juncture where that strand weaves into other strands.

I'm saying, in the monolith situation, with proper static analysis tooling - which even languages like python and ruby have nowadays - you don't "need to know" how all the strands weave into the other strands, you rely on the tooling to know for you.

And in my experience, static analysis tooling for navigating across service boundaries is, at the very least, far less mature, if not just entirely non-existent.

Re:The Costs of Microservices by masterj on Monday October 30, 2023 @08:50PM (#38078397)
If an organization can't figure out how to factor out clearly-defined contracts within a single codebase and maintain that over time, adding a network hop and multiple codebases into that will not make it any easier.
Re:The Costs of Microservices by bibabaloo on Monday October 30, 2023 @04:40PM (#38075481)
How many developers do you have working on that monolith though? The size of your binary isn't usually why teams start breaking up a monolith.
Re:The Costs of Microservices by haolez on Monday October 30, 2023 @06:38PM (#38076926)
This sounds reasonable and correct, but my personal experience includes more monolithic messes than microservices ones.
Re:The Costs of Microservices by duncan-donuts on Monday October 30, 2023 @06:49PM (#38077030)
I was in a meeting to talk about our logging strategy at an old company that was starting micro services and experiencing this problem. In the meeting I half heartedly suggested we write the main lib in C and write a couple wrapper libs for the various languages we were using. At the time it felt kinda insane but in hindsight it probably would have been better than the logging mess we created for ourselves.
Re:The Costs of Microservices by anonymousDan on Tuesday October 31, 2023 @05:31AM (#38082191)
Maybe logging should be a microservice....
Re:The Costs of Microservices by Thaxll on Monday October 30, 2023 @08:30PM (#38078064)
Why did you have 2-3 languages, does not make sense, I've been using microservice for a while and it was only one language at a time.
Re:The Costs of Microservices by drzaiusx11 on Monday October 30, 2023 @11:25PM (#38079904)
We have 2 supported langs across our cloud teams and our core libraries are dual-lang'd where applicable; meaning they're both Ruby Gems and Pypi packages (Python3) in one repo with unified APIs and backed by a shared static config where applicable (capability definitions etc.) Each dual lib is released simultaneously with matching SemVer versions to our various artifactory instances & S3 buckets (for our lambda "layers"), automatically on every push to mainline by CI/CD.

It works surprisingly well. We're evaluating a 3rd language but won't make that choice lightly (if it happens at all.)

We have 14+ micro services, and it's fairly easy to "rewrite the shit pile" when you actually follow the micro designation. One of our services was originally in perl and we, quite mechanically, rewrote it in ruby in a sprint to align with our other services.

Speaking from personal experience, when monoliths and the teams working on them get big enough, you start having "action at a distance" problems, where seemingly benign changes affect completely unrelated flows, often to catastrophic effect.

You make an innocuous looking resource update in the monolith, like an update to a CSS stylesheet that fixes a bug in a flow your team owns, now breaks 10 others flows owned by teams you never heard of because they were using the existing structure for selenium tests or some js that now fails to traverse the dom because some order of selectors changed, etc.

Microservices are as much a team organizational tool as they are a code one. The idea being those that work on the service "know it", and all it does. They can wrap their head around the whole thing. I think some orgs don't really get this point and _start_ with microservices, completely unnecessarily, for the stage they're at as a company. You always start with a monolith and if you get to the point where everyone is stepping on each other's toes from the lack of enforceable boundaries in the code, you do the obvious and start to create those boundaries.

Microservices aren't the only way to do this of course. Any way of dividing up your service with enforceable contracts will work. Modules get designated with codeowners, assigned to various teams. Resources that were once shared get split up to align with the team structures better. Many frameworks allow multiple "apps" or distinct collections of APIs, so you can still ship your one-binary without splitting out the collections into different services. As soon as you have to independently scale one set of APIs but not another, you can state looking at service boundaries again. For the majority, that day will never come.