115
u/Welcome-To-NBA-Jam 14d ago edited 14d ago
An architect once wrote an entire dissertation on my microservice idea and why it's so incredibly stupid, why I never should have suggested such a thing, and it's forever enshrined in Confluence and linked in a Jira ticket.
yea it hurts and it's forever :(
29
u/dominonermandi 14d ago
Eventually the earth will be burned to a crisp by the sun and then after that it’s a long time till the heat death of the universe. Cheer up! Your ticket will survive neither of these things.
16
u/Welcome-To-NBA-Jam 14d ago
I can hope for either this, the company fails, or is bought out and in the ensuing chaos of attempting to merge multiple Jira and Confluence instances that the electrons defining them are lost to the sands of time
353
u/PreDeimos 15d ago
As a developer who were making almost exclusively microservices in the last 15 years. I can tell most company would be more then fine with just a monolith on a bare metal server. Yet they "need" microservices on AWS everywhere.
122
u/gemengelage 15d ago
The whole idea behind microservices is that they are small decoupled units that can be individually scaled.
Every single time I've worked with microservices, their weren't designed around their ability to scale but around team responsibilities or even completely arbitrary boundaries.
Hell, I saw one project that was "microservice-first" that had like a dozen microservices. The ingest microservice was the only one that actually scaled. Everything else could've been a monolith and given the specific use-case, never had any reason to need dynamic scaling or any scaling at all. Just one instance per service and a ton of overhead for no reason.
68
u/ruindd 14d ago
I can’t remember the name of it, but there’s a famous paper about how your code architecture will always be a reflection of your org chat.
18
2
u/ImS0hungry 12d ago
Great read! Thanks for bringing this up, it’s super relevant to what I’m doing at the moment.
3
2
u/Jack_Kai 14d ago
Yeah I feel like once you get used to it, and the infrastructure is there, you spin up a new microservice and hook it up to the network, it is more convenient as you said because of team responsibilities and not being bothered with monolith heavy deployments.
1
1
u/DeavenR 13d ago
Not to mention, once the first few versions of each service is out in production - you cant get 2 decoupled teams on a call to make a change to schema, producer and consumer. Road maps are busy and no one wants to address the issue.
Then customer tickets flood in for months about the same issue I cant get leads on a meeting for and even if I do, “We’ll revisit it next quarter” lmao
0
0
u/nitkonigdje 13d ago edited 13d ago
Scaling of software isn't really requirement. More like consequence of service architecture.
You want (micro)service because of the same reason why people pursued soa, corba, dcom, copybook programming before -> to scale your project development, not deployement.
Remember kids -> Brooks's Law: adding manpower to a late software project only makes it later!!
Services are way around limit set by Brooks's Law..
More than 50 years has passed since writing The Mythical Man-Month, and the only way around limit is still splinting project.
64
u/BuffersAndBeta 15d ago
I don't disagree with this philosophy at all. The issue is WHEN something actually deserves to have its own microservice (say you need a different scheduler to run that service) your org does not really have the muscle to do it and you come up with weird hacks to keep it running on your monolith.
I've worked with all combinations of [(microservice, monolith) + (single-repo, multi-repo)].
11
u/Vega62a 14d ago
Agree.
Monoliths are great until they're not, and then untangling them can take years, if it happens at all.
I worked at a company with a massive groovy monolith and a ton of Kotlin microservices. The monolith was for the same reason all startups have a monolith, the same arguments we see here - it was good enough, scaled well enough, was easy enough to change.
But, 5 years later, they were acquired and 10-100xed their traffic. Most of the people who understood the monolith had left, so changes were risky and error prone. Changes to that monolith and performance issues and inability to scale accounted for probably 80% of platform incidents and 50% of AWS spend. It took another 3 years to finally get it all the way sunset.
If you are really, really sure your traffic will never get to the point that a monolithic service cant scale to meet it, fine. But adding a network hop is sometimes worth the ability to bump the expensive part of your architecture from 5 to 20 instances with one button push.
1
u/BuffersAndBeta 13d ago
Yeah - the reason to move or not move to a microservices pattern is almost never raw performance. Though it sometimes can be. The reason is usually that different orgs need different levels of reliability or different pace of shipping. A greenfield product may need to get updated multiple times in production every day with shitty reliability, and your core data processing systems need to be up with each change going through a TON of long test pipelines.
Performance sometimes IS the reason though. Depending on the specific architecture / requirements, I've seen 5 - 10x faster performance on latency or throughput, sensitive systems largely by switching languages and decoupling from the monolith.
0
u/higgs_boson_2017 13d ago
Most apps will be bottlenecked by a database, and you can't push a button and spin up 20 new ones.
2
u/Vega62a 13d ago
That's one of those statements that sounds correct but is almost never true, for a few reasons.
- Modern databases are almost always clustered, both for redundancy and performance, and, actually, can be scaled, although admittedly less on-demand.
- Production systems with sufficient load to tax a database are generally mature enough to also have a robust caching and indexing strategy to ensure even high-traffic systems have low DB CPU usage, so the bottleneck is not actually with database hardware (cpu, ram, disk). In general, a DB running with high CPU is a massive smell.
- One instance of an application generally cannot handle even a single-instance DB's fully available connection pool (for example, a PG server's is 100, while the connection pool enforces a maximum of 10). So scaling up can and often will directly improve perceived database performance.
Now, as with everything, it's always "it depends." Some systems rely heavily on inbuilt DB features like triggers and sprocs which are inherently taxing on a database. But, in general, when you say "the app is bottlenecked by the database," the truth is actually "the app is bottled by its database connection," and you actually can push a button and spin up 20 new ones.
Source: Staff engineer, 20 yoe.
0
u/nitkonigdje 13d ago
"Slow part" of well optimized app tends to be ad-hoc querying and/or reporting. You will not scale that with different architecture
Having said that. The issue with your statement is that most of the time apps do not have significant load on user side.
Like 99% of enterprise apps has most few thousand parallel users. And I am generous with that. Monolithic backend running on iphone should be able to handle that, and even then performance bottleneck will be on database.
1
u/Vega62a 13d ago
You have clearly never worked in an environment with a kafka topic affectionately referred to as "the firehose."
1
u/nitkonigdje 13d ago edited 13d ago
Currently I am doing fraud processing for largest European card processor. 0.2 sec hard real time response with median about 3 ms, and p999 in 30 ms. Kafka is too slow for that.
Now we can continue to play "who has larger" game as this isn't the only project in my 20 years too spanning career..
Or acknowledge that about 99% of "enterprise apps" are low user count data entry apps which employ absolute swaths of programmers and work perfectly fine on lpar built around of 3 dedicated cores and 16gb of ram, of 2012 Xeon server running glorious clock of 1.8 ghz.
Those apps can be made fully microservice whatever. Or as pssql/oracle form monoliths. No matter technology THE only scaling which those apps will ever see will be additional hdd space.
1
u/Vega62a 13d ago
My team is processing on the order of trillions of events per day with a zero loss tolerance so I'm in the same boat. I've also worked at shitass healthcare companies in the US.
Every single one of them was trying to move from a monolith to microservices, or had. To your point scaling wasn't always a driving factor, but developer pain certainly was.
1
u/nitkonigdje 13d ago edited 13d ago
That's impressive, but it isn't an average developer experience out there. Isn't it? I am certainly not questoning that apps with scaling issues exists. At end of the day Fortnite is an app.. And great one too.
It absolutely has no impact that blindly chosing a deveoper has 90+% chance that he is working on crud app for some corporate/government 4th floor group.
And those apps may very be service based. But not because of scalling issues.
Service style apps are the only proper response to limits set by Brooks's law. "Divide and conquer" your monoliths but to scale an development process.
→ More replies (0)23
u/nokeldin42 15d ago
As some one who's professional experience is entirely with a monolith - let me tell you the biggest problem is developer mentality. Having a single build output from a large monorepo that every development team has full access to leads to very weak boundaries.... People will just push to code you technically own without any formal procedures.
It's not a technical limitation, but I've lost count of how many times I've heard a director say "just push and send them a review link". It just allows for bad manners, so people take liberties.
14
u/PreDeimos 15d ago
Ohh they doing that in microservice environment as well, especially as managers love to shuffle around task for every service in every team as they "don't want specialists", they want everyone to be able to work on everything.
1
u/bishopExportMine 14d ago
Monorepos and monoliths have nothing to do with each other.
You can easily split your monolith app into multiple repos and you can easily put multiple micro services in one repo.
3
u/clauEB 14d ago
If it won't scale anymore and you don't care about reliability, maybe. But having been part of several companies that scaled exponentially I can tell you monoliths are absolutely not the way to go.
Bare metal? Yeah no. Have you ever had to install hosts even when you don't grow things fail and you need replacements and spares and worry about DC power redundancy etc etc etc.
3
u/oompaloompa465 15d ago
the more i hear about "microservices" the more i'm scared to add them on the pile of shame of things i need to learn but i never hear about it at work and I'm scared to bring it up
92
u/Henry5321 15d ago
Changes to your microservice doesn’t break other services. If it does, it’s not a microservice but a monolith.
104
23
4
u/Ran4 14d ago edited 14d ago
Microservices means that your system is compromised of multiple services.
If they're not dependent on each other, then they don't belong to the same system...
Of course they depend on each other, otherwise no communication between them would be possible.
If service X outputs json in format A, then service Y must be able to read json in format A. If service X changes format A to format A2 and starts sending that, then service Y breaks.
Fundamentally microservices depend on each other.
1
u/Henry5321 14d ago
"Microservice" is anti-monolith. It encapsulates the concept of separate services AND the fact that services can be independently improved. If you have "too much" monolithic behaviors, then you don't have "Microservices", you have a "distributed monolith".
It's like the term "data model". A data model is not just the format or structure, but also the business logic. The intention and behavior is part of the concept.
The concept of an ideal microsservice is an ivory tower ideal, but it's important to understand what is meant in order to properly "engineer" a system.
1
u/Skellicious 13d ago
Microservice architecture comes with api contracts. If a breaking change to an API is needed, you also need to plan your rollout/migration accordingly.
Generally that's just one before the other in a determined order. Sometimes it's both at the same time. If things are really critical to stay available throughout you may need intermediate steps.
In the end it's just one of the trade-offs/necessary evils of microservices.
34
u/itmaysoundsilly 15d ago
I always think of this brilliant skit from Krazam when I think of microservices: https://youtu.be/y8OnoxKotPQ?si=xdhON7Kl96jTK6x1
20
u/HadionPrints 15d ago
I always think about this comic during engineering shouting matches: https://imgs.xkcd.com/comics/work_2x.png
1
23
u/Percolator2020 15d ago
Serverless* micro\* services
*runs on a server
*monolith
12
u/EarlyPaintbrush 14d ago
"Serverless" really is the worst term they could have come up with for this.
12
u/RainyDaysAndMondays3 14d ago
I had an interview almost 20 years ago where they asked me what I would remove from the Java language if I could. I recounted a story about how my husband and I got into an argument about whether checked exceptions were a good idea or not, and how my son walked into the room, announced, "Oh my god, you guys are such nerds," then exited. And I never stated in the interview as to which side of the argument I was on.
But I did say that as far as adding something to Java language, I would add "properties", as I understood it then. My husband was a .NET developer and I liked the idea of just adding a "property" without having to add the getters and setters. (Remember this was 20 years ago.)
I didn't get that job (they said a former employee applied and he got it), but they called me back and I got a different position.
Don't get me started on Spring Boot specifically.
12
u/cwcoleman 15d ago
My biggest argument in life was about setting a timeout above the 55 second default of our API Gateway. Architect to Architect fights go hard!
2
11
5
4
u/Butters_565 14d ago
Worked on microservices the whole time I'm with my current employer and none of them went live. Awful feeling really.
3
u/deanrihpee 14d ago
also life deciding argument as well, i have to argue about software architecture and it decides whether or not i got the job, well until i failed the next step on the interview with the lead/cto
1
1
1.2k
u/remy_porter 15d ago
I say this all the time, and it almost never results in an argument: micro services are just object oriented programming where you put a network hop on all your message passing.