Live data from Hacker News

Microservices are hard

code-held.com

181–190 of 356 posts

Re: Microservices are hard

#181
post #172

Earlier quoted context omitted.

> No, they aren't. The entire point of the big ball of mud is that there are no meaningful divisions in the code. Everything uses everything willy-nilly, at the smallest possible level of abstraction. There is, metaphorically if not always entirely literally, not a single line of code in the system that you can change without fear of bringing something else down that you may not have even known they existed. This is…

Funny, I was thinking of linking to that page myself in support and decided against it. I particularly was thinking of: "What does this muddy code look like to the programmers in the trenches who must confront it? Data structures may be haphazardly constructed, or even next to non-existent. Everything talks to everything else. Every shred of important state data may be global. There are those who might construe this…

You can have comparable problems with microservices. Those BBOM problems you highlight occur when good development practices are ignored. So if good development practices are ignored under microservices, what can happen?

Multiple, different services sharing the same database seems comparable to global state under BBOM. This shared database is a back channel.

Furthermore, as the article describes, if you don't define your domain boundaries correctly then changes are not necessarily confined to a single microservice.

As for blowing up a service three layers away, of course this can still happen. Just because you inserted the network between those layers doesn't mean that layer 1 can't produce outputs that triggers an edge case in layer 3 that wasn't properly tested. Similar failure modes are mostly all still there, it's just easier to violate certain good practices in a monolithic system. Maybe that means it happens more often in the BBOM, but that doesn't mean it doesn't happen at all with microservices.

I think the article broke this all down exactly right. Microservices pushes complexity into infrastructure, and sometimes that's good, but often you want that complexity in code and encapsulated in well-designed abstractions that are enforced by the language (like a good module system).

Re: Microservices are hard

#182
post #26

Earlier quoted context omitted.

> Any time you lean on code in a random GitHub repository, where you never speak to the author and just use the API you're given, you're doing microservices. So a library is a microservice now?

…Yes? So many people have very little respect for the effects of the fact that this field is so ridiculously young, including the fact that all of these definitions are incredibly wishy washy. Being able to take a statement like “an external dependency is a microservice” and not completely discounting the point being made is incredibly valuable.

No, sorry, the field is not ridiculously young. The issue is the technical decision making process is now delegated to "ridiculously" inexperienced developers.

> an external dependency is a microservice

Regret to disagree again. Flip that and you have a leg to stand on at least: A microservice is an external dependency. Service defines the architectural semantics of the dependency. Micro scopes the services provided.

Re: Microservices are hard

#183
Microservices can be useful when a single team can’t handle a service anymore. You should have as few services as possible, not as many as possible (eg see team Topologies)

Otherwise, use modules, or package by feature, to prevent the big ball of mud problem. That’s useful within a service as well.

Re: Microservices are hard

#184

Earlier quoted context omitted.

> It may be the sloppiest, crappiest definition every, with dynamic types Funny you said that since a microservice API is always dynamically typed and its usage cannot be checked by compiler. And the more microservices you use the more dynamically typed the whole project gets overall. While you can opt into a free for all everything importing everything, all languages do also support creating modules which define API…

Although true to some extent, this is also a tooling issue. We use OpenAPI and generate clients. Strictly speaking the interoperability layer doesn't know the truth on the other side, but when generated correctly, the developer doesn't need to worry about it.

When you change function signature it doesn't compile until you fix all the call sites. Maybe after you see all the broken call sites you think that's too much work maybe there is some other way to do what I want.

When you change anything about an endpoint, it compiles just fine no matter what clients there are or what they are doing. You proceed with the change without worry. Yes, you can have some self-discipline to also generate the open api documents, generate the clients and then check all clients but self-discipline like that is not reliable.

So while tooling can help it's still not the same thing.

Re: Microservices are hard

#185

Don’t you find it weird that everybody else is either over or underengineering, but you , you engineer things exactly the right amount? I bet when you’re driving, you also tend to notice that everyone else is either an idiot driving way too slow in the middle lane or a maniac speeding past you. Nobody else drives as well as you do. It must be exhausting for these people to live in a world surrounded by strawmen, whil…

Yeah, it's crazy the hate microservices get. I happen to work on a product that needs to scale to handle millions of transactions distributed all over the world and the cloud microservice system is just flawless for this purpose. Is it harder to debug than a monolith? Sure. You need a team that has a good understanding about distributed systems (most coworkers have degrees and the ones without are really good at self…

Often the microservices hate is around sole developers ranting about how a waste they are, and how everything would be way better if only everyone was very careful and had good practices totally as second nature.

And it's similar in nature as the hate around high level languages: "If only everyone had decades of experience with C, "toy languages" wouldn't exist and programs would be lighter and faster today".

Re: Microservices are hard

#186

Earlier quoted context omitted.

No. That's not what microservices means. You're intentionally equating all services to microservices, which is not the case. This substitution is what is commonly known as a Strawman argument. You misrepresented an argument, to discredit it easier.

> That's not what microservices means. You're intentionally equating all services to microservices, which is not the case. Eventually everyone provides a service to someone, I guess, but there is a clear division between those who serve end users and those who serve the servers. The service that places your food down on the table at the restaurant is not thought of in the same was as those who get to the food to the…

Microservices is defined to be extreme decomposition, which is not the same as a service. And the biggest pitfall of microservice architecture, is the creep of loose coupling.

Right now I work in an environment, where user account information is copied to every single microservice's internal DB... to minimize access time to that information...

Restaurant provides you with a service - one single interface.

Imagine if a restaurant used a microservice architecture? You'd be spending your time going from the fridge to the cooks, moving your food from one to another(because no cook will do the whole recipe), then going to the dish storage, having a separate cook arrange your food on your plate, etc.

Re: Microservices are hard

#187
post #5

I'd say it doesn't have to be. There is a certain kind of "freedom" that is really slavery, but people feel so free when they hear about it is they often squee and hurt themselves with uncontrolled movements. Microservices can be that way. Now that you have 25 different services in 25 different address spaces you can write them in 11 different languages and even use 4 versions of Python and 3 versions of Java. (I got…

> you have to standardize build, deployment, configuration, serialization, logging, and many "little" things that are essential but secondary to the application ...so then you can go reimplementing those standards in 25 different services written in 11 different languages. Sounds like fun! I don't think it's possible to just write a library/framework that would encapsulate all of those standards and re-use it in diff…

A standardized build and deployment process can be done in a language agnostic way with containers. Every service defines its own Dockerfile. The CI/CD process just runs docker build and whatever process is needed to pull an image and run it in whatever environment.

Configuration is either done with ENVs or with some standard configuration service (which is an API call that can made on service start)

Logging is just standard out in the container. Each team uses whatever logging library is appropriate for their language. Only requirement is that it supports logging to console. There are a plethora of options for shipping those logs to somewhere centralized (fluentd/fluentbit, logstash, etc)

Some of this stuff can also be done with sidecars (see something like Dapr)

So, no, you can't write a library but you can standardize.

Re: Microservices are hard

#188

Earlier quoted context omitted.

> Monoliths can also scale horizontally At a (potentially much) bigger cost.

Running costs or development costs? If you have a low-request / high complexity persistent application you may want to optimize for maintainability. Having all the code in one place _can_ make things easier to figure out in the long term.

Also there’s configuration management costs to consider, which usually ends up being a biggie.

Re: Microservices are hard

#189
post #158

I really do not understand the debate on monoliths and microservice anymore. Context matters so much. Should you have absolutely everything in 1 system. No. And I think no one thinks that anymore. Should you spilt your system into as many pieces as possible? No, of course not. You are prop. storing files one place and have a data in a database another place. And most likely none are on the webserver receiving request…

An important part of programming as a discipline is coming up with things that work regardless of context.

Re: Microservices are hard

#190
post #26

Earlier quoted context omitted.

> Any time you lean on code in a random GitHub repository, where you never speak to the author and just use the API you're given, you're doing microservices. So a library is a microservice now?

…Yes? So many people have very little respect for the effects of the fact that this field is so ridiculously young, including the fact that all of these definitions are incredibly wishy washy. Being able to take a statement like “an external dependency is a microservice” and not completely discounting the point being made is incredibly valuable.

It‘s not that young. Chemistry (once it became a real science) is perhaps 250 years old. Computer science is 50-70 years old.
Post reply on HN