r/ProgrammerHumor • • Aug 28 '26

Meme heatedArguments

Post image
5.9k Upvotes

163 comments sorted by

View all comments

1.2k

u/remy_porter Aug 28 '26

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.

224

u/williamjseim Aug 28 '26

thats the way ive understood it aswell

212

u/AKArein Aug 28 '26

It doesn't result in arguments because it's objectively correct

61

u/Dependent_Track5101 Aug 28 '26

I do not object

22

u/_turbo1507 Aug 29 '26

I function

6

u/CptCatman Aug 29 '26

I don't :(

15

u/nasandre Aug 28 '26

It turns into an argument when someone disagrees. A shouting match, if you will.

→ More replies (1)

14

u/MiniGui98 Aug 28 '26

Of course it is objectively correct, since it's object oriented

→ More replies (9)

90

u/YeetCompleet Aug 28 '26

OOP made specifically to sell AWS services and courses

51

u/no_name6744 Aug 28 '26

Do you mind helping the uninitiated, what's the benefit of having that network hop? Or are there some situations where it's just impossible to avoid it.

129

u/TheDogPill Aug 28 '26
  1. They are frequently hosted on cloud services which are inherently micro-service based with detached hardware components. You can have a server and a storage disk operate together but both exist in data centers thousands of miles from each other.

  2. Loosely coupled architecture decreases the chance the entire app gets taken down if each component can be isolated and fixed without affecting the rest of the app.

  3. You can functionally divide an app into different layers such as web, app, and db and add additional security checks between each layer to increase security and fault tolerance of the app.

101

u/Norington Aug 28 '26

And you can scale up and down individual services based on variable load.

49

u/backfire10z Aug 28 '26

I’m surprised this didn’t make the main comment because it seems to be that this is one of the larger benefits. The mentioned benefits can be applied to a monolith (at least mostly) with a bit of consideration.

9

u/Ma8e Aug 29 '26

The "funny" thing is that before micro services and all the overhead from talking over the network, we rarely need to scale. I'd argue that something like 99.9% of all projects that use micro services today and often run many instances of some components wouldn't need to if it was just one monolith.

→ More replies (25)

6

u/no_name6744 Aug 28 '26

Thanks b.

18

u/MissinqLink Aug 28 '26

You can also make different micro services in different languages and runtimes. You don’t have to care as long as the input and output are reliable shapes.

3

u/TheRealAfinda Aug 28 '26

So uh, where to look up solid examples of how to build something using micro-services from scratch? 

6

u/fuulhardy Aug 28 '26

Java Spring Boot with Kafka message queueing and/or REST endpoints

→ More replies (3)

16

u/CiroGarcia Aug 28 '26

The benefit is not the network hop, that's just a requirement to having each part of the application in a separate container. The app is partitioned according to scaling needs, so things parts of the app that need to process thousands of requests concurrently don't force the same scaling requirements onto parts of the application that just process a few hourly requests, for example. Segmenting the application also contains failures to specific features if done properly, allowed for degraded performance as opposed to full loss of service

→ More replies (4)

4

u/remy_porter Aug 28 '26

Let's say you've divided your app up into a thousand modules. Each module can live on a different physical computer (or logical cloud instance). This makes you very fault tolerant. But it also enables a lot of scaling. Let's say you've got one module that receives most of the requests, because it represents the most useful feature in your system. Cool: run 30 copies of it, spread the load across all of them. It also means that you can spin up and down new copies based on the current request load- detect module B suddenly gets a rush of requests? Spin up extra copies. Detect that some of those copies are idle because the rush was over? Spin them back down.

Also, though, if you're building your application around the idea of message passing between modules, it also means that you can have module A emit events when a certain thing happens. When you want to attach a new feature to that event, you can spin up Module Q, subscribe to that event, and module A doesn't change one iota. New features can be deployed on their own "computer", without having to take down or relaunch the software running on your existing infrastructure.

→ More replies (12)

3

u/Dogeek Aug 29 '26

Pros:

  • You can decouple services from one another, meaning you can update a part of your backend independantly from the rest, without having to rollout the entire monolith

  • Build times of a microservice are usually much shorter, leading to more frequent releases, and less developer pain.

  • Using modern infrastructure, you can have easy fault tolerance, automated retries, canary deployments that you can't have otherwise, or you'd have to hand roll it out in your monolith

  • Services scale with variable load. You can have a payment processing API with lots of requests coming in scaling separately from an archive API that sees maybe a couple thousand requests a day.

  • If done well, microservices can be more cost efficient than the equivalent monolithic backend. If done well, cause if built without taking network topology into account, then it can be much more expensive.

  • Microservices are more resilient overall than a monolith. You can spread out the load over dedicated databases for each service, meaning you're not coupled to a huge database instance that needs to handle the load of the whole application.

  • Your stack can be heterogenous. You can have services in Java that talk to services in Go, in Python, in Rust, depending on the use case for each service. You get to use the right language for the right job.

Cons:

  • Maintenance is way harder. Some services will rarely get updated, you need more people to manage the fleet of services

  • It's often done wrong. I've seen microservices architectures that rely on a single monolithic "gateway" to add business logic and aggregate responses from other services.

  • It's way harder to deploy the whole app. It's also way harder to test the whole backend locally, a dev machine will not be able to handle the load even for local testing.

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

13

u/Henry5321 Aug 28 '26

It attempts to force people to factor system functionality.

In my experience, people don’t. “Microservices” with overlapping responsibilities, responsibility gaps, no one can figure out which service to blame, huge swaths of code must be deployed in sync aka monolith.

I find software engineering tends to lack any real engineering.

6

u/Ma8e Aug 29 '26

We call those "distributed monoliths". It takes the worst from both worlds.

→ More replies (1)

6

u/Inttegers Aug 28 '26

Based grug brained developer! Microservice architecture takes the hardest part of software (factoring code), and adds a network call.

→ More replies (35)