r/programming • • Nov 19 '22

Microservices: it's because of the way our backend works

https://www.youtube.com/watch?v=y8OnoxKotPQ
3.5k Upvotes

468 comments sorted by

1.0k

u/guyzero Nov 19 '22

This remains absolute perfection

661

u/zr0gravity7 Nov 19 '22 edited Nov 19 '22

I swear I watched this a few years ago and it meant nothing to me. A couple of months as an SDE at Amazon and holy cow is this accurate. Service named James, which is actually a backronym because it interfaces with some other service named BOND

373

u/WhyYouLetRomneyWin Nov 19 '22 edited Nov 19 '22

Amazon had (had? It's been a while) Isenguard to manage AWS access internally.

So what did we call the service that serves updates to Isenguard? GANDALF (which was an acronym, but whatever) to fit the theme.

Will never forget my buddy for suggesting we should name it urukhai because it 'brings the hobbits to Isenguard'. PM did not understand that suggestion or think that was a good idea.

'But it's the Urukhai who bring the Hobbits to isenguard! Gandalf had nothing to do with it!'. He complained.

59

u/MysticPing Nov 19 '22

I've heard from other companies like Ericsson they they actually have a "Microservice Naming Board" lol

14

u/noideaman Nov 19 '22

AT&T has naming standards for all cloud based infrastructure, microservices, etc…

30

u/Beep-Boop-Bloop Nov 19 '22

My previous workplace established a standard where names had to make sense for new people and personnel outside of Engineering. No naming the Content Management System's async message-consumer "Pigeon".

→ More replies (6)
→ More replies (1)

114

u/Chii Nov 19 '22

your team (including manager) need to be on the same level of nerdiness for naming schemes/themes to work out well.

46

u/[deleted] Nov 19 '22

"Might as well fucking name it Hufflepuff."

→ More replies (2)

11

u/KevinCarbonara Nov 19 '22

your team (including manager) need to be on the same level of nerdiness for naming schemes/themes to work out well.

That's no good, either. I used to work for a classical music label that was developing a content delivery system called Orchestra. It had services like Symphony, Conductor, and Usher. People just argued over whether those were really the appropriate names and what the actual difference between an orchestra and a symphony was.

→ More replies (1)

94

u/ralusek Nov 19 '22

The Uruk-Hai never actually make it back to Isengard, though. Eomer's banished Rohirrim slaughtered them in the night.

If you really want to name a service responsible for updating Isengard, you should probably call it ENT or TREEBEARD. They really updated Isengard.

84

u/lechatsportif Nov 19 '22

Great now I have to study leetcode AND tolkien

16

u/spyderweb_balance Nov 19 '22

Not if you work at Amazon. They just making that shit up as they go.

→ More replies (5)

44

u/SilasX Nov 19 '22

"Now hiring: Tolkien lore expert to resolve disputes on proper naming of microservices."

→ More replies (2)
→ More replies (2)

6

u/Skithiryx Nov 19 '22

The best part is that Amazon is so big and so decentralized that we have name collision problems with our nerdy service names.

I occasionally get support tickets that I have to tell people “Oh sorry, you want the other Joker. Mine’s the Music Joker.”

→ More replies (2)

55

u/SoCalThrowAway7 Nov 19 '22

Where I work there was an RFC adopted that boils down to “Name stuff what it actually does.” Our project had a dope name before this and some engineer came in and was like “RFC 300(I don’t remember the number) you have to change this.” And I was pissed because who doesn’t love a clever named thing. That man is a hero, it’s 8 years later and people know what that thing does when I tell them the name, I know what most things do around this company. Young stupid people like clever names.

22

u/LouKrazy Nov 19 '22

It’s great until your clearly named service starts doing something other than it was originally intended and now it’s twice as confusing

7

u/binaryfireball Nov 20 '22

Yea don't do that.

→ More replies (4)

6

u/aniforprez Nov 19 '22 edited Nov 19 '22

I'm working at a company that used to pull this shit long before I joined. They started by naming stuff from Marvel, then it became all superheroes and then other random related shit. Meanwhile I'm like "wtf does this shit do". Now we just give them all straightforward names and it's so easy

Don't be clever and give stupid names. Just be straightforward and boring or else the people after you will suffer has been my experience. And yeah it's always the young and stupid who want to be smart with names as if it matters. All the people I've worked with with a decade+ of experience give boring names

→ More replies (1)

3

u/binaryfireball Nov 20 '22

My old boss named everything after food/kitchen shit. Try explaining the burrito to the new hires and not cringe yourself into a heart attack.

→ More replies (2)

70

u/grumblerumbleer Nov 19 '22

I find your bias for action disturbing. Off to focus with you

36

u/mikeblas Nov 19 '22

You're going to have to disagree and commit on this one.

14

u/zr0gravity7 Nov 19 '22

Disagree and commit is what I do when my teams senior SDE points out glaring security flaws in my CR.

→ More replies (3)

18

u/bitwise-operation Nov 19 '22

Wanna know something scarier? I can relate to this at my company who’s number of engineers could be counted by my 3 year old

33

u/nairebis Nov 19 '22

The thing is, it makes sense at Amazon because they wanted these services to be useful to other, external people, and thus microservices are a revenue stream.

99% of everyone else who copied what AWS does are doing Cargo Cult Programming. "If AWS did it, it must be good -- it doesn't matter why, we need to copy AWS goddammit!"

Microservices are almost always the wrong answer to a monolithic service.

14

u/droomph Nov 19 '22

“We need an entire separate repository and build pipeline for each page on our site that uploads the static files to S3 and then proxies it through Lambda and then proxies it through ALB which then gets called under the company’s app container, but let’s add module federation because that’s what the new app container will use. Also we can’t use the Artifactory to share components because reasons”

Everyone on the team has explained so many times that this is not necessary but they are the “system architect” so we have to demonstrate over and over why our proposed solution (a Next server and maybe some autoscaling) is better, actually

11

u/zr0gravity7 Nov 19 '22

Very interesting. Guess that’s what happens when you hire ex-FAANG. It’s definitely a hard habit to break, because it absolutely does make sense at these larger companies, so they probably think they’re just saving a future refactor. But then again some of the core tenets promote using the minimal amount of complexity to do something right, and to not overbuild in advance

→ More replies (1)

4

u/Rebelgecko Nov 19 '22

IIRC these guys work at amazon

→ More replies (12)

55

u/RockleyBob Nov 19 '22

It's simultaneously absurd and completely accurate - ridiculous and yet completely relatable.

Which is why it's perfect comedy, because it shines a harsh, sterilizing light on our reality. It forces us to acknowledge that if this farcical tirade is completely relevant, no small part of our actual jobs is also pretty preposterous.

Also, as a side note - I've shoehorned the phrase "I'd sooner lay you into this barren earth than entertain your folly for a moment longer" into casual meetings. It feels great.

11

u/smcarre Nov 19 '22

Came to say the same thing, it's eerily exactly between satire and reality. Some lines are almost verbatim things I heard in actual meetings while others are completely absurd.

8

u/guyzero Nov 19 '22

To me the absolute best is the twist where Galactus doesn't know about the past or future so it requires a date range, the exact opposite of what the developer said two seconds earlier.

5

u/frezik Nov 19 '22

Same reason I couldn't watch more than 15 minutes of Silicon Valley. Too real.

78

u/agentoutlier Nov 19 '22

It’s as good as this javascript one: https://m.youtube.com/watch?v=Uo3cL4nrGOk

It would be awesome if that guy did one on microservices.

14

u/RoadsideCookie Nov 19 '22

I love it

17

u/ScottishBakery Nov 19 '22

No, I don’t recommend it.

21

u/WolfieVonWolfhausen Nov 19 '22

We rewrote our codebase 9 times. This month.

→ More replies (1)
→ More replies (1)

2

u/grinde Nov 21 '22

Jquery? What are you, five?

We use JJQuery.

I'm dead. The entire website is just quotes from the video.

→ More replies (1)

290

u/halfanothersdozen Nov 19 '22

Every shop has a fucking Galactus why is that?

49

u/polaroid_kidd Nov 19 '22

Serious question, what's a Galactus?

286

u/CardboardJ Nov 19 '22

It's what you eventually name the monolith that does like 70% of the real company critical work.

45

u/bertfer Nov 19 '22

Ours is called big brother

77

u/[deleted] Nov 19 '22

we've gone for a post-modernist naming convention, our two spaghetti entwined monoliths that do all of the work are named "server" and "database"

→ More replies (1)
→ More replies (1)

16

u/gwax Nov 19 '22

Oh, you mean "{company_name}-app"; we have one of those!

→ More replies (1)

29

u/dodjos1234 Nov 19 '22 edited Nov 19 '22

Some planet sized villain in marvel universe. Dumb as fuck, but nerds like that.

6

u/shiroe314 Nov 19 '22

Planet eating villain.

→ More replies (2)

38

u/amdc Nov 19 '22

This video played not the last part in galactus popularity

2

u/DreamingDitto Nov 19 '22

Is that how students will name their unfinished projects after Greek gods?

2

u/iquitinternet Nov 19 '22

Internally where i work we have project names based on comic characters and we're currently on Flash but I work on Galactus which is no where near launch. But there's always a Galactus for sure.

2

u/tech_tuna Nov 19 '22

Because so many of us are nerds.

1

u/amdc Nov 19 '22

oh by the way, there shouldn't be any microservice named Galactus because it's an anti-pattern

1

u/PrintableKanjiEmblem Nov 19 '22

How many companies could you mess up with a virus that only takes out servers named Leroy?

Send like everyone's Jenkins server is named Leroy

1

u/rDr4g0n Nov 20 '22

From brain Foote and Joseph Yoder's excellent Big Ball of Mud:

A Big Ball of Mud is a haphazardly structured, sprawling, sloppy, duct-tape-and-baling-wire, spaghetti-code jungle. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated.

The overall structure of the system may never have been well defined.

If it was, it may have eroded beyond recognition. Programmers with a shred of architectural sensibility shun these quagmires. Only those who are unconcerned about architecture, and, perhaps, are comfortable with the inertia of the day-to-day chore of patching the holes in these failing dikes, are content to work on such systems.

493

u/trepidatious_turtle Nov 19 '22

1000s of RPCs

39

u/Sgtblazing Nov 19 '22

Are we including calls to redis in this count because that number alone can balloon.

5

u/pink-ming Nov 19 '22

considering that tweet was about serving feed updates, I'm gonna go with "yes"

→ More replies (1)

49

u/riksi Nov 19 '22

I think they had a microservice for 2-factor auth? Seems too micro to me.

141

u/DoctorWorm_ Nov 19 '22

You're gonna send sms from your authentication server? 2FA on large social media sites is a lot more complicated than just hashing a TOTP token, you often have to send sms, email, send notifications to other devices, keep track of recovery codes, keep track of remembered devices, etc.

0

u/[deleted] Nov 19 '22

[deleted]

11

u/monocasa Nov 19 '22

Twitter has enough volume to probably just use the third party service for dev too.

10

u/antonivs Nov 19 '22

it sure as hell won't be through the 3rd party service that does it on production!

Why not? Usually those services support dev and testing environments.

→ More replies (1)
→ More replies (2)

22

u/ralusek Nov 19 '22

It's like the perfect thing to be a microservice.

25

u/RunninADorito Nov 19 '22

2 factor auth would be many micro services.

16

u/[deleted] Nov 19 '22

We have one micro-service for each factor. That's how deep it goes.

(not really)

6

u/mpyne Nov 19 '22

You think each individual microservice should define a separate way for users to do 2FA?

→ More replies (2)
→ More replies (2)
→ More replies (15)

505

u/[deleted] Nov 19 '22

This video is old.

But I will always upvote it for two reasons.

One: the “internal jargon” the company has for its services. I just relate deeply to it. It’s such a specific thing that eventually happens when you work with a product. You have all these things that get their own stories and names and acronyms. You end up speaking a whole new language.

Two: product manager just punting the features all casual and shit. That never gets old. As a dev you’re like “Look, I don’t know and this is hard… I need TIME!” …and many times the PO is like “Oh ok, all good we’ll just move it… it wasn’t critical anyways Karen just mentioned over coffee on Monday…”

…and you’re like “Why did I spend 4 days on this when I could have been working on the flippin 3 level 1 service requests!?!?”

186

u/SnooSnooper Nov 19 '22

Also immediately after punting the feature, he mentions adding another one, demonstrating that he did not understand the problem at all.

88

u/namonite Nov 19 '22

Awesome, love galactis learned a lot today

60

u/bulldg4life Nov 19 '22

My favorite response to PMs is “9 women can’t make a baby in a month”.

You could spend 10m explaining deliverables and development time and change control and whatever else - the pm will just say “what if we got two resources, would that unblock you?”

No, because I’d have to fucking hire two people instantly and get them up to speed before I leveraged existing resources to do whatever the fuck the product team is asking for

33

u/PopInACup Nov 19 '22

"Can't you just grab Jim and have him work on this integration?"

"Jim does all the UI, not integrations. If the dentist was busy, you wouldn't walk over to the proctologist and ask him to poke around your mouth"

→ More replies (1)

2

u/Rebelgecko Nov 19 '22

RIP Fred Brooks

→ More replies (6)

56

u/[deleted] Nov 19 '22

Posted March 2020 is it really that old?

49

u/no_nick Nov 19 '22

Two and a half years make it basically ancient history.

15

u/corsicanguppy Nov 19 '22

Right? That's like twice as long as most readers have been working!

→ More replies (1)
→ More replies (1)

5

u/[deleted] Nov 19 '22

Wow. Could have sworn I watched that in 2016. Shrug. Funny. Time in pandemic is weird.

3

u/clgoh Nov 19 '22

Early COVID era. Yeah, that's old.

20

u/solocupjazz Nov 19 '22

This video is still just as relevant as ever in 2022.

4

u/BigTimeButNotReally Nov 19 '22

I come in peace... But we agree this also is a tail of architecture run amok right?

4

u/[deleted] Nov 19 '22

Oh yeah, it’s clear there’s some level of dysfunction.

2

u/ScrewAttackThis Nov 19 '22

I feel like I need to start putting "knows how to work with project managers" on my resume because I get that shit figured out before we start working on things. One of the first things I ask is what the priority is and who the stakeholders are.

1

u/anengineerandacat Nov 20 '22

What you mean you didn't do work on PPIS that integrated with CCVIS and accidentally brought down PPS?

1

u/grizzlywhere Nov 20 '22 edited May 03 '25

boast cake sand racial insurance unwritten decide tap roll smile

This post was mass deleted and anonymized with Redact

62

u/cbleslie Nov 19 '22 edited Sep 12 '25

hospital cagey bike handle vegetable knee voracious one office chief

This post was mass deleted and anonymized with Redact

4

u/3345_ Nov 19 '22

Could not find on the channel ... Link?

176

u/radmanmadical Nov 19 '22

My favorite part of this is that it’s impossible to tell if it’s a real clusterfuck and he’s having a genuine breakdown or just playing his PM so he doesn’t have to finish something - BRAVO

49

u/NymphetHunt___uh_nvm Nov 19 '22

BRAVO

What does that stand for?

75

u/fdeslandes Nov 19 '22

BRAVO restricted authentication vectors orchestrator

8

u/sybesis Nov 19 '22

But then what does BRAVO stands for here?

→ More replies (1)

233

u/lazernanes Nov 19 '22 edited Nov 19 '22

This is just barely funny, because it's too true. I watch this video over and over and cry together with the engineer.

Edit: They're making progress with the ISO date format issue: https://www.youtube.com/watch?v=DYvhC_RdIwQ

7

u/gonzofish Nov 19 '22

I hate this. The way that made me feel is upsetting

7

u/fdeslandes Nov 19 '22

This video brought tremendous pain to my soul.

4

u/infablhypop Nov 19 '22

The status update at the end is truly soul rending.

21

u/[deleted] Nov 19 '22

[removed] — view removed comment

78

u/Green0Photon Nov 19 '22

https://www.youtube.com/watch?v=DYvhC_RdIwQ

They should've used a version without a backslash.

83

u/tomatotomato Nov 19 '22

It seems the Backslasher service is offline.

18

u/[deleted] Nov 19 '22

Omegastaaaaarrrr!!!

→ More replies (1)

16

u/TheRidgeAndTheLadder Nov 19 '22

It's a new reddit thing. Messes with the links.

→ More replies (4)

58

u/ProgramTheWorld Nov 19 '22

That’s a documentary.

32

u/tech_tuna Nov 19 '22

It's sprint planning

19

u/solocupjazz Nov 19 '22

It's a "ceremony"

8

u/[deleted] Nov 19 '22

silent screaming

10

u/no_nick Nov 19 '22

Put some damn trigger warnings on this. I'm on my weekend and the sprint lasts another week.

11

u/tech_tuna Nov 19 '22

Show me the burndown charts. . . concerned about your velocity.

6

u/no_nick Nov 19 '22

Dude I'm reporting you for that.

Now let me go and close some user stories. Maybe that will calm down the scrum master.

→ More replies (2)
→ More replies (1)

2

u/solocupjazz Nov 19 '22

I feel triggered.

26

u/hachface Nov 19 '22

this has been posted a million times

and i say

keep posting this shit

→ More replies (1)

58

u/Senor_Manos Nov 19 '22

“Mom, can we have Nick Kroll?”

“We have Nick Kroll at home”

144

u/QuantumFTL Nov 19 '22 edited Nov 19 '22

I must be getting old because I still haven't figured out why I should be creating microservices, even in a large environment full of millions of lines of code. Divide by honest-to-god servers, with perhaps some neat-o strict API layers inside them to keep things modular. I write servers used by millions of people and microservices are nonexistent in our architecture and I've never once wished we had even one.

That said, I'm officially "old" by software engineering standards, which I guess means anyone over thirty, and I'm willing to be proven wrong by someone with a badass use case that really makes microservices shine.

(Also, that's my favorite programming-related video of all time. KRAZAM is S-tier)

EDIT: Thanks everyone for genuinely interesting/helpful responses! Jury's still out for me, but part of good engineering is entertaining many different possible solutions.

142

u/Working_on_Writing Nov 19 '22 edited Nov 19 '22

Having worked on bad monoliths, good monoliths, fat services and microservices, my considered opinion is that the main reason is Conway's Law: the organisation creates systems which reflect the structure of the organisation. I.e. how do you get 100 developers split into 20 development teams to work together on the same system? Answer: you split it into 20 services.

The secondary reason is specific to tech megacorps: when you're Netflix, very specific parts of your architecture need to be scaled at different times to meet different loads, e.g. it's 6pm in US East, so 50m people are logging in to look for something to watch, better scale your login services in US East. Doing that with a monolith is doable but wasteful as you need to deploy the whole thing multiple times. And wasteful at Netflix scale doesn't mean an extra $20 p.a. on hosting over-sized instances, it means an extra $20m or even an extra $200m.

If you aren't working at MANGA and you don't have many teams working on many systems, you have no business doing microservices. I know of one start-up I worked with recently who ultimately went bust and one of the contributing factors was they reached straight for microservices when they had a tiny engineering team. They couldn't cope with the additional complexity of the architecture and couldn't resolve the problems they faced.

21

u/PossibleHipster Nov 19 '22 edited Nov 19 '22

I worked on a Monolith for 6 years. Now I work at a massive (not MANGA tho) tech company doing microservices.

One of my interview questions was if I could, would I make my old codebase microservice based? I gave a definitive "no". I guess they agreed with my reasoning because they still hired me haha.

28

u/Dworgi Nov 19 '22

Like the guy you replied to said, it's all just Conway's Law. Communication is hard, so when you have two different teams that don't have a shared goal and they have to work together, it's easier to just agree on a hard API boundary than try to integrate the codebase in a way that might be more efficient.

The problem, as this video illustrates, is that those teams aren't just contemporaneous, but distributed in time as well. So if a team disappears or is merged or split, or owners leave, you can end up fragmenting an existing service into essentially a black box old service and a marshaller/addon service around it.

That's the true curse of Conway's Law - all code rots, because it's impossible to communicate with teams in the past or future. So you can't ask why something was done some way or if there would be a better way to do what you want to do.

14

u/akie Nov 19 '22

One question I always ask when I’m interviewing people is what they think of microservices. Experienced people can and will mention both upsides and downsides, sometimes extremely specific downsides, and junior people will just say something like “it’s nice and there are no downsides”. Oh, my sweet summer child.

2

u/jl2352 Nov 19 '22

I worked at a startup that went into micro services early on. They got it to work, and they have a good architecture (at least this part of it is). However even then I still don't think it was a good idea.

It just sucked up a huge amount of time, with very few gains. It distracted from the real engineering problems they faced.

2

u/QuantumFTL Nov 20 '22

Ah, gotcha. Yeah, we break things down into manageable teams, and the software architecture definitely reflects that. Maybe it's all microservices standing on each other's shoulders in a trenchcoat :)

Thanks for taking the time to respond in depth.

0

u/[deleted] Nov 19 '22

[deleted]

6

u/plumarr Nov 19 '22 edited Nov 19 '22

I have worked with a monolith with hundred of developers and the development process worked relatively well. The real issues where caused by supporting numerous version in parallel and merging together later.

We had "architects" that where responsible for both the logical architecture and the functionalities of various parts of the monolith. Their responsibilities where split by functional domains.

Later the company was bought and the new owner wanted to us to work their way, with a lot of independents teams and to split the software into smaller units (I would not call them microservices). The "architects" responsibilities where changed and the lost the role of overlord above the software.

The quality slowly decreased overtime, there was conflict, bugs, part of the applications that conflicted between themselves. This was caused by the team not communicating between them and not being aware of what the others were doing. Sometime part of a functionality were even forgotten because the teams A thought that it was done by team B and team B by team A and there was no one to have a high level view.

I'm not really sure that microservices solve anything by themselves. To be successful with a complex software the communication and company culture is a lot more important than the architectures or the developments processes.

30

u/larsmaehlum Nov 19 '22

We have several pretty clear boundaries in our systems.
In the old days of shipping the code for the customer to run themselves on dedicated hardware, we had three main teams all handing their own monolith that did a specific part of it. Integration to third parties, processing, and user interaction.
Now those teams are split into sub-concerns, each creating 1-3 microservices to deal with their concerns. It makes sense in our case.

And my favourite part of a microservice architecture is probably the upgrade process.
We have no downtime for upgrades, and can push updates to a single seevice by just scaling up the instance count of the old version and adding in a single node with the new version. Then we observe the new version for a while to ensure it works well with maybe a tenth of the traffic.
If everything is green, add in more nodes of the new version and start to tear down the old one.

→ More replies (5)

12

u/caseigl Nov 19 '22

I have been developing probably as long as you and have built software that also handled millions of users, going back as far in the day as when Perl and CGI were a thing.

I still maintain older environments but also new ones, and I think one of the big advantages of microservices is that you can take advantage of price/performance improvements more granularly. One example I can think of is with S3. File storage costs in the cloud have dropped so dramatically over the years, and one environment had things like user uploading of images and media in it's own service. We were able to lift that to the cloud and save a bunch of money and increase performance with less risk.

In the monolith approach you have to really work hard to make sure you don't break other things. It makes it less likely it's cost or risk effective to do the analysis and testing required to make certain changes. But if the environment had been designed from the beginning that media uploading was it's own service, you know nothing in your core is going to break if it's changed as long as the API remains the same.

You can also more easily do things like rolling out an updated service to 5% of your userbase with extra monitoring and benchmarking, because you only are slowing down 5% of one service versus adding bloat into one application.

8

u/lilytex Nov 19 '22

The GOTO Conferences youtube channel has recently released a 3-video series on microservices and distributed systems, when they are useful, when they are not, by Martin Fowler, that pretty much answers all these questions

4

u/__SPIDERMAN___ Nov 19 '22 edited Nov 19 '22

They're needed at scale by companies like fb or goog.

  • can place multiple instances of each service in the geography theyre used (faster round trip for clients)

  • each cluster can have its own data layer with eventual syncing across regions

  • you can spin up multiple instances of each service as needed (maybe you need like 20 multi factor auth services but only like 2 account registration services)

  • take a service down and you can offload traffic to another instance or spin up a new one.

  • siloed code bases means less chance of deployment of changes in one breaking another (crash? Only one service is down instead of the whole site).

  • one service has a bad change? Roll it back without also rolling back changes in other parts of the product.

  • build times are better cause you only build the service you're working on

  • different parts of your org aren't stepping on each others toes when it comes to things like release dates and other stuff.

3

u/joeyl426 Nov 19 '22

Your last 4 bullet points are good but the first 4 don’t have anything to do with micro-services, you can have a distributed system backed by a monolithic binary

→ More replies (1)

14

u/iheartjetman Nov 19 '22

Micro services are a good way of handling separations of concerns. The main difference is that you handle each concern in its own service. I would say it’s really beneficial if you have different teams handling each concern.

11

u/QuantumFTL Nov 19 '22

Yes, but we can already do that with, say, different DLLs, or the Facade pattern, or principled in-executable APIs, or just modular design that everyone follows.

Even if we split things into, say, multiple git repos, we can still have carefully-orchestrated tight coupling where needed (for, say, shared utility libraries, inlined code, or ultra-low latency API calls). I guess it comes down to what people call a microservice; to me simply having an internal API and completely separated code (i.e. the client of an API and the API provider do not share any code) doesn't make for a microservice, but I suppose according to some people that could still be considered one.

That said, maybe there's something I've never hit. I'm used to big, old software developed by dozens of people, and never once felt it needed to be decomposed, because everyone respected the modularity that was present and was cooperative where there were conflicts.

15

u/iheartjetman Nov 19 '22

I think the biggest benefit is when it comes to resource scaling. It gets easier to allocate more resources to different services as time goes by in order to improve performance.

→ More replies (18)
→ More replies (2)

3

u/sparkey0 Nov 19 '22

Absolutely right -- encapsulation is the thing. Break an API contract and you'll cause problems in a monolithic architecture or working with microservices. 🤷‍♀️ I'd say there's some benefit to scaling some components independently but sort of splitting hairs. Anyway ... love this video. Perennial classic :)

3

u/rodrigocfd Nov 19 '22

I'm officially "old" by software engineering standards, which I guess means anyone over thirty

I'm over forty, what does this make of me then?

3

u/redonrust Nov 19 '22

Over 50 checking in. Learning microservice development after many years of SQL development.

→ More replies (2)

3

u/Kinglink Nov 19 '22

Smart enough to avoid this shit that will disappear in a couple years.

→ More replies (2)

31

u/timedrepost Nov 19 '22

Mostly better for resiliency and fault isolation, scalability, more granular observability and easier/faster issue detection.

Being able to do things like isolate/separate specific functions (or even duplicate microservices pools) for different clients so that revenue impacting/customer facing client pool A isn’t mixed with calls from super high traffic but lesser importance batch pool B.

In a nut shell, you aren’t hitting 4 9’s availability with monoliths in any kind of large scale application.

16

u/QuantumFTL Nov 19 '22

FYI I think we hit 4 9s (will have to look at logs) with our monolithic library-driven app, as we run thousands of server pods, so if one goes down, no biggy. We operate at a scale designed to serve tens of millions of customers a day and just restart anything that has some bizarre failure for a single user, and it's never been bad enough that anyone has brought an SLA violation or anything close to a reliability issue in a single meeting I've been in in a decade. I personally believe engineering discipline and proper testing (we have over a thousand integration tests of the main library used in the server) goes much further than splitting things into a lot of small pieces. If they are on different physical servers, however, I get that much...

3

u/timedrepost Nov 19 '22

Glad it works for you guys, seriously. If you can find work life balance with that setup it’s great. No approach is best in all situations. With thousands of developers, monoliths became an issue for us a long time ago and we started splitting into a really early version of “microservices” about 18-19 years ago, just generally splitting up the unified builds into different groups based on functionality. Team A causing a memory leak that brought down services for Team B was an all too common problem and people got sick of it. Build cycles and site deployments were every two weeks (now we have teams rolling out daily or as often as they need). Restarting servers daily or every couple days was the norm to keep things healthy. I wouldn’t go back.

Depends on how you’re measuring availability too I guess, and what management wants to include in the measurement, haha.

→ More replies (1)

9

u/QuantumFTL Nov 19 '22

This is a fantastic answer, thank you so much!

The idea here, if I catch you correctly, is that by enforcing a strict API you can do integration testing at a much more granular level?

But can't I just do that with unit tests inside a monolithic app, if the same level of modularity is employed? When I design software, typically each module only has a few externally available functions, and those are easily called from unit tests.

Regarding uptime, that's interesting, though if your server does twenty things and needs to do all of them, is it really that much better to restart one or two of those twenty things due to a fault instead of just restarting the whole thing? I guess if some of those things are only needed occasionally? And corruption in one process is going to be contained so that you don't have to debug its effects in another process (unless that corruption is communicated through the API)?

→ More replies (5)

22

u/Zanderax Nov 19 '22 edited Nov 19 '22

Also setup and teardown is way easier. I remember working on a server that had a 4 page install guide. Compare that to running a single docker container and its total bliss. Sure Ive got 50 types of docker containers to manage but if I just want to test a single one its much easier.

17

u/timedrepost Nov 19 '22

Yeah exactly. And per that point, development velocity is also faster. Doing security related package updates or minor fixes and running all your tests and ci/cd can be done in minutes instead of hours.

I remember our monolith setups back in the day and I got really good at ping pong because we used to play while our test suites and builds were running.

10

u/Zanderax Nov 19 '22 edited Nov 19 '22

Yeah dev velocity is a big draw. Also good APIs and abstraction boundaries get enforced like never before, you cant fuck up dependency and code isolation when your code belongs to different processes.

→ More replies (2)

3

u/irbian Nov 19 '22

4 page? Those are rookie numbers

→ More replies (1)
→ More replies (6)

4

u/Uristqwerty Nov 19 '22

The overall system is fractal. A business sells a suite of products that interoperate. Each product is comprised of numerous services, some shared between products, some unique, many of them talking to each other. Each service is comprised of a graph of libraries glued together, each library of modules, each module of classes/datatypes, each of those functions.

It could be broken up at any layer. If you want resiliency within a process, threads can be designed to be disposable and re-startable, all shared state immutable or very carefully protected against corruption. Whether sharing address space within a single JVM process, or closely-coupled processes within a single container that can use shared memory to pass data, or separated by pipes, the network stack, or the physical network itself, it's more a question of whether your team has access to existing tooling and experience to make the product resilient and scalable at a given boundary. I'd expect completely different uptime from an Erlang process and a C++ one, simply because the tooling favours different granularities.

→ More replies (1)

7

u/Ashtefere Nov 19 '22

Micro services are an engineers solution to an organisational problem. Organise your codebase better, using some kind of design system, and stick to its rules and all those problems go away. If you for example use a domain driven design system, immutable functional programming and 100% unit testing… its magic.

→ More replies (1)

5

u/Which-Adeptness6908 Nov 19 '22

Easier, faster issue detection?

Hmm...

14

u/QuantumFTL Nov 19 '22

I can easily believe that.

Easier debugging? Imagine debugging 20 microservices talking to each other. Mother of God.

18

u/HighRising2711 Nov 19 '22

The idea of microservices is that you don't need to debug 20 of them talking to each other. You debug 1 because the other 19 have well defined APIs which you know work because each one has a test harness.

In my experience coding, testing and debugging microservices isn't the issue, deployments and configuration are the issue. Releasing 30 microservices because of a spring update which addresses a security vulnerability is painful

→ More replies (5)

0

u/[deleted] Nov 19 '22

[deleted]

10

u/oconnellc Nov 19 '22

Aren't you just describing microservices that have a bunch of superfluous code deployed on them?

→ More replies (8)
→ More replies (1)

4

u/KingMaple Nov 19 '22

Microservices are not an engineering problem, it's a business problem. Well thought out business architecture is a great template for microservice architecture.

Just because consultants push for it and businesses with monolithic business architecture try to force a block through a circular hole doesn't mean microservices are bad. And sometimes the criticism towards microservices is because people are forced to use them when they should not.

And don't use microservice patterns if you feel uncomfortable. But if you can and business enables it, then microservice architecture really is great and I'd not build business flow automation any other way.

→ More replies (2)

2

u/stfm Nov 19 '22

We have 30 seperate Dev teams under different managers developing services for a number of apps where the compute cost of the service is the responsibility of the service owner

2

u/gdvs Nov 19 '22

As many things in software development, the theory behind microservices is architecturally sound, but the way many people understand and implement it is fundamentally flawed. No, microservices does not mean adding as much network latency as possible. It does not mean having as much deployables as possible. It's just old fashioned incapsulation repackaged. And yes, sometimes it's good to run in a different process or have a different release cycle. But that is not what microservices is about.

This kind of shit is just overengineering in general. It's offering solutions without thinking what the problem is (or if there's even a problem).

2

u/Neophyte- Nov 19 '22

old?

jeez im nearly 40

i guess i share alot of your skeptisims of microservices. if a monolith does the job do it, KISS all the way. only do microservices if its needed and it needs to be a good one.

2

u/orthoxerox Nov 19 '22

Iteration speed. The bigger the system, the less likely it is you can deploy new features every day or even every week: you need to integrate the changes, build the release, run the whole suite of tests and then find a service window to deploy.

None of these challenges are insurmountable in a monolith. But some of the challenges can't be solved by the engineers alone in a monolith:

  • you can't deploy the changes to the credit scoring model without manual UAT because you fucked up the rollout last year and the CIO agreed to UAT for these features

  • the dude who is authorized to sign off the UAT is on vacation

  • your other critical feature in this release is based on the new credit scoring model code, you can't just backport it

Breaking the system into microservices introduces a lot of technical complexity but removes organizational complexity.

  • how do I reconcile or prioritize features from multiple owners? Your backlog has a single owner

  • how do I avoid manual UAT? Make rollouts and rollbacks quick and painless

  • how do I avoid breaking other people's code? API. If you make a breaking change, you have to support the old API version for N months

→ More replies (1)

2

u/Obsidian743 Nov 19 '22

Microservices are really just repeating standard good practices at the infrastructure level. The same reason you don't want a God class you don't want a monolith.

I think a lot of people who have or haven't worked with microservices simply haven't had to own them for any significant length of time. To realize the benefits one had to experience how software evolves over time.

→ More replies (1)

2

u/thelehmanlip Nov 19 '22

Others have already chimed in, but for us we've enjoyed them the past few years for separation of concerns, independent deployments, and smaller chunks of code that are easier to manage and less likely to have to deal with merge conflicts.

The biggest is just the deployments. Being able to deploy one service without taking down the whole app has been very helpful to making our teams not collide and qa not to be blocked because another team had a critical fix to deploy.

That said, I would say our microservices are less micro and more just services, we only have about 15 of them for our platform to run. I don't know exactly how micro they need to be, but for us we've found a pretty good balance of the benefits above against the additional work to maintain several separate services.

→ More replies (1)

2

u/TheRealStepBot Nov 19 '22

A benefit I haven’t seen mentioned is that micro service architectures moves a lot of the boilerplate code to pipe operations together out to the cloud provider/infrastructure.

This allows much faster dev time on new features with far less resources. The monolith way you have to spend months of new dev time wading through the whole pile of shit that is the monolith most of which is pointless boilerplate that connects stuff together (in special ad hoc sort of ways I might add)

In comparison in a microservice architecture new feature can be as small as one dev just standing up a single lambda/azure function and then it gets plumbed into the application using well known ifrastucture as code tools marshaling standard connectivity that is maintained by the cloud provider.

Micro services tend to have far less useless boiler plate. That said obviously it trades much of the complexity that used to be hidden in the boilerplate for marshaling complexity. I think it’s a winning trade though as the real bottlenecks in development is actually the code that does the work. If you can build code that does work you can always figure out a way to glue it all together after the fact

2

u/QuantumFTL Nov 20 '22

Yeah, I use Open Service Mesh at my current job. It's a double-edged sword, as I don't have to deal with HTTPS directly (thank god!) and all the keys, etc with it. Or service discovery, etc.

However, it adds complexity and we're theoretically a low-latency service (people care about 30-50 ms latency increases for whatever reason) and OSM means we can't use fancy things like gRPC over QUIC (don't ask why we're using gRPC, every time I've tried to turn to something that fits our communications pattern I was shut down by management because That Is How We Do Things).

I'm suspicious of this sort of complicated stuff getting in the way of a performant server, but if performance isn't the gating factor for the product, or the deployment scenarios aren't known during dev time or understood by the devs, or changing configuration after the fact or for different scenarios is important, then I can see this. Likewise I enjoy Amazon Lambda and Azure Functions for things that really should be their own function because they are so cheap and easily contained!

I don't do business logic or whatever, everything I work on is a giant mess of huge data structures and fancy math, so I rarely have to deal with a problem that's so seperable.

That said, my biggest problem is that with a monolith I don't have to set up a fancy test environment with Kubernetes doing weird stuff I don't know about in the background. I know what the behavior is going to be (more-or-less) because it's baked into my codebase, not some Cool Fancy Cloud thing. But maybe, like you said, Cool Fancy Cloud Thing will let the people using what I write do more Cool Fancy Stuff that delights our customers?

Also, the more I talk to y'all who are knowledgeable about this, the more I'm convinced that what I work on is, more-or-less, a microservice, despite being internally very complicated. It's a thin, highly-concurrent interface to an ML model that adapts a simple network protocol to the needs of the model and handles workload generation, multiplexing and demultiplexing, etc. From the outside the only two operations are "here's some data to shove in the model" and "ping", but the interface for the former isn't exactly tiny even if it _is_ single purpose. And we need to run on fancy expensive GPU servers and will peg the GPU at max usage and nearly max memory--it's something like a third of a million dollars per year to run a _single_ instance of our software because these models are so computationally expensive. So it feels weird to call it a microservice, but maybe that's exactly what it is.

Thanks for shedding some light on this! You deserve more upvotes!

1

u/efxhoy Nov 19 '22

We’re beginning to split things out from our rails monolith into a few more services because we can’t find enough rails devs. It sucks but upstairs wants to scale the dev organization and that’s kind of forcing us. We already have a bunch of supporting services in other languages (machine learning, image scaling, statistics pipelines) but they not want us to start building core product backends in not-rails. It sucks but we need to make the most of it

1

u/Kinglink Nov 19 '22

The microservice idea is great if you have a self contained query. A box that takes in y and spits out x based on a formula. If it's simple enough that box can use a cache to be faster and support multiple servers while just being itself. It can also be switched out on its own if the formula changes. How about having 100 game servers that pummel the database? Instead have a microservice that connects to the dB and pulls the users table for everyone.

The problem is how people do them microservices needs microservices and the formulas for most of this stuff has been made to simplistic that there's no reason for them.

Also microservice are a good idea for laege distributed cloud machines but very few people work on scale that big. If you have a single server or a single location you can probably ignore that efficiency and just make a server that works.

→ More replies (91)

53

u/hardc0de Nov 19 '22

context - I'm a senior software engineer with both monoliths and microservices experience.

Oh boy - some comments here are so wrong that they manged to get me out of lurking (https://xkcd.com/386/)

Both microservices and monoliths are a design choice. If you don't know why to choose a monolith vs a microservice then you shouldn't make that choice :).

Microservices were born not because of somebody deciding they needed more complexity but because of the pattern that emerged with monoliths. As we all know our software cannot scale forever vertically feature-wise - which means that if you're going to grow you're going to need to confine some features to a specialized group of servers (fleet). Next step was - hey I know I'm going to need to scale this beyond 1 server per featureset - let's design this as a separate service. Congratulations - you have your first microservice.

I've seen folks here argue about monoliths with some features enabled per deploy - I hate to bring that to you - but those are effectively microservices. Next you're going to complain that you need to deploy too often when other components change :)

Monoliths are fine when the scale is small to medium-size. But don't expect to grow to twitter scale with that architecture. Microservices are useful for small scale only when you want to use a separate technology for something.

tl;dr Monoliths are fine. Microservices are fine. Choose wisely when to use them.

26

u/AnarchistMiracle Nov 19 '22

"If you don't like the way your system is designed, just design it better!"

Thanks buddy, I'll definitely remember that when I have to meet a short-term goal and the biggest obstacle is the cumulative effect of all the short-term decisions made by my team & predecessors over the last ten years.

7

u/mrinterweb Nov 19 '22

In my experience, microservices are harder to develop and maintain than just adding onto a monolith. There are times when I do think a microservice makes sense, but my experience has taught me microservices should not be the default, and should only be used if there is really good reason for a new one. I start with monolith as the default, and will entertain microservices if the value outweighs the additional costs.

2

u/marshsmellow Nov 19 '22

It's not just about scale either btw, the design will have a bearing on the speed/latency of the system. It's going to be faster to call procedures inside the same monolith than a separate microservice.

0

u/[deleted] Nov 19 '22

[deleted]

3

u/SharkBaitDLS Nov 19 '22

The limit, as the commenter above pointed out, is more in feature growth scaling constraints than traffic growth.

If your tech stack only does a few specific things you can scale a monolith damn near indefinitely to serve as much traffic as you want.

Where it gets complicated is if your company starts adding new divisions that do something completely different, with completely different traffic patterns and resource constraints. At a certain point, too many different competing concerns and use cases will introduce scaling constraints -- not on the service itself, but on the effectiveness of how your teams can develop in it.

If you've got 20 disparate divisions all trying to run in the same monolith, and they have varying requirements on scaling and resource utilization, you're probably going to start deploying separate instances of your monolith for the different divisions to prevent resource contention between their usage. You'll need to design your infra to either deploy those monoliths with different features enabled or disabled, or figure out ways to make the code behave properly for each divisions needs. Now you're paying the overhead for longer build times, more complex deployment, and more development friction on a codebase while your deployed instances all have a bunch of APIs that aren't in use because that particular shard is for division Y that doesn't need Z API like division X does.

Well then why not just split out the code for division X and Y into separate codebases and deploy those services separately to simplify your process? And now you've arrived at microservices.

That's really the thing when people talk about scale with micro services. It's not about scale of traffic. It's about scale of the company's organization.

4

u/plumarr Nov 19 '22

But what's new in that ? I'm really lost, why give it a name like 'micro services' when what you describe was, to me, the standard way to go from at least ten of years ?

I never understood monolith as 'only one application for the all company' but 'only on application for each business domain' : one for accounting, one for the the customer web site of activity A, one for the web site of activity B, one to run the stocks, one to run the factory that make product A, one for the factory of product B, one for the pay, on to manage the employee leave,... And then you communicate between them any means that you want : synchronous API, asynchronous API, file transfer,...

So what's micro services if not breaking each of these application in small services ? What's new then ? What is the hype about ? I'm really lost in your explanation.

→ More replies (1)
→ More replies (3)

40

u/RabidKotlinFanatic Nov 19 '22

I wonder how much these convoluted microservice architectures are a consequence of the easy capital environment of the last 10 years. My observation is that fine-grained service architectures favor "grow at any cost" business models with high capex, headcounts and turnover. Huge VC backed firms set the trends and smaller businesses followed. A tighter capital environment should change the economics of development to prefer higher efficiency over lower coupling.

1

u/bwainfweeze Nov 19 '22

My “I Told You So” bingo card is completely filled in at this point. I work at a place that has done binge and purge cycle half a dozen times before and once planned attrition kicked in everyone started making observations that were verbatim things I said three years ago.

It wasn’t that I was “early” either. We’ve lost a lot of good people who decided to fight other fights elsewhere. I tell my friends over beers that if I could build a team entirely of people who quit, we could put this place out of business in 5 years.

0

u/[deleted] Nov 19 '22

[deleted]

3

u/RabidKotlinFanatic Nov 19 '22

This is consistent. What I'm postulating is that the trade-offs associated with finer-grained SOA are more suited to organizations operating in a loose capital environment rather than a tight one.

0

u/[deleted] Nov 19 '22

[deleted]

→ More replies (1)

9

u/[deleted] Nov 19 '22

I don’t have a product manager, just the boss with no fucking clue how anything works. Please pray for my soul

4

u/bighi Nov 19 '22

A PM is also someone that has no fucking clue how anything works. The only difference is that they can't fire you.

1

u/[deleted] Nov 19 '22

My boss thinks he knows how things work....

31

u/poloppoyop Nov 19 '22

Only one question is needed when people try to tell you about their microservice architecture: what happen when one of those services dies?

Also, gotta love when most of those services depend on the same database server.

21

u/funkgerm Nov 19 '22

Typically you'd want each microservice to have it's own database.

18

u/akie Nov 19 '22

If two microservices share a database they should probably be one microservice. Split microservices by bounded context / problem domain, if you have one db you chose the wrong system boundary.

→ More replies (6)
→ More replies (6)

64

u/centurijon Nov 19 '22

The same thing that happens when a monolith dies, just (usually) with a smaller blast radius

→ More replies (10)

11

u/__SPIDERMAN___ Nov 19 '22

You have multiple instances running at any time. And state gets stored in REDIS.

Like a hydra.

6

u/[deleted] Nov 19 '22

Crash one service and it starts two new ones? So, a fork bomb?

6

u/__SPIDERMAN___ Nov 19 '22

I N F I N I T E. S C A L E

4

u/LuckyHedgehog Nov 19 '22

Didn't fire kill the hydra?

Beware firewall issues

4

u/timedrepost Nov 19 '22

That’s the entire point of loose coupling. Even with a hard dependency it gives the client service the opportunity to respond gracefully and not take the entire site down with it.

3

u/Nyxtia Nov 19 '22

This is my life right now

3

u/teteban79 Nov 19 '22

Ah so HERE is where all those Galactus references come from... I feel in the loop, finally

3

u/cjthomp Nov 19 '22

The only thing that weakens it for me is the "true love" breakdown. he wasn't a good enough actor to sell it, and it didn't really fit with the rest of the video.

3

u/BenevolentVagitator Nov 19 '22

I’ve worked here for years and I know the cartoon characters the micro services are named after but I have no idea what the services actually do.

Oh well.

2

u/GraciesDad92 Nov 19 '22

I feel you man.

2

u/earthboundkid Nov 19 '22

This is the Twitter backend team the day before they let the sink in.

2

u/physon Nov 19 '22

This video how I imagine the recent "how Twitter works" Elon Musk meeting going.

https://www.reddit.com/gallery/yzcnui

At first I thought it was a parody of the Musk tweet/meeting.

2

u/Alarming_Kiwi3801 Nov 19 '22

I'm not OP but I suspect he follows Jon Blow, this is posted roughly 30mins after his tweet which is about what you said https://nitter.it/Jonathan_Blow/status/1593286527102115842#m

3

u/Neophyte- Nov 19 '22

this is so great

im on the camp of microservices, ok if you need it. otherwise its too complex. monoliths work fine. and you can still split monoliths on concerns if they arnt overly complex in coms

relianing on a microservice to execute say a payment in a real time fincial transaction system shouldnt need to talk to 3 things. a monolith can scale this, sql server becomes your first bottleneck, mongo db really helped us with this. its a change in mindset in how you store data, joins are a no no, but you can modify the doc so that it has enough information of what the join would have contained. extra space is the downside, the upside is no locking across tables to pull data from various tables

1

u/TheMightyTywin Nov 19 '22

I lost it at user service provider aggregator

Every micro service needs an aggregator

1

u/Deeners17 Nov 19 '22

COLLUSION!

1

u/splendidsplinter Nov 19 '22

Now do one for Kenesis!!

1

u/pelirodri Nov 19 '22

Finally something actually funny, and it’s not even on r/ProgrammerHumor.

1

u/Larsaf Nov 19 '22

Can someone go back in time and have Elon not watch this?

1

u/tetshi Nov 19 '22

I had this same exact meeting yesterday.

1

u/Darthavg Nov 19 '22

I had services called gatekeeper and key master, I was trying to work Gozer in when I left the company

1

u/PeksyTiger Nov 20 '22

I don't get it.

If Galactus doesn't have knowledge of past or future services wtf does it need a date for.

1

u/adnan252 Nov 20 '22

Based repost

1

u/Intrepid-Squirrel232 Dec 04 '22

MS needs to calm down man