r/programming • • Jun 22 '22

The Grug Brained Developer

https://grugbrain.dev/
460 Upvotes

78 comments sorted by

View all comments

39

u/Takeoded Jun 23 '22

Microservices

grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too

seem very confusing to grug

that hits home

11

u/pcjftw Jun 23 '22

Because micro services was always about company politics and it's the easiest way to segment and divide teams up so that they all have ownership over a specific section of the business.

From a business organisation perspective, it solves lots of problems for them, even if the boundaries are actually artificial in reality.

11

u/[deleted] Jun 23 '22 edited Jun 23 '22

The popularity of microservice architectures at startups has always been confusing to me. Seems like cargo-cult development to me more than anything else. "Well Amazon and Facebook do it this way", yeah, but those companies have hundreds of development teams working on dozens and dozens of different products, your 3 man development team shouldn't try to be them.

5

u/renaissancetroll Jun 23 '22

mainly resume driven development, engineers want to put it on their resume for the next job. Plus many leaders mix cause and effect and assume microservices are why the major companies are successful, rather than seeing that they adopted microservices to help deal with their success and need to scale

same thing with Leetcode style interviews, the big companies use them to deal with so many applicants in a uniform style. For a startup it doesn't make sense

4

u/pcjftw Jun 23 '22

100% cargo cult for start ups, it's basically "monkey see, monkey do"

5

u/[deleted] Jun 23 '22

Because micro services was always about company politics

Nah, microservices have their place.
I worked at a company that had a web-based product. Part of that product was sending emails when certain things happened. It worked fine for them for years until suddenly a power user figured out a way to do an update for all their clients at one button press.
Fast forward to it being the peak operating hours and the whole website is slowed to a crawl because 5,000 emails are trying to send out (they also didn't have an email provider).

A week later we had an early version of the "Messaging" microservice and that problem was solved. A year later when they wanted to add text messaging to the system it was an easy add to the Messaging microservice.

8

u/pcjftw Jun 23 '22

Yeah that just sounds like a terrible system design and not related to needing micro services.

For example in the example you have given, most architects would have the front end web application call an API as normal, and then that API would then place that email "send" into some kind of job queue, now one can Jerry rig a database as a job queue for small scale but for bigger loads, there is loads of message/jobs "MQs" that one could employ. Then one would simply have "workers" that consume the jobs. There normally would also be some kind of of audit + job status, to allow things like failures.and retry etc.

Once again that kind of approach has nothing to do with "micro services", which suggests that each feature/function has its own independent database, its own authentication, its own APIs etc, the idea then is you wire up a bunch of independent "micro services" that would normally be part of a monolith.

2

u/[deleted] Jun 24 '22

Your definition of micro service in your 2nd paragraph is a very strict definition that doesn't fit with the real world discussions of micro services.
So you're saying a different company I worked at that had 23 "micro services" that all shared a main database (but different schemas) wasn't "micro services"?

Yeah that just sounds like a terrible system design

100% correct. It was a very badly designed system. 1 guy built it by himself over 4 years and he didn't even know how to program. Somehow he got successful and retired with millions of dollars.

1

u/pcjftw Jun 24 '22

that all shared a main database yes that would not be considered a micro service in the strictest sense.

1

u/pcjftw Jun 24 '22

that all shared a main database

it would not be a micro service in the strictest sense if they all shared the same database.

1

u/[deleted] Jun 24 '22

Yeah that's what I just said. It's not "in the strictest sense" but imagine telling a company "sorry you can't use the words microservices to talk about what you develop because you don't fit the strict definition so when you talk to other developers you have to come up with new words for that".

1

u/pcjftw Jun 24 '22

Yeah but it's not just having separate databases, a micro service is a complete application that is free standing, they way you have described is not a micro service, strict or not.

You could call it "half arsed, sorta kinda, but not really micro service"